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

Unified Diff: extensions/browser/api/web_request/web_request_api.cc

Issue 1337113004: CHECK that URLRequestJobs are not orphaned while blocked by extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/api/web_request/web_request_api.h ('k') | net/base/layered_network_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/web_request/web_request_api.cc
diff --git a/extensions/browser/api/web_request/web_request_api.cc b/extensions/browser/api/web_request/web_request_api.cc
index 40b9db7ddf0c080438019823b180f00b6bd38c03..3d9b9beac30bbf54f1dd883df795bf84ee699ede 100644
--- a/extensions/browser/api/web_request/web_request_api.cc
+++ b/extensions/browser/api/web_request/web_request_api.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/debug/alias.h"
#include "base/json/json_writer.h"
#include "base/lazy_instance.h"
#include "base/macros.h"
@@ -1226,6 +1227,20 @@ void ExtensionWebRequestEventRouter::OnURLRequestDestroyed(
base::Time::Now());
}
+void ExtensionWebRequestEventRouter::OnURLRequestJobOrphaned(
+ void* browser_context,
+ const net::URLRequest* request) {
+ // See https://crbug.com/289715. While a URLRequest is blocking on an
+ // extension, it may not orphan jobs unless OnURLRequestDestroyed is called
+ // first.
+ //
+ // TODO(davidben): Remove this when the crash has been diagnosed.
+ char url_buf[128];
+ base::strlcpy(url_buf, request->url().spec().c_str(), arraysize(url_buf));
+ base::debug::Alias(url_buf);
+ CHECK_EQ(0u, blocked_requests_.count(request->identifier()));
+}
+
void ExtensionWebRequestEventRouter::ClearPendingCallbacks(
const net::URLRequest* request) {
blocked_requests_.erase(request->identifier());
« no previous file with comments | « extensions/browser/api/web_request/web_request_api.h ('k') | net/base/layered_network_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698