Rebecca Chang Swee Fun fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
..
common fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
java fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
javatests fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
javatestutil fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
js_communication fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
OWNERS fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
README.md fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
browser.cc fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
browser.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
browser_observer.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
browser_restore_observer.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
cookie_manager.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
download.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
download_delegate.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
error_page.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
error_page_delegate.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
favicon_fetcher.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
favicon_fetcher_delegate.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
fullscreen_delegate.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
google_account_access_token_fetch_delegate.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
google_accounts_delegate.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
main.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
navigation.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
navigation_controller.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
navigation_observer.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
new_tab_delegate.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
page.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
prerender_controller.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
profile.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
tab.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
tab_observer.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago
url_bar_controller.h fea2a55e2a Publish chromium based on 107.0.5304.88 1 year ago

README.md

WebLayer public API

This directory contains the public API for WebLayer. WebLayer provides both a C++ and Java API. Note that while WebLayer’s implementation builds on top of //content, its public API does not expose the Content API.

Java API

In general, the Java API is a thin veneer over the C++ API. For the most part, functionality should be added to the C++ side with the Java implementation calling into it. Where the two APIs diverge is for platform specific functionality. For example, the Java API uses Android Fragments, which do not apply to the C++ side.

The public API should follow the Android API guidelines (https://goto.google.com/android-api-guidelines). This results in naming differences between the C++ and Java code. For example, NewTabDelegate in C++ vs NewTabCallback in Java.

WebLayer currently supports version skew of three versions.

One of the design constraints of WebLayer’s Java implementation is that we do not want embedders to ship their own copy of «//content». Instead, the implementation is loaded from the WebView APK (not the Chrome APK, because the WebView APK is available on more devices). This constraint results in the Java implementation consisting of three distinct parts.

Java client library

Code lives in «//weblayer/public/java». This is the code used by embedders. The client library contains very little logic, rather it delegates to the Java implementation over AIDL.

This code should not have any dependencies on any other code in the chrome repo.

Java AIDL

This is best thought of as WebLayer’s ABI (for Java).

The client library loads the WebLayer implementation from WebView APK and uses AIDL for the IPC. The aidl interfaces are defined in «//weblayer/browser/java/org/chromium/weblayer_private/interfaces». AIDL is used to enable the implementation to be loaded using a different ClassLoader than the embedder.

In general, any interface ending with ‘Client’ means the interface is from the implementation side to the client library. An interface without ‘Client’ is from the client to the implementation.

Java implementation

This is often referred to as the ‘implementation’ of the Java API. This is where the bulk of the Java code lives and sits on top of the C++ API. The code for this lives in «//weblayer/browser/java».