| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 bool accounted_as_delayable_request() const { | 161 bool accounted_as_delayable_request() const { |
| 162 return accounted_as_delayable_request_; | 162 return accounted_as_delayable_request_; |
| 163 } | 163 } |
| 164 void set_accounted_as_delayable_request(bool accounted) { | 164 void set_accounted_as_delayable_request(bool accounted) { |
| 165 accounted_as_delayable_request_ = accounted; | 165 accounted_as_delayable_request_ = accounted; |
| 166 } | 166 } |
| 167 | 167 |
| 168 private: | 168 private: |
| 169 // ResourceMessageDelegate interface: | 169 // ResourceMessageDelegate interface: |
| 170 virtual bool OnMessageReceived(const IPC::Message& message, | 170 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { |
| 171 bool* message_was_ok) OVERRIDE { | |
| 172 bool handled = true; | 171 bool handled = true; |
| 173 IPC_BEGIN_MESSAGE_MAP_EX(ScheduledResourceRequest, message, *message_was_ok) | 172 IPC_BEGIN_MESSAGE_MAP(ScheduledResourceRequest, message) |
| 174 IPC_MESSAGE_HANDLER(ResourceHostMsg_DidChangePriority, DidChangePriority) | 173 IPC_MESSAGE_HANDLER(ResourceHostMsg_DidChangePriority, DidChangePriority) |
| 175 IPC_MESSAGE_UNHANDLED(handled = false) | 174 IPC_MESSAGE_UNHANDLED(handled = false) |
| 176 IPC_END_MESSAGE_MAP_EX() | 175 IPC_END_MESSAGE_MAP() |
| 177 return handled; | 176 return handled; |
| 178 } | 177 } |
| 179 | 178 |
| 180 // ResourceThrottle interface: | 179 // ResourceThrottle interface: |
| 181 virtual void WillStartRequest(bool* defer) OVERRIDE { | 180 virtual void WillStartRequest(bool* defer) OVERRIDE { |
| 182 deferred_ = *defer = !ready_; | 181 deferred_ = *defer = !ready_; |
| 183 } | 182 } |
| 184 | 183 |
| 185 virtual const char* GetNameForLogging() const OVERRIDE { | 184 virtual const char* GetNameForLogging() const OVERRIDE { |
| 186 return "ResourceScheduler"; | 185 return "ResourceScheduler"; |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 client->ReprioritizeRequest( | 648 client->ReprioritizeRequest( |
| 650 request, old_priority_params, new_priority_params); | 649 request, old_priority_params, new_priority_params); |
| 651 } | 650 } |
| 652 | 651 |
| 653 ResourceScheduler::ClientId ResourceScheduler::MakeClientId( | 652 ResourceScheduler::ClientId ResourceScheduler::MakeClientId( |
| 654 int child_id, int route_id) { | 653 int child_id, int route_id) { |
| 655 return (static_cast<ResourceScheduler::ClientId>(child_id) << 32) | route_id; | 654 return (static_cast<ResourceScheduler::ClientId>(child_id) << 32) | route_id; |
| 656 } | 655 } |
| 657 | 656 |
| 658 } // namespace content | 657 } // namespace content |
| OLD | NEW |