OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/renderer_host/resource_queue.h" | 5 #include "chrome/browser/renderer_host/resource_queue.h" |
6 | 6 |
7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
8 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
9 #include "chrome/browser/renderer_host/global_request_id.h" | 9 #include "chrome/browser/renderer_host/global_request_id.h" |
10 #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" | 10 #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 void ResourceQueue::AddRequest( | 39 void ResourceQueue::AddRequest( |
40 URLRequest* request, | 40 URLRequest* request, |
41 const ResourceDispatcherHostRequestInfo& request_info) { | 41 const ResourceDispatcherHostRequestInfo& request_info) { |
42 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 42 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
43 DCHECK(!shutdown_); | 43 DCHECK(!shutdown_); |
44 | 44 |
45 GlobalRequestID request_id(request_info.child_id(), | 45 GlobalRequestID request_id(request_info.child_id(), |
46 request_info.request_id()); | 46 request_info.request_id()); |
47 | 47 |
48 DCHECK(!ContainsKey(requests_, request_id)); | 48 DCHECK(!ContainsKey(requests_, request_id)) |
| 49 << "child_id:" << request_info.child_id() |
| 50 << ", request_id:" << request_info.request_id(); |
49 requests_[request_id] = request; | 51 requests_[request_id] = request; |
50 | 52 |
51 DelegateSet interested_delegates; | 53 DelegateSet interested_delegates; |
52 | 54 |
53 for (DelegateSet::iterator i = delegates_.begin(); | 55 for (DelegateSet::iterator i = delegates_.begin(); |
54 i != delegates_.end(); ++i) { | 56 i != delegates_.end(); ++i) { |
55 if ((*i)->ShouldDelayRequest(request, request_info, request_id)) | 57 if ((*i)->ShouldDelayRequest(request, request_info, request_id)) |
56 interested_delegates.insert(*i); | 58 interested_delegates.insert(*i); |
57 } | 59 } |
58 | 60 |
(...skipping 23 matching lines...) Expand all Loading... |
82 interested_delegates_.erase(request_id); | 84 interested_delegates_.erase(request_id); |
83 | 85 |
84 if (ContainsKey(requests_, request_id)) { | 86 if (ContainsKey(requests_, request_id)) { |
85 URLRequest* request = requests_[request_id]; | 87 URLRequest* request = requests_[request_id]; |
86 // The request shouldn't have started (SUCCESS is the initial state). | 88 // The request shouldn't have started (SUCCESS is the initial state). |
87 DCHECK_EQ(URLRequestStatus::SUCCESS, request->status().status()); | 89 DCHECK_EQ(URLRequestStatus::SUCCESS, request->status().status()); |
88 request->Start(); | 90 request->Start(); |
89 } | 91 } |
90 } | 92 } |
91 } | 93 } |
OLD | NEW |