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

Side by Side 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, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_context_wrapper.h" 5 #include "content/browser/service_worker/service_worker_context_wrapper.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set>
9 #include <string>
10 #include <vector>
8 11
9 #include "base/barrier_closure.h" 12 #include "base/barrier_closure.h"
13 #include "base/bind.h"
10 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/lazy_instance.h"
11 #include "base/logging.h" 16 #include "base/logging.h"
12 #include "base/threading/sequenced_worker_pool.h" 17 #include "base/threading/sequenced_worker_pool.h"
13 #include "content/browser/fileapi/chrome_blob_storage_context.h" 18 #include "content/browser/fileapi/chrome_blob_storage_context.h"
14 #include "content/browser/service_worker/service_worker_context_core.h" 19 #include "content/browser/service_worker/service_worker_context_core.h"
15 #include "content/browser/service_worker/service_worker_context_observer.h" 20 #include "content/browser/service_worker/service_worker_context_observer.h"
16 #include "content/browser/service_worker/service_worker_process_manager.h" 21 #include "content/browser/service_worker/service_worker_process_manager.h"
17 #include "content/browser/service_worker/service_worker_quota_client.h" 22 #include "content/browser/service_worker/service_worker_quota_client.h"
18 #include "content/public/browser/browser_context.h" 23 #include "content/public/browser/browser_context.h"
19 #include "content/public/browser/browser_thread.h" 24 #include "content/public/browser/browser_thread.h"
25 #include "content/public/browser/service_worker_context.h"
20 #include "net/url_request/url_request_context_getter.h" 26 #include "net/url_request/url_request_context_getter.h"
21 #include "storage/browser/blob/blob_storage_context.h" 27 #include "storage/browser/blob/blob_storage_context.h"
22 #include "storage/browser/quota/quota_manager_proxy.h" 28 #include "storage/browser/quota/quota_manager_proxy.h"
23 #include "storage/browser/quota/special_storage_policy.h" 29 #include "storage/browser/quota/special_storage_policy.h"
24 30
25 namespace content { 31 namespace content {
26 32
33 namespace {
34
35 typedef std::set<std::string> HeaderNameSet;
36 base::LazyInstance<HeaderNameSet> g_excluded_header_name_set =
37 LAZY_INSTANCE_INITIALIZER;
38 }
39
40 void ServiceWorkerContext::AddExcludedHeadersForFetchEvent(
41 const std::set<std::string>& header_names) {
42 DCHECK_CURRENTLY_ON(BrowserThread::IO);
43 g_excluded_header_name_set.Get().insert(header_names.begin(),
44 header_names.end());
45 }
46
47 bool ServiceWorkerContext::IsExcludedHeaderNameForFetchEvent(
48 const std::string& header_name) {
49 DCHECK_CURRENTLY_ON(BrowserThread::IO);
50 return g_excluded_header_name_set.Get().find(header_name) !=
51 g_excluded_header_name_set.Get().end();
52 }
53
27 ServiceWorkerContextWrapper::ServiceWorkerContextWrapper( 54 ServiceWorkerContextWrapper::ServiceWorkerContextWrapper(
28 BrowserContext* browser_context) 55 BrowserContext* browser_context)
29 : observer_list_( 56 : observer_list_(
30 new ObserverListThreadSafe<ServiceWorkerContextObserver>()), 57 new ObserverListThreadSafe<ServiceWorkerContextObserver>()),
31 process_manager_(new ServiceWorkerProcessManager(browser_context)), 58 process_manager_(new ServiceWorkerProcessManager(browser_context)),
32 is_incognito_(false) { 59 is_incognito_(false) {
33 } 60 }
34 61
35 ServiceWorkerContextWrapper::~ServiceWorkerContextWrapper() { 62 ServiceWorkerContextWrapper::~ServiceWorkerContextWrapper() {
36 } 63 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 DCHECK_CURRENTLY_ON(BrowserThread::IO); 327 DCHECK_CURRENTLY_ON(BrowserThread::IO);
301 if (status != SERVICE_WORKER_OK) { 328 if (status != SERVICE_WORKER_OK) {
302 context_core_.reset(); 329 context_core_.reset();
303 return; 330 return;
304 } 331 }
305 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this)); 332 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this));
306 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully."; 333 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully.";
307 } 334 }
308 335
309 } // namespace content 336 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698