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

Unified Diff: extensions/browser/extension_protocols.cc

Issue 1790993002: Skip logging spurious errors for ServiceWorker URLRequests that were spawned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments from asargent@ Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_protocols.cc
diff --git a/extensions/browser/extension_protocols.cc b/extensions/browser/extension_protocols.cc
index 1fcabe19bb2119b679e9e0689c3ff3721f44a9a2..2dbbf31b9dd63aa193fa98dc693a70a52d225b8c 100644
--- a/extensions/browser/extension_protocols.cc
+++ b/extensions/browser/extension_protocols.cc
@@ -329,9 +329,17 @@ bool AllowExtensionResourceLoad(net::URLRequest* request,
// We have seen crashes where info is NULL: crbug.com/52374.
if (!info) {
- LOG(ERROR) << "Allowing load of " << request->url().spec()
- << "from unknown origin. Could not find user data for "
- << "request.";
+ // SeviceWorker net requests created through ServiceWorkerWriteToCacheJob
+ // do not have ResourceRequestInfo associated with them. So skip logging
+ // spurious errors below.
+ // TODO(falken): Either consider attaching ResourceRequestInfo to these or
+ // finish refactoring ServiceWorkerWriteToCacheJob so that it doesn't spawn
+ // a new URLRequest.
+ if (!ResourceRequestInfo::OriginatedFromServiceWorker(request)) {
+ LOG(ERROR) << "Allowing load of " << request->url().spec()
+ << "from unknown origin. Could not find user data for "
+ << "request.";
+ }
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698