Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |