orgbrazerzkidai.blogg.se

Ebolaxternl memory note 4
Ebolaxternl memory note 4





ebolaxternl memory note 4

> content::EmbeddedWorkerInstance::ProcessAllocated //from IO thread > ServiceWorkerProcessManager::AllocateWorkerProcess //from UI thread > ServiceWorkerProcessManager::AllocateWorkerProcess //PostTask to UI thread > ServiceWorkerProcessManager::AllocateWorkerProcess //from IO thread > content::EmbeddedWorkerInstance::RunProcessAllocated Step 2: Dispatch process (multi-process mode)/thread (single-process mode).īefore ServiceWorker starts, it must first apply to the browser UI thread to assign a thread, and then return to the IO thread to continue the startup process of the ServiceWorker thread. > EmbeddedWorkerInstance::Start //Trigger the startup process of ServiceWorker

ebolaxternl memory note 4

> content::ServiceWorkerVersion::DispatchFetchEvent > content::ServiceWorkerFetchDispatcher::DispatchFetchEvent //dispatch a Fetch event from the IO thread > content::ServiceWorkerURLRequestJob::StartRequest > content::ServiceWorkerControlleeRequestHandler::DidLookupRegistrationForMainResource > content::ServiceWorkerControlleeRequestHandler::PrepareForMainResource Generally speaking, when we visit the main document of a page containing ServiceWorker, before initiating the main document request, it will first dispatch a Fetch event, which will trigger the startup process of the ServiceWorker page.Ĭontent::ServiceWorkerControlleeRequestHandler::MaybeCreateJob //Prepare to create the job of the main document Let's take a look at the startup process of ServiceWorker first, and divide the entire startup process of the ServiceWorker thread into five major steps: What is the mystery here? Start the process But when we use ServiceWorker related capabilities to write PWA applications, we occasionally find that the performance is not as good as expected. ServiceWorker provides front-end developers with very powerful cache manipulation capabilities, flexible request interception capabilities, and efficient message push capabilities.







Ebolaxternl memory note 4