OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 ServiceWorkerGlobalScopeClientImpl::Create(*worker_context_client_)); | 420 ServiceWorkerGlobalScopeClientImpl::Create(*worker_context_client_)); |
421 ProvideServiceWorkerContainerClientToWorker( | 421 ProvideServiceWorkerContainerClientToWorker( |
422 worker_clients, | 422 worker_clients, |
423 WTF::WrapUnique(worker_context_client_->CreateServiceWorkerProvider())); | 423 WTF::WrapUnique(worker_context_client_->CreateServiceWorkerProvider())); |
424 | 424 |
425 if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) { | 425 if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) { |
426 std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context = | 426 std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context = |
427 | 427 |
428 worker_context_client_->CreateServiceWorkerFetchContext(); | 428 worker_context_client_->CreateServiceWorkerFetchContext(); |
429 DCHECK(web_worker_fetch_context); | 429 DCHECK(web_worker_fetch_context); |
430 // TODO(horo): Set more information about the context (ex: DataSaverEnabled) | 430 web_worker_fetch_context->SetDataSaverEnabled( |
431 // to |web_worker_fetch_context|. | 431 document->GetFrame()->GetSettings()->GetDataSaverEnabled()); |
432 ProvideWorkerFetchContextToWorker(worker_clients, | 432 ProvideWorkerFetchContextToWorker(worker_clients, |
433 std::move(web_worker_fetch_context)); | 433 std::move(web_worker_fetch_context)); |
434 } | 434 } |
435 | 435 |
436 // We need to set the CSP to both the shadow page's document and the | 436 // We need to set the CSP to both the shadow page's document and the |
437 // ServiceWorkerGlobalScope. | 437 // ServiceWorkerGlobalScope. |
438 document->InitContentSecurityPolicy( | 438 document->InitContentSecurityPolicy( |
439 main_script_loader_->ReleaseContentSecurityPolicy()); | 439 main_script_loader_->ReleaseContentSecurityPolicy()); |
440 if (!main_script_loader_->GetReferrerPolicy().IsNull()) { | 440 if (!main_script_loader_->GetReferrerPolicy().IsNull()) { |
441 document->ParseAndSetReferrerPolicy( | 441 document->ParseAndSetReferrerPolicy( |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // populate the task runners with null document not to confuse the frame | 476 // populate the task runners with null document not to confuse the frame |
477 // scheduler (which will end up using the thread's default task runner). | 477 // scheduler (which will end up using the thread's default task runner). |
478 worker_thread_->Start(std::move(startup_data), | 478 worker_thread_->Start(std::move(startup_data), |
479 ParentFrameTaskRunners::Create(nullptr)); | 479 ParentFrameTaskRunners::Create(nullptr)); |
480 | 480 |
481 worker_inspector_proxy_->WorkerThreadCreated(document, worker_thread_.get(), | 481 worker_inspector_proxy_->WorkerThreadCreated(document, worker_thread_.get(), |
482 script_url); | 482 script_url); |
483 } | 483 } |
484 | 484 |
485 } // namespace blink | 485 } // namespace blink |
OLD | NEW |