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

Unified Diff: content/renderer/service_worker/worker_fetch_context_impl.h

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/renderer/service_worker/worker_fetch_context_impl.h
diff --git a/content/renderer/service_worker/worker_fetch_context_impl.h b/content/renderer/service_worker/worker_fetch_context_impl.h
index 9e430b193ddad827099588198bae743af8e539e3..10ae2904d7feea2be2aa5c4ef380e4a8f6561c18 100644
--- a/content/renderer/service_worker/worker_fetch_context_impl.h
+++ b/content/renderer/service_worker/worker_fetch_context_impl.h
@@ -9,6 +9,7 @@
#include "content/common/worker_url_loader_factory_provider.mojom.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "third_party/WebKit/public/platform/WebWorkerFetchContext.h"
+#include "third_party/WebKit/public/web/WebDataSaverFlag.h"
namespace base {
class SingleThreadTaskRunner;
@@ -30,8 +31,8 @@ class WorkerFetchContextImpl : public blink::WebWorkerFetchContext,
std::unique_ptr<blink::WebURLLoader> CreateURLLoader() override;
void WillSendRequest(blink::WebURLRequest&) override;
bool IsControlledByServiceWorker() const override;
- void SetDataSaverEnabled(bool) override;
- bool IsDataSaverEnabled() const override;
+ void SetDataSaverFlag(blink::WebDataSaverFlag) override;
+ blink::WebDataSaverFlag DataSaverFlag() const override;
// mojom::ServiceWorkerWorkerClient implementation:
void SetControllerServiceWorker(int64_t controller_version_id) override;
@@ -56,7 +57,7 @@ class WorkerFetchContextImpl : public blink::WebWorkerFetchContext,
// is called from the browser process via mojo IPC.
int controller_version_id_ = kInvalidServiceWorkerVersionId;
- bool is_data_saver_enabled_ = false;
+ blink::WebDataSaverFlag data_saver_flag_ = blink::WebDataSaverFlag::kDisabled;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698