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

Unified Diff: content/browser/service_worker/foreign_fetch_request_handler.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/foreign_fetch_request_handler.cc
diff --git a/content/browser/service_worker/foreign_fetch_request_handler.cc b/content/browser/service_worker/foreign_fetch_request_handler.cc
index 8d3dfb476f351f212b147b5406b11c1d17728da5..eee1cfc7f2aa9de8883feac27696726f3f43a51a 100644
--- a/content/browser/service_worker/foreign_fetch_request_handler.cc
+++ b/content/browser/service_worker/foreign_fetch_request_handler.cc
@@ -93,8 +93,10 @@ void ForeignFetchRequestHandler::InitializeHandler(
if (ServiceWorkerUtils::IsMainResourceType(resource_type))
return;
- if (request->initiator().IsSameOriginWith(url::Origin(request->url())))
+ if (request->initiator().has_value() &&
+ request->initiator()->IsSameOriginWith(url::Origin(request->url()))) {
return;
+ }
if (!context_wrapper->OriginHasForeignFetchRegistrations(
request->url().GetOrigin())) {
@@ -219,7 +221,7 @@ void ForeignFetchRequestHandler::DidFindRegistration(
}
}
- const url::Origin& request_origin = job->request()->initiator();
+ const url::Origin& request_origin = job->request()->initiator().value();
bool origin_matches = active_version->foreign_fetch_origins().empty();
for (const url::Origin& origin : active_version->foreign_fetch_origins()) {
if (request_origin.IsSameOriginWith(origin))
« no previous file with comments | « content/browser/security_exploit_browsertest.cc ('k') | content/browser/service_worker/service_worker_fetch_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698