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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "extensions/browser/api/web_request/web_request_api.h" 5 #include "extensions/browser/api/web_request/web_request_api.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 void* browser_context, 1219 void* browser_context,
1220 const net::URLRequest* request) { 1220 const net::URLRequest* request) {
1221 ClearPendingCallbacks(request); 1221 ClearPendingCallbacks(request);
1222 1222
1223 signaled_requests_.erase(request->identifier()); 1223 signaled_requests_.erase(request->identifier());
1224 1224
1225 request_time_tracker_->LogRequestEndTime(request->identifier(), 1225 request_time_tracker_->LogRequestEndTime(request->identifier(),
1226 base::Time::Now()); 1226 base::Time::Now());
1227 } 1227 }
1228 1228
1229 void ExtensionWebRequestEventRouter::OnURLRequestJobOrphaned(
1230 void* browser_context,
1231 const net::URLRequest* request) {
1232 // See https://crbug.com/289715. While a URLRequest is blocking on an
1233 // extension, it may not orphan jobs unless OnURLRequestDestroyed is called
1234 // first.
1235 //
1236 // TODO(davidben): Remove this when the crash has been diagnosed.
1237 CHECK_EQ(0u, blocked_requests_.count(request->identifier()));
mmenke 2015/09/14 15:18:27 Maybe toss the URL on the stack? One of the possi
davidben 2015/09/14 19:55:55 Done.
1238 }
1239
1229 void ExtensionWebRequestEventRouter::ClearPendingCallbacks( 1240 void ExtensionWebRequestEventRouter::ClearPendingCallbacks(
1230 const net::URLRequest* request) { 1241 const net::URLRequest* request) {
1231 blocked_requests_.erase(request->identifier()); 1242 blocked_requests_.erase(request->identifier());
1232 } 1243 }
1233 1244
1234 bool ExtensionWebRequestEventRouter::DispatchEvent( 1245 bool ExtensionWebRequestEventRouter::DispatchEvent(
1235 void* browser_context, 1246 void* browser_context,
1236 net::URLRequest* request, 1247 net::URLRequest* request,
1237 const std::vector<const EventListener*>& listeners, 1248 const std::vector<const EventListener*>& listeners,
1238 const base::ListValue& args) { 1249 const base::ListValue& args) {
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 // Continue gracefully. 2493 // Continue gracefully.
2483 RunSync(); 2494 RunSync();
2484 } 2495 }
2485 2496
2486 bool WebRequestHandlerBehaviorChangedFunction::RunSync() { 2497 bool WebRequestHandlerBehaviorChangedFunction::RunSync() {
2487 helpers::ClearCacheOnNavigation(); 2498 helpers::ClearCacheOnNavigation();
2488 return true; 2499 return true;
2489 } 2500 }
2490 2501
2491 } // namespace extensions 2502 } // namespace extensions
OLDNEW
« 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