Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp

Issue 2807533003: [WIP2] off-main-thread loading
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "core/workers/WorkerContentSettingsClient.h" 49 #include "core/workers/WorkerContentSettingsClient.h"
50 #include "core/workers/WorkerGlobalScope.h" 50 #include "core/workers/WorkerGlobalScope.h"
51 #include "core/workers/WorkerInspectorProxy.h" 51 #include "core/workers/WorkerInspectorProxy.h"
52 #include "core/workers/WorkerLoaderProxy.h" 52 #include "core/workers/WorkerLoaderProxy.h"
53 #include "core/workers/WorkerScriptLoader.h" 53 #include "core/workers/WorkerScriptLoader.h"
54 #include "core/workers/WorkerThreadStartupData.h" 54 #include "core/workers/WorkerThreadStartupData.h"
55 #include "platform/CrossThreadFunctional.h" 55 #include "platform/CrossThreadFunctional.h"
56 #include "platform/RuntimeEnabledFeatures.h" 56 #include "platform/RuntimeEnabledFeatures.h"
57 #include "platform/heap/Handle.h" 57 #include "platform/heap/Handle.h"
58 #include "platform/heap/Persistent.h" 58 #include "platform/heap/Persistent.h"
59 #include "platform/loader/fetch/ResourceFetcher.h"
59 #include "platform/loader/fetch/ResourceResponse.h" 60 #include "platform/loader/fetch/ResourceResponse.h"
60 #include "platform/network/ContentSecurityPolicyParsers.h" 61 #include "platform/network/ContentSecurityPolicyParsers.h"
61 #include "platform/weborigin/KURL.h" 62 #include "platform/weborigin/KURL.h"
62 #include "platform/weborigin/SecurityOrigin.h" 63 #include "platform/weborigin/SecurityOrigin.h"
63 #include "platform/wtf/Functional.h" 64 #include "platform/wtf/Functional.h"
64 #include "platform/wtf/PtrUtil.h" 65 #include "platform/wtf/PtrUtil.h"
65 #include "public/platform/Platform.h" 66 #include "public/platform/Platform.h"
66 #include "public/platform/WebMessagePortChannel.h" 67 #include "public/platform/WebMessagePortChannel.h"
67 #include "public/platform/WebString.h" 68 #include "public/platform/WebString.h"
68 #include "public/platform/WebURL.h" 69 #include "public/platform/WebURL.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 ProvideIndexedDBClientToWorker(worker_clients, 341 ProvideIndexedDBClientToWorker(worker_clients,
341 IndexedDBClientImpl::Create(*worker_clients)); 342 IndexedDBClientImpl::Create(*worker_clients));
342 343
343 if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) { 344 if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) {
344 std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context = 345 std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context =
345 client_->CreateWorkerFetchContext( 346 client_->CreateWorkerFetchContext(
346 WebLocalFrameBase::FromFrame(main_frame_->GetFrame()) 347 WebLocalFrameBase::FromFrame(main_frame_->GetFrame())
347 ->DataSource() 348 ->DataSource()
348 ->GetServiceWorkerNetworkProvider()); 349 ->GetServiceWorkerNetworkProvider());
349 DCHECK(web_worker_fetch_context); 350 DCHECK(web_worker_fetch_context);
350 // TODO(horo): Set more information about the context (ex: AppCacheHostID) 351 web_worker_fetch_context->SetAppCacheHostID(main_frame_->GetFrame()
351 // to |web_worker_fetch_context|. 352 ->GetDocument()
353 ->Fetcher()
354 ->Context()
355 .ApplicationCacheHostID());
352 web_worker_fetch_context->SetDataSaverEnabled( 356 web_worker_fetch_context->SetDataSaverEnabled(
353 main_frame_->GetFrame()->GetSettings()->GetDataSaverEnabled()); 357 main_frame_->GetFrame()->GetSettings()->GetDataSaverEnabled());
354 ProvideWorkerFetchContextToWorker(worker_clients, 358 ProvideWorkerFetchContextToWorker(worker_clients,
355 std::move(web_worker_fetch_context)); 359 std::move(web_worker_fetch_context));
356 } 360 }
357 361
358 ContentSecurityPolicy* content_security_policy = 362 ContentSecurityPolicy* content_security_policy =
359 main_script_loader_->ReleaseContentSecurityPolicy(); 363 main_script_loader_->ReleaseContentSecurityPolicy();
360 WorkerThreadStartMode start_mode = 364 WorkerThreadStartMode start_mode =
361 worker_inspector_proxy_->WorkerStartMode(loading_document_); 365 worker_inspector_proxy_->WorkerStartMode(loading_document_);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if (devtools_agent) 443 if (devtools_agent)
440 devtools_agent->DispatchOnInspectorBackend(session_id, call_id, method, 444 devtools_agent->DispatchOnInspectorBackend(session_id, call_id, method,
441 message); 445 message);
442 } 446 }
443 447
444 WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) { 448 WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) {
445 return new WebSharedWorkerImpl(client); 449 return new WebSharedWorkerImpl(client);
446 } 450 }
447 451
448 } // namespace blink 452 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698