summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorlazyboy <lazyboy@chromium.org>2016-03-16 13:09:49 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-16 20:11:40 +0000
commit16b16fba24fa3cac9e5c852cb707a5317c34ddad (patch)
tree25e3648bc382b0f681c66579fdb08ca9e9099542 /extensions
parent91adec57fa0a1765e1ec1053e6460f5ea96450ba (diff)
downloadchromium_src-16b16fba24fa3cac9e5c852cb707a5317c34ddad.zip
chromium_src-16b16fba24fa3cac9e5c852cb707a5317c34ddad.tar.gz
chromium_src-16b16fba24fa3cac9e5c852cb707a5317c34ddad.tar.bz2
Skip logging spurious errors for ServiceWorker URLRequests that were spawned
through ServiceWorkerWriteToCacheJob. This CL does not fix the underlying issue, it is just suppressing a not so useful error log. BUG=568788 Test=Load an extension page with ServiceWorker, observe no "Allowing load of ..." error messages anymore. Review URL: https://codereview.chromium.org/1790993002 Cr-Commit-Position: refs/heads/master@{#381517}
Diffstat (limited to 'extensions')
-rw-r--r--extensions/browser/extension_protocols.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/extensions/browser/extension_protocols.cc b/extensions/browser/extension_protocols.cc
index 1fcabe1..2dbbf31 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;
}