赞
踩
这部分内容我实在记不起来是我自己总结的还是从哪里看来的?看着凌乱的内容,感觉应该是当时随笔记录的理解,即使是copy来的,也算是当时工作中的一些总结
WebView extends AbsoluteLayout implements ViewTreeObserver.OnGlobalFocusChangeListener, ViewGroup.OnHierarchyChangeListener
CallbackProxy mCallbackProxy
WebViewCore mWebViewCore, many webview operation or public method using webviewcore to do something.
int mNativeClass,
mPrivateHandler, Handler for dispatching UI messages, in some cases, if it needs extra action before dispatch message, it will launch a new thread to do extra work then dispatching message. General handler to receive message coming from webkit thread. For UI relating, it will invoke callbackproxy to do
final Handler mPrivateHandler = new PrivateHandler(); Handler for dispatching UI messages.
class CallbackProxy extends Handler, a proxy class for handling WebCore -> UI thread messaging. All the callback functions are called from the WebCore thread and messages are posted to the UI thread for the actual client callback.
This class is created in the UI thread so its handler and any private classes that extend Handler will operate in the UI thread.
class WebViewCore
WebViewCore always executes in the same thread as the native webkit.
private final CallbackProxy mCallbackProxy; Proxy for handling callbacks from native code
BrowserFrame mBrowserFrame; The BrowserFrame is an interface to the native Frame component.
In it, Thread t = new Thread(new WebCoreThread()); will be created
mBrowserFrame = new BrowserFrame
mEventHub. It will create a handler to process all webviewcore invoke
In webviewcore, it will be mWebView.mPrivateHandler.sendMessage.XX
In webview, it will be like mWebViewCore.sendMessage(EventHub.XXX
class BrowserFrame extends Handler,
UI BrowserFrame.java->nativeLoadUrl == WebCoreFrameBridge.cpp->LoadUrl
CORE BrowserFrame.java-> loadStarted
CallbackProxy.java->onPageStarted
UI CallbackProxy.java -> PAGE_STARTED
WebView.java->onPageStarted
CORE WebViewCore.removeMessages
WebViewCore$EventHub.removeMessages
BrowserFrame.setProgress
CallbackProxy.java->onProgressChanged
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。