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

Unified Diff: content/browser/renderer_host/resource_queue.cc

Issue 8296017: Revert 105659 - Delay network requests on startup if any webRequest or webNavigation extensions a... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 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
Index: content/browser/renderer_host/resource_queue.cc
===================================================================
--- content/browser/renderer_host/resource_queue.cc (revision 105660)
+++ content/browser/renderer_host/resource_queue.cc (working copy)
@@ -75,23 +75,19 @@
requests_.erase(request_id);
}
-void ResourceQueue::StartDelayedRequests(ResourceQueueDelegate* delegate) {
+void ResourceQueue::StartDelayedRequest(ResourceQueueDelegate* delegate,
+ const GlobalRequestID& request_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(!shutdown_);
- for (RequestMap::iterator i = requests_.begin(); i != requests_.end(); ++i) {
- GlobalRequestID request_id = i->first;
- // Ignore requests that this delegate never asked to delay.
- if (!ContainsKey(interested_delegates_, request_id) ||
- !ContainsKey(interested_delegates_[request_id], delegate)) {
- continue;
- }
- interested_delegates_[request_id].erase(delegate);
+ DCHECK(ContainsKey(interested_delegates_, request_id));
+ DCHECK(ContainsKey(interested_delegates_[request_id], delegate));
+ interested_delegates_[request_id].erase(delegate);
+ if (interested_delegates_[request_id].empty()) {
+ interested_delegates_.erase(request_id);
- // If no more delegates want a delay, start the request.
- if (interested_delegates_[request_id].empty()) {
- interested_delegates_.erase(request_id);
- net::URLRequest* request = i->second;
+ if (ContainsKey(requests_, request_id)) {
+ net::URLRequest* request = requests_[request_id];
// The request shouldn't have started (SUCCESS is the initial state).
DCHECK_EQ(net::URLRequestStatus::SUCCESS, request->status().status());
request->Start();
« no previous file with comments | « content/browser/renderer_host/resource_queue.h ('k') | content/browser/renderer_host/resource_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698