| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 return handled; | 58 return handled; |
| 59 } | 59 } |
| 60 | 60 |
| 61 // ResourceThrottle interface: | 61 // ResourceThrottle interface: |
| 62 virtual void WillStartRequest(bool* defer) OVERRIDE { | 62 virtual void WillStartRequest(bool* defer) OVERRIDE { |
| 63 deferred_ = *defer = !ready_; | 63 deferred_ = *defer = !ready_; |
| 64 } | 64 } |
| 65 | 65 |
| 66 void DidChangePriority(int request_id, net::RequestPriority new_priority) { | 66 void DidChangePriority(int request_id, net::RequestPriority new_priority) { |
| 67 net::RequestPriority old_priority = request_->priority(); | 67 net::RequestPriority old_priority = request_->priority(); |
| 68 request_->set_priority(new_priority); | 68 request_->SetPriority(new_priority); |
| 69 if (new_priority > old_priority) { | 69 if (new_priority > old_priority) { |
| 70 Start(); | 70 Start(); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 ClientId client_id_; | 74 ClientId client_id_; |
| 75 net::URLRequest* request_; | 75 net::URLRequest* request_; |
| 76 bool ready_; | 76 bool ready_; |
| 77 bool deferred_; | 77 bool deferred_; |
| 78 ResourceScheduler* scheduler_; | 78 ResourceScheduler* scheduler_; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 } | 248 } |
| 249 | 249 |
| 250 ResourceScheduler::Client::Client() | 250 ResourceScheduler::Client::Client() |
| 251 : has_body(false) { | 251 : has_body(false) { |
| 252 } | 252 } |
| 253 | 253 |
| 254 ResourceScheduler::Client::~Client() { | 254 ResourceScheduler::Client::~Client() { |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace content | 257 } // namespace content |
| OLD | NEW |