| 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "content/browser/loader/resource_scheduler.h" | 7 #include "content/browser/loader/resource_scheduler.h" |
| 8 | 8 |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "content/common/resource_messages.h" | 10 #include "content/common/resource_messages.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 161 } |
| 162 RequestClassification classification() const { | 162 RequestClassification classification() const { |
| 163 return classification_; | 163 return classification_; |
| 164 } | 164 } |
| 165 void set_classification(RequestClassification classification) { | 165 void set_classification(RequestClassification classification) { |
| 166 classification_ = classification; | 166 classification_ = classification; |
| 167 } | 167 } |
| 168 | 168 |
| 169 private: | 169 private: |
| 170 // ResourceMessageDelegate interface: | 170 // ResourceMessageDelegate interface: |
| 171 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { | 171 virtual bool OnMessageReceived(const IPC::Message& message) override { |
| 172 bool handled = true; | 172 bool handled = true; |
| 173 IPC_BEGIN_MESSAGE_MAP(ScheduledResourceRequest, message) | 173 IPC_BEGIN_MESSAGE_MAP(ScheduledResourceRequest, message) |
| 174 IPC_MESSAGE_HANDLER(ResourceHostMsg_DidChangePriority, DidChangePriority) | 174 IPC_MESSAGE_HANDLER(ResourceHostMsg_DidChangePriority, DidChangePriority) |
| 175 IPC_MESSAGE_UNHANDLED(handled = false) | 175 IPC_MESSAGE_UNHANDLED(handled = false) |
| 176 IPC_END_MESSAGE_MAP() | 176 IPC_END_MESSAGE_MAP() |
| 177 return handled; | 177 return handled; |
| 178 } | 178 } |
| 179 | 179 |
| 180 // ResourceThrottle interface: | 180 // ResourceThrottle interface: |
| 181 virtual void WillStartRequest(bool* defer) OVERRIDE { | 181 virtual void WillStartRequest(bool* defer) override { |
| 182 deferred_ = *defer = !ready_; | 182 deferred_ = *defer = !ready_; |
| 183 } | 183 } |
| 184 | 184 |
| 185 virtual const char* GetNameForLogging() const OVERRIDE { | 185 virtual const char* GetNameForLogging() const override { |
| 186 return "ResourceScheduler"; | 186 return "ResourceScheduler"; |
| 187 } | 187 } |
| 188 | 188 |
| 189 void DidChangePriority(int request_id, net::RequestPriority new_priority, | 189 void DidChangePriority(int request_id, net::RequestPriority new_priority, |
| 190 int intra_priority_value) { | 190 int intra_priority_value) { |
| 191 scheduler_->ReprioritizeRequest(this, new_priority, intra_priority_value); | 191 scheduler_->ReprioritizeRequest(this, new_priority, intra_priority_value); |
| 192 } | 192 } |
| 193 | 193 |
| 194 ClientId client_id_; | 194 ClientId client_id_; |
| 195 net::URLRequest* request_; | 195 net::URLRequest* request_; |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1021 client->ReprioritizeRequest( | 1021 client->ReprioritizeRequest( |
| 1022 request, old_priority_params, new_priority_params); | 1022 request, old_priority_params, new_priority_params); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 ResourceScheduler::ClientId ResourceScheduler::MakeClientId( | 1025 ResourceScheduler::ClientId ResourceScheduler::MakeClientId( |
| 1026 int child_id, int route_id) { | 1026 int child_id, int route_id) { |
| 1027 return (static_cast<ResourceScheduler::ClientId>(child_id) << 32) | route_id; | 1027 return (static_cast<ResourceScheduler::ClientId>(child_id) << 32) | route_id; |
| 1028 } | 1028 } |
| 1029 | 1029 |
| 1030 } // namespace content | 1030 } // namespace content |
| OLD | NEW |