• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

common/H12-Nov-2020-2810

java/H12-Nov-2020-4,8102,889

javatests/H12-Nov-2020-410313

javatestutil/H12-Nov-2020-9468

OWNERSH A D07-Nov-202040 32

README.mdH A D07-Nov-20202.3 KiB5539

browser.ccH A D07-Nov-2020452 177

browser.hH A D07-Nov-20202.3 KiB7638

browser_observer.hH A D07-Nov-20201,001 3515

cookie_manager.hH A D07-Nov-20201.4 KiB4829

download.hH A D07-Nov-20203.1 KiB9339

download_delegate.hH A D07-Nov-20202.5 KiB6730

error_page_delegate.hH A D07-Nov-2020815 2812

fullscreen_delegate.hH A D07-Nov-2020705 2713

main.hH A D07-Nov-20201.1 KiB5839

navigation.hH A D07-Nov-20203.3 KiB9035

navigation_controller.hH A D07-Nov-20201.9 KiB6831

navigation_observer.hH A D07-Nov-20204.5 KiB10318

new_tab_delegate.hH A D07-Nov-20201.4 KiB5020

profile.hH A D07-Nov-20201.8 KiB6130

tab.hH A D07-Nov-20202.7 KiB8946

tab_observer.hH A D07-Nov-2020905 3415

url_bar_controller.hH A D07-Nov-2020792 2716

README.md

1# WebLayer public API
2
3This directory contains the public API for WebLayer. WebLayer provides both a
4C++ and Java API. Note that while WebLayer's implementation builds on top of
5//content, its public API does *not* expose the Content API.
6
7## Java API
8
9In general, the Java API is a thin veneer over the C++ API. For the most part,
10functionality should be added to the C++ side with the Java implementation
11calling into it. Where the two APIs diverge is for platform specific
12functionality. For example, the Java API uses Android Fragments, which do not
13apply to the C++ side.
14
15The public API should follow the Android API guidelines
16(https://goto.google.com/android-api-guidelines). This results in naming
17differences between the C++ and Java code. For example, NewTabDelegate in C++
18vs NewTabCallback in Java.
19
20WebLayer currently supports version skew of three versions.
21
22One of the design constraints of WebLayer's Java implementation is that we do
23not want embedders to ship their own copy of "//content". Instead, the
24implementation is loaded from the WebView APK (not the Chrome APK, because the
25WebView APK is available on more devices). This constraint results in the Java
26implementation consisting of three distinct parts.
27
28### Java client library
29
30Code lives in "//weblayer/public/java". This is the code used by embedders. The
31client library contains very little logic, rather it delegates to the Java
32implementation over AIDL.
33
34This code should not have any dependencies on any other code in the chrome repo.
35
36### Java AIDL
37
38This is best thought of as WebLayer's ABI (for Java).
39
40The client library loads the WebLayer implementation from WebView APK and uses
41AIDL for the IPC. The aidl interfaces are defined in
42"//weblayer/browser/java/org/chromium/weblayer_private/interfaces". AIDL is used
43to enable the implementation to be loaded using a different ClassLoader than
44the embedder.
45
46In general, any interface ending with 'Client' means the interface is from the
47implementation side to the client library. An interface without 'Client' is
48from the client to the implementation.
49
50### Java implementation
51
52This is often referred to as the 'implementation' of the Java API. This is
53where the bulk of the Java code lives and sits on top of the C++ API. The code
54for this lives in "//weblayer/browser/java".
55