a.webkit to chromium to webkit
ResourceLoaderAndroid to chromium// for file1.ResourceLoaderAndroid::start
2.WebUrlLoader::start (convert "ResourceRequest" to "WebRequest")
3.WebUrlLoaderClient::start
4.WebRequest::start
5.URLRequest::start()//chromium
6.URLRequest::StartJob(URLRequestJobManager::CreateJob)//create different job
//URLRequest::StartInternal() for 4.0
7.job.start()//depending on defferent job.
8.URLRequestFileJob::Start()//PostTask(FROM_HERE, NewRunnableMethod(this, &URLRequestFileJob::DidResolve)
9.URLRequestFileJob::DidResolve
10.NotifyHeadersComplete()
11.URLRequest::ResponseStarted(URLRequest ){delegate_->OnResponseStarted(this);}
12.WebRequest::OnResponseStarted(URLRequest);//create WebResponse.
//pass URLRequest to webkit, so get the type
13.WebUrlLoaderClient::didReceiveResponse.
b.chromium to socket
chromium to socket,take URLRequestHttpJob for example
1.URLRequestHttpJob::Start()
2.URLRequestHttpJob::AddCookieHeaderAndStart()
3.URLRequestHttpJob::OnCanGetCookiesCompleted()
4.StartTransaction()
5.HttpNetworkTransaction::Start()
6.HttpNetworkTransaction::DoLoop()//create
7.HttpNetworkTransaction::DoCreateStream()
8.HttpStreamFactoryImpl::RequestStream//http_stream_factory_impl.cc
need to be finished
c chromium webkit's interface
if we provide a service, we need to do at least two things.
1). we provide a class that can provide service, the client use the class's object to do the work.
2). we need to provide a abstract interface for callback.
and we call the callback interface at the proper time.
3). And as "b" says, the client need a class to be the subclass of the callback interface. and set the object as the server's real client.
so the bilateral channel is setup.
interface between chromium and webkit
1.URLRequest (url_request.h)
chromium's service class, it's was exposed to webkit, and webkit will call it for download.
2.URLRequest::Delegate
chromimu's callback interface, it's method will be called by chromium at proper time.
3.WebRequest
Webkit's client class. It's also the server's callback class.
1). it's subclass of URLRequest::Delegate, it will set itself to the URLRequest.
2). it will use URLRequest's object to use the service.
3). it's method (inherited from URLRequest::Delegate) will be called by URLRequest at the proper time.
d. click to load
TitleBarXlarge->onClick
TitleBarBase->onAction
Controller->handleNewIntent
IntentHandler->onNewIntent
Controller->openTabAndShow
e rtsp protocal to other application
PolicyChecker::continueAfterNavigationPolicy
FrameLoaderClientAndroid::canHandleRequest
WebFrame::canHandleRequest
BrowserFrame::handleUrl
CallbackProxy::shouldOverrideUrlLoading
CallbackProxy::handlemessage:OVERRIDE_URL
CallbackProxy::uiOverrideUrlLoading
WebViewClient::shouldOverrideUrlLoading
Controller::shouldOverrideUrlLoading
UrlHandler::shouldOverrideUrlLoading
f. chromium's job
{ "http", URLRequestHttpJob::Factory },
{ "https", URLRequestHttpJob::Factory },
{ "file", URLRequestFileJob::Factory },
#ifndef ANDROID
{ "ftp", URLRequestFtpJob::Factory },
{ "about", URLRequestAboutJob::Factory },
{ "data", URLRequestDataJob::Factory },
g. apache dns
Socket()//httpconnection
tryAllAddresses() //InetAddress.getAllByName
startupSocket
impl.connect(dstAddress, dstPort);
?impl
PlainSocketImpl
PlainSocketImpl.connect
socksConnect
socksRequestConnection