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