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

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

Issue 2886663002: DataSaver support for off-main-thread-fetch (Closed)
Patch Set: rebase on TOT 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) 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698