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

Unified Diff: third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp

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: third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
index d4830069f643e0b183069986e0f4e13af1dbf27d..488f58234a0655c6b6eb1acb0ba07eb98f14e468 100644
--- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
@@ -17,6 +17,7 @@
#include "public/platform/WebThread.h"
#include "public/platform/WebURLRequest.h"
#include "public/platform/WebWorkerFetchContext.h"
+#include "public/web/WebDataSaverFlag.h"
namespace blink {
@@ -181,7 +182,7 @@ void WorkerFetchContext::AddAdditionalRequestHeaders(ResourceRequest& request,
if (!request.Url().IsEmpty() && !request.Url().ProtocolIsInHTTPFamily())
return;
- if (web_context_->IsDataSaverEnabled())
+ if (web_context_->DataSaverFlag() == WebDataSaverFlag::kEnabled)
request.SetHTTPHeaderField("Save-Data", "on");
}

Powered by Google App Engine
This is Rietveld 408576698