Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 #include "web/WebSharedWorkerImpl.h" | 31 #include "web/WebSharedWorkerImpl.h" |
| 32 | 32 |
| 33 #include <memory> | 33 #include <memory> |
| 34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
| 35 #include "core/events/MessageEvent.h" | 35 #include "core/events/MessageEvent.h" |
| 36 #include "core/inspector/ConsoleMessage.h" | 36 #include "core/inspector/ConsoleMessage.h" |
| 37 #include "core/loader/FrameLoadRequest.h" | 37 #include "core/loader/FrameLoadRequest.h" |
| 38 #include "core/loader/FrameLoader.h" | 38 #include "core/loader/FrameLoader.h" |
| 39 #include "core/loader/ThreadableLoadingContext.h" | 39 #include "core/loader/ThreadableLoadingContext.h" |
| 40 #include "core/loader/WorkerFetchContext.h" | |
| 40 #include "core/probe/CoreProbes.h" | 41 #include "core/probe/CoreProbes.h" |
| 41 #include "core/workers/ParentFrameTaskRunners.h" | 42 #include "core/workers/ParentFrameTaskRunners.h" |
| 42 #include "core/workers/SharedWorkerGlobalScope.h" | 43 #include "core/workers/SharedWorkerGlobalScope.h" |
| 43 #include "core/workers/SharedWorkerThread.h" | 44 #include "core/workers/SharedWorkerThread.h" |
| 44 #include "core/workers/WorkerClients.h" | 45 #include "core/workers/WorkerClients.h" |
| 45 #include "core/workers/WorkerGlobalScope.h" | 46 #include "core/workers/WorkerGlobalScope.h" |
| 46 #include "core/workers/WorkerInspectorProxy.h" | 47 #include "core/workers/WorkerInspectorProxy.h" |
| 47 #include "core/workers/WorkerLoaderProxy.h" | 48 #include "core/workers/WorkerLoaderProxy.h" |
| 48 #include "core/workers/WorkerScriptLoader.h" | 49 #include "core/workers/WorkerScriptLoader.h" |
| 49 #include "core/workers/WorkerThreadStartupData.h" | 50 #include "core/workers/WorkerThreadStartupData.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 WorkerClients* worker_clients = WorkerClients::Create(); | 333 WorkerClients* worker_clients = WorkerClients::Create(); |
| 333 ProvideLocalFileSystemToWorker(worker_clients, | 334 ProvideLocalFileSystemToWorker(worker_clients, |
| 334 LocalFileSystemClient::Create()); | 335 LocalFileSystemClient::Create()); |
| 335 WebSecurityOrigin web_security_origin(loading_document_->GetSecurityOrigin()); | 336 WebSecurityOrigin web_security_origin(loading_document_->GetSecurityOrigin()); |
| 336 ProvideContentSettingsClientToWorker( | 337 ProvideContentSettingsClientToWorker( |
| 337 worker_clients, | 338 worker_clients, |
| 338 WTF::WrapUnique(client_->CreateWorkerContentSettingsClientProxy( | 339 WTF::WrapUnique(client_->CreateWorkerContentSettingsClientProxy( |
| 339 web_security_origin))); | 340 web_security_origin))); |
| 340 ProvideIndexedDBClientToWorker(worker_clients, | 341 ProvideIndexedDBClientToWorker(worker_clients, |
| 341 IndexedDBClientImpl::Create(*worker_clients)); | 342 IndexedDBClientImpl::Create(*worker_clients)); |
| 343 | |
| 344 std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context = | |
|
nhiroki
2017/04/18 07:56:41
ditto.
horo
2017/04/18 12:53:34
Done.
| |
| 345 Platform::Current()->CreateWorkerFetchContext(); | |
| 346 // |web_worker_fetch_context| is null if off-main-thread-fetch is disabled. | |
| 347 if (web_worker_fetch_context) { | |
| 348 // TODO(horo): Set more information about the context (ex: Service Worker | |
| 349 // provider ID) to |web_worker_fetch_context|. | |
| 350 ProvideWorkerFetchContextToWorker(worker_clients, | |
| 351 std::move(web_worker_fetch_context)); | |
| 352 } | |
| 353 | |
| 342 ContentSecurityPolicy* content_security_policy = | 354 ContentSecurityPolicy* content_security_policy = |
| 343 main_script_loader_->ReleaseContentSecurityPolicy(); | 355 main_script_loader_->ReleaseContentSecurityPolicy(); |
| 344 WorkerThreadStartMode start_mode = | 356 WorkerThreadStartMode start_mode = |
| 345 worker_inspector_proxy_->WorkerStartMode(document); | 357 worker_inspector_proxy_->WorkerStartMode(document); |
| 346 std::unique_ptr<WorkerSettings> worker_settings = | 358 std::unique_ptr<WorkerSettings> worker_settings = |
| 347 WTF::WrapUnique(new WorkerSettings(document->GetSettings())); | 359 WTF::WrapUnique(new WorkerSettings(document->GetSettings())); |
| 348 std::unique_ptr<WorkerThreadStartupData> startup_data = | 360 std::unique_ptr<WorkerThreadStartupData> startup_data = |
| 349 WorkerThreadStartupData::Create( | 361 WorkerThreadStartupData::Create( |
| 350 url_, loading_document_->UserAgent(), | 362 url_, loading_document_->UserAgent(), |
| 351 main_script_loader_->SourceText(), nullptr, start_mode, | 363 main_script_loader_->SourceText(), nullptr, start_mode, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 if (devtools_agent) | 433 if (devtools_agent) |
| 422 devtools_agent->DispatchOnInspectorBackend(session_id, call_id, method, | 434 devtools_agent->DispatchOnInspectorBackend(session_id, call_id, method, |
| 423 message); | 435 message); |
| 424 } | 436 } |
| 425 | 437 |
| 426 WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) { | 438 WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) { |
| 427 return new WebSharedWorkerImpl(client); | 439 return new WebSharedWorkerImpl(client); |
| 428 } | 440 } |
| 429 | 441 |
| 430 } // namespace blink | 442 } // namespace blink |
| OLD | NEW |