WebKit in Android Framework

这部分内容我实在记不起来是我自己总结的还是从哪里看来的?看着凌乱的内容,感觉应该是当时随笔记录的理解,即使是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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值