android4.4 WebView Chromium is a single process, and all the components in the diagram are running in the browser process.
The chromium kernel structure associated with the display page in this diagram is described in the top-down order.
1. Awcontents->webcontentsimpl
The process of creating awcontnents is as follows:
Awcontents is the main implementation class of the WebView interface.
The awcontents of the native layer contains the class webcontents in the Chromium kernel browser component.
Webcontents is the entrance to the Chromium kernel browser component.
We look at the structure of the Java layer and the native layer of awcontents.
Contentviewcore:
The Java layer awcontents transfers WebView interface calls to the Java layer contentviewcore. Native Layer
The Contentviewcore contains the entry Webcontentsimpl for the browser component. Truly implement WebView functions
is the Webcontentsimpl.
Awcontentsclient:
The implementation class Webviewcontentsclientadapter of Awcontentsclient is contained in Webviewchromium,
Webviewchromium uses this class to receive awcontents callbacks. Webviewcontentsclientadapter
Encapsulates the webviewclient and Webchromeclient implemented by the application layer.
Awcontentsclientbridge:
Handles JS-related JNI communication for awcontentsclient.
Awwebcontentsdelegate:
is part of the Awcontentsclient interface and is used to receive callbacks from the Webcontentsimpl module.
Awwebcontentsdelegate transfer the specific implementation to the awcontentsclient.
The Webcontentsimpl creation process is as follows:
2.webcontentsimpl->renderer Host
Renderwidgethostdelegate:
Classes that are interested in the state of Renderwidgethost will implement this interface. Notification of status changes used to receive renderwidgethost.
Renderviewhostdelegate:
Classes that are interested in the state of Renderviewhost will implement this interface. Notification of status changes used to receive renderviewhost.
Renderviewhostmanager is responsible for creating and managing the renderviewhosts used in Webcontentsimpl.
The Renderviewhostmanager instance is created in the Webcontentsimpl constructor and acts as a renderwidgethostdelegate
and Renderviewhostdelegate instances to Renderviewhostmanager.
Renderviewhostmanager notifies Webcontentsimpl of the current renderwidgethost and renderviewhost through callbacks for both interfaces
Changes in state.
The Renderviewhostimpl process is created as follows.
The Renderviewhostimpl and the Renderviewimpl are one by one corresponding.
3.renderer Host->renderer
The Renderviewimpl is the core module in the renderer component.
is the Renderviewimpl creation process triggered by the application layer.
4.renderer->webkit Glue
Renderviewimpl structure diagram
Webkit::webview the creation process
Renderviewimpl::create () calls the constructor of Renderviewimpl to create
An instance of Renderviewimpl, and then calls Renderviewimpl::initialize:
Renderviewimpl::initialize () {
webwidget_ = Webview::create (this);
}
The instance creation of Renderwidget is triggered by a down function:
Renderviewimpl::createpopupmenu () {
renderwidget* widget =
Renderwidget::create (Routing_id_, Popup_type, screen_info_);
return Widget->webwidget ();
}
Renderwidget::create () only this one entrance.
Used to create different types of pop-up windows.
5. WebKit Glue->webkit
Structure diagram of Webviewimpl: