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

Side by Side Diff: content/browser/service_worker/service_worker_response_info.cc

Issue 2867693004: Snapshot of all changes to get jumbo in blink and content.
Patch Set: Exclude certain files from jumbo because of a Windows problem Created 3 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_response_info.h" 5 #include "content/browser/service_worker/service_worker_response_info.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "content/public/common/resource_response_info.h" 8 #include "content/public/common/resource_response_info.h"
9 #include "net/url_request/url_request.h" 9 #include "net/url_request/url_request.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 namespace { 13 namespace {
14 14
15 int kUserDataKey; // Only address is used, value is not important. 15 int kSW3UserDataKey; // Only address is used, value is not important.
16 16
17 } // namespace 17 } // namespace
18 18
19 // static 19 // static
20 ServiceWorkerResponseInfo* ServiceWorkerResponseInfo::ForRequest( 20 ServiceWorkerResponseInfo* ServiceWorkerResponseInfo::ForRequest(
21 net::URLRequest* request, 21 net::URLRequest* request,
22 bool create) { 22 bool create) {
23 ServiceWorkerResponseInfo* info = static_cast<ServiceWorkerResponseInfo*>( 23 ServiceWorkerResponseInfo* info = static_cast<ServiceWorkerResponseInfo*>(
24 request->GetUserData(&kUserDataKey)); 24 request->GetUserData(&kSW3UserDataKey));
25 if (!info && create) { 25 if (!info && create) {
26 info = new ServiceWorkerResponseInfo(); 26 info = new ServiceWorkerResponseInfo();
27 request->SetUserData(&kUserDataKey, base::WrapUnique(info)); 27 request->SetUserData(&kSW3UserDataKey, base::WrapUnique(info));
28 } 28 }
29 return info; 29 return info;
30 } 30 }
31 31
32 // static 32 // static
33 void ServiceWorkerResponseInfo::ResetDataForRequest(net::URLRequest* request) { 33 void ServiceWorkerResponseInfo::ResetDataForRequest(net::URLRequest* request) {
34 ServiceWorkerResponseInfo* info = ForRequest(request); 34 ServiceWorkerResponseInfo* info = ForRequest(request);
35 if (info) 35 if (info)
36 info->ResetData(); 36 info->ResetData();
37 } 37 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 response_cache_storage_cache_name_ = std::string(); 119 response_cache_storage_cache_name_ = std::string();
120 cors_exposed_header_names_.clear(); 120 cors_exposed_header_names_.clear();
121 // Don't reset the |did_navigation_preload_| flag. This is used for the 121 // Don't reset the |did_navigation_preload_| flag. This is used for the
122 // UseCounter, and if it was ever true for a request, it should remain true 122 // UseCounter, and if it was ever true for a request, it should remain true
123 // even if the job restarts. 123 // even if the job restarts.
124 } 124 }
125 125
126 ServiceWorkerResponseInfo::ServiceWorkerResponseInfo() {} 126 ServiceWorkerResponseInfo::ServiceWorkerResponseInfo() {}
127 127
128 } // namespace content 128 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698