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

Unified Diff: components/variations/net/variations_http_header_provider.cc

Issue 666973003: [ServiceWorker] Don't send the UMA related headers to the ServiceWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use set Created 6 years, 2 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: components/variations/net/variations_http_header_provider.cc
diff --git a/components/variations/net/variations_http_header_provider.cc b/components/variations/net/variations_http_header_provider.cc
index 1220fae1640fc55545dfd978226b677ab3ebb0f3..6e327ed05c47fb95057ba0f71c83d95b0365faee 100644
--- a/components/variations/net/variations_http_header_provider.cc
+++ b/components/variations/net/variations_http_header_provider.cc
@@ -4,6 +4,8 @@
#include "components/variations/net/variations_http_header_provider.h"
+#include <set>
+#include <string>
#include <vector>
#include "base/base64.h"
@@ -36,6 +38,9 @@ const char* kSuffixesToSetHeadersFor[] = {
".ytimg.com",
};
+const char kChromeUMAEnabled[] = "X-Chrome-UMA-Enabled";
+const char kClientData[] = "X-Client-Data";
+
} // namespace
VariationsHttpHeaderProvider* VariationsHttpHeaderProvider::GetInstance() {
@@ -61,7 +66,7 @@ void VariationsHttpHeaderProvider::AppendHeaders(
return;
if (uma_enabled)
- headers->SetHeaderIfMissing("X-Chrome-UMA-Enabled", "1");
+ headers->SetHeaderIfMissing(kChromeUMAEnabled, "1");
// Lazily initialize the header, if not already done, before attempting to
// transmit it.
@@ -75,8 +80,7 @@ void VariationsHttpHeaderProvider::AppendHeaders(
if (!variation_ids_header_copy.empty()) {
// Note that prior to M33 this header was named X-Chrome-Variations.
- headers->SetHeaderIfMissing("X-Client-Data",
- variation_ids_header_copy);
+ headers->SetHeaderIfMissing(kClientData, variation_ids_header_copy);
}
}
@@ -258,4 +262,12 @@ bool VariationsHttpHeaderProvider::ShouldAppendHeaders(const GURL& url) {
google_util::ALLOW_NON_STANDARD_PORTS);
}
+std::set<std::string> VariationsHttpHeaderProvider::GetVariationHeaderNames()
+ const {
+ std::set<std::string> headers;
+ headers.insert(kChromeUMAEnabled);
+ headers.insert(kClientData);
+ return headers;
+}
+
} // namespace variations

Powered by Google App Engine
This is Rietveld 408576698