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

Unified Diff: content/browser/service_worker/service_worker_process_manager.cc

Issue 2881073003: Support DataSaver for SharedWorker (Closed)
Patch Set: fix #include "public/web/WebDataSaverFlag.h" 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: content/browser/service_worker/service_worker_process_manager.cc
diff --git a/content/browser/service_worker/service_worker_process_manager.cc b/content/browser/service_worker/service_worker_process_manager.cc
index 9056e76f03596ef69ab275846ef148da8d92c87c..2e2d210bbdb1257cae243c9b8a788d3a2994dd5e 100644
--- a/content/browser/service_worker/service_worker_process_manager.cc
+++ b/content/browser/service_worker/service_worker_process_manager.cc
@@ -17,6 +17,7 @@
#include "content/public/browser/site_instance.h"
#include "content/public/common/child_process_host.h"
#include "content/public/common/content_client.h"
+#include "third_party/WebKit/public/web/WebDataSaverFlag.h"
#include "url/gurl.h"
namespace content {
@@ -171,13 +172,15 @@ void ServiceWorkerProcessManager::AllocateWorkerProcess(
return;
}
- // This |EmbeddedWorkerSettings| only populates |data_saver_enabled|,
+ // This |EmbeddedWorkerSettings| only populates |data_saver_flag|,
// but in general, this function will populate settings from prefs, while
// the caller will be responsible for populating settings from other sources,
// such as command line switches.
EmbeddedWorkerSettings settings;
- settings.data_saver_enabled =
- GetContentClient()->browser()->IsDataSaverEnabled(browser_context_);
+ settings.data_saver_flag =
+ GetContentClient()->browser()->IsDataSaverEnabled(browser_context_)
+ ? blink::WebDataSaverFlag::kEnabled
+ : blink::WebDataSaverFlag::kDisabled;
if (process_id_for_test_ != ChildProcessHost::kInvalidUniqueID) {
// Let tests specify the returned process ID. Note: We may need to be able

Powered by Google App Engine
This is Rietveld 408576698