| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "core/workers/WorkerContentSettingsClient.h" | 48 #include "core/workers/WorkerContentSettingsClient.h" |
| 49 #include "core/workers/WorkerGlobalScope.h" | 49 #include "core/workers/WorkerGlobalScope.h" |
| 50 #include "core/workers/WorkerInspectorProxy.h" | 50 #include "core/workers/WorkerInspectorProxy.h" |
| 51 #include "core/workers/WorkerLoaderProxy.h" | 51 #include "core/workers/WorkerLoaderProxy.h" |
| 52 #include "core/workers/WorkerScriptLoader.h" | 52 #include "core/workers/WorkerScriptLoader.h" |
| 53 #include "core/workers/WorkerThreadStartupData.h" | 53 #include "core/workers/WorkerThreadStartupData.h" |
| 54 #include "platform/CrossThreadFunctional.h" | 54 #include "platform/CrossThreadFunctional.h" |
| 55 #include "platform/RuntimeEnabledFeatures.h" | 55 #include "platform/RuntimeEnabledFeatures.h" |
| 56 #include "platform/heap/Handle.h" | 56 #include "platform/heap/Handle.h" |
| 57 #include "platform/heap/Persistent.h" | 57 #include "platform/heap/Persistent.h" |
| 58 #include "platform/loader/fetch/ResourceFetcher.h" |
| 58 #include "platform/loader/fetch/ResourceResponse.h" | 59 #include "platform/loader/fetch/ResourceResponse.h" |
| 59 #include "platform/network/ContentSecurityPolicyParsers.h" | 60 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 60 #include "platform/weborigin/KURL.h" | 61 #include "platform/weborigin/KURL.h" |
| 61 #include "platform/weborigin/SecurityOrigin.h" | 62 #include "platform/weborigin/SecurityOrigin.h" |
| 62 #include "platform/wtf/Functional.h" | 63 #include "platform/wtf/Functional.h" |
| 63 #include "platform/wtf/PtrUtil.h" | 64 #include "platform/wtf/PtrUtil.h" |
| 64 #include "public/platform/Platform.h" | 65 #include "public/platform/Platform.h" |
| 65 #include "public/platform/WebMessagePortChannel.h" | 66 #include "public/platform/WebMessagePortChannel.h" |
| 66 #include "public/platform/WebString.h" | 67 #include "public/platform/WebString.h" |
| 67 #include "public/platform/WebURL.h" | 68 #include "public/platform/WebURL.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 ProvideIndexedDBClientToWorker(worker_clients, | 332 ProvideIndexedDBClientToWorker(worker_clients, |
| 332 IndexedDBClientImpl::Create(*worker_clients)); | 333 IndexedDBClientImpl::Create(*worker_clients)); |
| 333 | 334 |
| 334 if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) { | 335 if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) { |
| 335 std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context = | 336 std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context = |
| 336 client_->CreateWorkerFetchContext( | 337 client_->CreateWorkerFetchContext( |
| 337 WebLocalFrameImpl::FromFrame(main_frame_->GetFrame()) | 338 WebLocalFrameImpl::FromFrame(main_frame_->GetFrame()) |
| 338 ->DataSource() | 339 ->DataSource() |
| 339 ->GetServiceWorkerNetworkProvider()); | 340 ->GetServiceWorkerNetworkProvider()); |
| 340 DCHECK(web_worker_fetch_context); | 341 DCHECK(web_worker_fetch_context); |
| 341 // TODO(horo): Set more information about the context (ex: DataSaverEnabled) | 342 web_worker_fetch_context->SetAppCacheHostID( |
| 342 // to |web_worker_fetch_context|. | 343 document->Fetcher()->Context().ApplicationCacheHostID()); |
| 344 web_worker_fetch_context->SetDataSaverEnabled( |
| 345 document->GetFrame()->GetSettings()->GetDataSaverEnabled()); |
| 343 ProvideWorkerFetchContextToWorker(worker_clients, | 346 ProvideWorkerFetchContextToWorker(worker_clients, |
| 344 std::move(web_worker_fetch_context)); | 347 std::move(web_worker_fetch_context)); |
| 345 } | 348 } |
| 346 | 349 |
| 347 ContentSecurityPolicy* content_security_policy = | 350 ContentSecurityPolicy* content_security_policy = |
| 348 main_script_loader_->ReleaseContentSecurityPolicy(); | 351 main_script_loader_->ReleaseContentSecurityPolicy(); |
| 349 WorkerThreadStartMode start_mode = | 352 WorkerThreadStartMode start_mode = |
| 350 worker_inspector_proxy_->WorkerStartMode(document); | 353 worker_inspector_proxy_->WorkerStartMode(document); |
| 351 std::unique_ptr<WorkerSettings> worker_settings = | 354 std::unique_ptr<WorkerSettings> worker_settings = |
| 352 WTF::WrapUnique(new WorkerSettings(document->GetSettings())); | 355 WTF::WrapUnique(new WorkerSettings(document->GetSettings())); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 if (devtools_agent) | 428 if (devtools_agent) |
| 426 devtools_agent->DispatchOnInspectorBackend(session_id, call_id, method, | 429 devtools_agent->DispatchOnInspectorBackend(session_id, call_id, method, |
| 427 message); | 430 message); |
| 428 } | 431 } |
| 429 | 432 |
| 430 WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) { | 433 WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) { |
| 431 return new WebSharedWorkerImpl(client); | 434 return new WebSharedWorkerImpl(client); |
| 432 } | 435 } |
| 433 | 436 |
| 434 } // namespace blink | 437 } // namespace blink |
| OLD | NEW |