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

Unified Diff: content/browser/service_worker/service_worker_context_wrapper.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: content/browser/service_worker/service_worker_context_wrapper.cc
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index 9170b2456e6692056d1644fafe3278a33568e28c..298dc491c626a2606208bec37c4432c725de2d60 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -5,9 +5,14 @@
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include <map>
+#include <set>
+#include <string>
+#include <vector>
#include "base/barrier_closure.h"
+#include "base/bind.h"
#include "base/files/file_path.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/threading/sequenced_worker_pool.h"
#include "content/browser/fileapi/chrome_blob_storage_context.h"
@@ -17,6 +22,7 @@
#include "content/browser/service_worker/service_worker_quota_client.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/service_worker_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "storage/browser/blob/blob_storage_context.h"
#include "storage/browser/quota/quota_manager_proxy.h"
@@ -24,6 +30,27 @@
namespace content {
+namespace {
+
+typedef std::set<std::string> HeaderNameSet;
+base::LazyInstance<HeaderNameSet> g_excluded_header_name_set =
+ LAZY_INSTANCE_INITIALIZER;
+}
+
+void ServiceWorkerContext::AddExcludedHeadersForFetchEvent(
+ const std::set<std::string>& header_names) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ g_excluded_header_name_set.Get().insert(header_names.begin(),
+ header_names.end());
+}
+
+bool ServiceWorkerContext::IsExcludedHeaderNameForFetchEvent(
+ const std::string& header_name) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ return g_excluded_header_name_set.Get().find(header_name) !=
+ g_excluded_header_name_set.Get().end();
+}
+
ServiceWorkerContextWrapper::ServiceWorkerContextWrapper(
BrowserContext* browser_context)
: observer_list_(

Powered by Google App Engine
This is Rietveld 408576698