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

Unified Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp

Issue 2881073003: Support DataSaver for SharedWorker (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
index 59de3ad48c6a2ee263a0c8fa7d9ebe39fab2c9c9..7b93d61b6b46d12833a770a3d5a6a32b4008a2d9 100644
--- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -123,7 +123,7 @@ void WebSharedWorkerImpl::TerminateWorkerThread() {
worker_inspector_proxy_->WorkerThreadTerminated();
}
-void WebSharedWorkerImpl::InitializeLoader() {
+void WebSharedWorkerImpl::InitializeLoader(bool data_saver_enabled) {
DCHECK(IsMainThread());
// Create 'shadow page'. This page is never displayed, it is used to proxy the
@@ -134,6 +134,7 @@ void WebSharedWorkerImpl::InitializeLoader() {
// FIXME: http://crbug.com/363843. This needs to find a better way to
// not create graphics layers.
web_view_->GetSettings()->SetAcceleratedCompositingEnabled(false);
+ web_view_->GetSettings()->SetDataSaverEnabled(data_saver_enabled);
// FIXME: Settings information should be passed to the Worker process from
// Browser process when the worker is created (similar to
// RenderThread::OnCreateNewView).
@@ -291,12 +292,13 @@ void WebSharedWorkerImpl::StartWorkerContext(
const WebString& name,
const WebString& content_security_policy,
WebContentSecurityPolicyType policy_type,
- WebAddressSpace creation_address_space) {
+ WebAddressSpace creation_address_space,
+ bool data_saver_enabled) {
DCHECK(IsMainThread());
url_ = url;
name_ = name;
creation_address_space_ = creation_address_space;
- InitializeLoader();
+ InitializeLoader(data_saver_enabled);
}
void WebSharedWorkerImpl::DidReceiveScriptLoaderResponse() {

Powered by Google App Engine
This is Rietveld 408576698