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

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

Issue 2105503002: Skip foreign fetch when the skipServiceWorker flag is set on a request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rephrase SkipServiceWorker comments. Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/foreign_fetch_request_handler.h" 5 #include "content/browser/service_worker/foreign_fetch_request_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "content/browser/service_worker/service_worker_context_wrapper.h" 10 #include "content/browser/service_worker/service_worker_context_wrapper.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 }; 44 };
45 45
46 } // namespace 46 } // namespace
47 47
48 void ForeignFetchRequestHandler::InitializeHandler( 48 void ForeignFetchRequestHandler::InitializeHandler(
49 net::URLRequest* request, 49 net::URLRequest* request,
50 ServiceWorkerContextWrapper* context_wrapper, 50 ServiceWorkerContextWrapper* context_wrapper,
51 storage::BlobStorageContext* blob_storage_context, 51 storage::BlobStorageContext* blob_storage_context,
52 int process_id, 52 int process_id,
53 int provider_id, 53 int provider_id,
54 bool skip_service_worker, 54 SkipServiceWorker skip_service_worker,
55 FetchRequestMode request_mode, 55 FetchRequestMode request_mode,
56 FetchCredentialsMode credentials_mode, 56 FetchCredentialsMode credentials_mode,
57 FetchRedirectMode redirect_mode, 57 FetchRedirectMode redirect_mode,
58 ResourceType resource_type, 58 ResourceType resource_type,
59 RequestContextType request_context_type, 59 RequestContextType request_context_type,
60 RequestContextFrameType frame_type, 60 RequestContextFrameType frame_type,
61 scoped_refptr<ResourceRequestBodyImpl> body, 61 scoped_refptr<ResourceRequestBodyImpl> body,
62 bool initiated_in_secure_context) { 62 bool initiated_in_secure_context) {
63 if (!context_wrapper) { 63 if (!context_wrapper)
64 return; 64 return;
65 } 65
66 if (skip_service_worker == SkipServiceWorker::ALL)
67 return;
66 68
67 if (!initiated_in_secure_context) 69 if (!initiated_in_secure_context)
68 return; 70 return;
69 71
70 if (!context_wrapper->OriginHasForeignFetchRegistrations( 72 if (!context_wrapper->OriginHasForeignFetchRegistrations(
71 request->url().GetOrigin())) { 73 request->url().GetOrigin())) {
72 return; 74 return;
73 } 75 }
74 76
75 if (request->initiator().IsSameOriginWith(url::Origin(request->url()))) 77 if (request->initiator().IsSameOriginWith(url::Origin(request->url())))
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 228 }
227 return target_worker_.get(); 229 return target_worker_.get();
228 } 230 }
229 231
230 void ForeignFetchRequestHandler::ClearJob() { 232 void ForeignFetchRequestHandler::ClearJob() {
231 job_.reset(); 233 job_.reset();
232 target_worker_ = nullptr; 234 target_worker_ = nullptr;
233 } 235 }
234 236
235 } // namespace content 237 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/foreign_fetch_request_handler.h ('k') | content/child/request_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698