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

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

Issue 2881073003: Support DataSaver for SharedWorker (Closed)
Patch Set: same as PS6 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 32ec2662dc4e7040ec1b49518cbed60f71732cf5..0fb0fec8b297dafa1746bdb016ac69791488991d 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() {
« no previous file with comments | « third_party/WebKit/Source/web/WebSharedWorkerImpl.h ('k') | third_party/WebKit/public/web/WebSharedWorker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698