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 "content/browser/loader/resource_scheduler.h" | 5 #include "content/browser/loader/resource_scheduler.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "content/common/resource_messages.h" | 8 #include "content/common/resource_messages.h" |
9 #include "content/browser/loader/resource_message_delegate.h" | 9 #include "content/browser/loader/resource_message_delegate.h" |
10 #include "content/public/browser/resource_controller.h" | 10 #include "content/public/browser/resource_controller.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 return handled; | 61 return handled; |
62 } | 62 } |
63 | 63 |
64 // ResourceThrottle interface: | 64 // ResourceThrottle interface: |
65 virtual void WillStartRequest(bool* defer) OVERRIDE { | 65 virtual void WillStartRequest(bool* defer) OVERRIDE { |
66 deferred_ = *defer = !ready_; | 66 deferred_ = *defer = !ready_; |
67 } | 67 } |
68 | 68 |
69 void DidChangePriority(int request_id, net::RequestPriority new_priority) { | 69 void DidChangePriority(int request_id, net::RequestPriority new_priority) { |
70 net::RequestPriority old_priority = request_->priority(); | 70 net::RequestPriority old_priority = request_->priority(); |
71 request_->set_priority(new_priority); | 71 request_->SetPriority(new_priority); |
72 if (new_priority > old_priority) { | 72 if (new_priority > old_priority) { |
73 Start(); | 73 Start(); |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 ClientId client_id_; | 77 ClientId client_id_; |
78 net::URLRequest* request_; | 78 net::URLRequest* request_; |
79 bool ready_; | 79 bool ready_; |
80 bool deferred_; | 80 bool deferred_; |
81 ResourceScheduler* scheduler_; | 81 ResourceScheduler* scheduler_; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 scheduler_(scheduler) { | 233 scheduler_(scheduler) { |
234 } | 234 } |
235 | 235 |
236 ResourceScheduler::Client::~Client() { | 236 ResourceScheduler::Client::~Client() { |
237 scheduler_->RemoveClient(this); | 237 scheduler_->RemoveClient(this); |
238 DCHECK(in_flight_requests.empty()); | 238 DCHECK(in_flight_requests.empty()); |
239 DCHECK(pending_requests.empty()); | 239 DCHECK(pending_requests.empty()); |
240 } | 240 } |
241 | 241 |
242 } // namespace content | 242 } // namespace content |
OLD | NEW |