Chromium Code Reviews| 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading |
| 6 | 6 |
| 7 #ifndef CONTENT_COMMON_RESOURCE_DISPATCHER_H_ | 7 #ifndef CONTENT_COMMON_RESOURCE_DISPATCHER_H_ |
| 8 #define CONTENT_COMMON_RESOURCE_DISPATCHER_H_ | 8 #define CONTENT_COMMON_RESOURCE_DISPATCHER_H_ |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 // Indicates the priority of the specified request changed. | 64 // Indicates the priority of the specified request changed. |
| 65 void DidChangePriority(int routing_id, int request_id, | 65 void DidChangePriority(int routing_id, int request_id, |
| 66 net::RequestPriority new_priority); | 66 net::RequestPriority new_priority); |
| 67 | 67 |
| 68 // This does not take ownership of the delegate. It is expected that the | 68 // This does not take ownership of the delegate. It is expected that the |
| 69 // delegate have a longer lifetime than the ResourceDispatcher. | 69 // delegate have a longer lifetime than the ResourceDispatcher. |
| 70 void set_delegate(ResourceDispatcherDelegate* delegate) { | 70 void set_delegate(ResourceDispatcherDelegate* delegate) { |
| 71 delegate_ = delegate; | 71 delegate_ = delegate; |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Remembers IO thread timestamp for next resource message. | |
| 75 void set_io_timestamp(base::TimeTicks io_timestamp) { | |
| 76 io_timestamp_ = io_timestamp; | |
| 77 } | |
| 78 | |
| 74 private: | 79 private: |
| 75 friend class ResourceDispatcherTest; | 80 friend class ResourceDispatcherTest; |
| 76 | 81 |
| 77 typedef std::deque<IPC::Message*> MessageQueue; | 82 typedef std::deque<IPC::Message*> MessageQueue; |
| 78 struct PendingRequestInfo { | 83 struct PendingRequestInfo { |
| 79 PendingRequestInfo(); | 84 PendingRequestInfo(); |
| 80 | 85 |
| 81 PendingRequestInfo(webkit_glue::ResourceLoaderBridge::Peer* peer, | 86 PendingRequestInfo(webkit_glue::ResourceLoaderBridge::Peer* peer, |
| 82 ResourceType::Type resource_type, | 87 ResourceType::Type resource_type, |
| 83 const GURL& request_url); | 88 const GURL& request_url); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 | 178 |
| 174 IPC::Sender* message_sender_; | 179 IPC::Sender* message_sender_; |
| 175 | 180 |
| 176 // All pending requests issued to the host | 181 // All pending requests issued to the host |
| 177 PendingRequestList pending_requests_; | 182 PendingRequestList pending_requests_; |
| 178 | 183 |
| 179 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; | 184 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; |
| 180 | 185 |
| 181 ResourceDispatcherDelegate* delegate_; | 186 ResourceDispatcherDelegate* delegate_; |
| 182 | 187 |
| 188 base::TimeTicks io_timestamp_; | |
|
Charlie Reis
2013/05/23 20:13:11
Please add a comment here.
eustas
2013/05/24 15:22:28
Done.
| |
| 189 | |
| 183 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 190 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
| 184 }; | 191 }; |
| 185 | 192 |
| 186 } // namespace content | 193 } // namespace content |
| 187 | 194 |
| 188 #endif // CONTENT_COMMON_RESOURCE_DISPATCHER_H_ | 195 #endif // CONTENT_COMMON_RESOURCE_DISPATCHER_H_ |
| OLD | NEW |