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_CHILD_RESOURCE_DISPATCHER_H_ | 7 #ifndef CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
8 #define CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 8 #define CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 21 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 namespace net { | 34 namespace net { |
35 struct RedirectInfo; | 35 struct RedirectInfo; |
36 } | 36 } |
37 | 37 |
38 namespace content { | 38 namespace content { |
39 class RequestPeer; | 39 class RequestPeer; |
40 class ResourceDispatcherDelegate; | 40 class ResourceDispatcherDelegate; |
41 class ResourceRequestBody; | 41 class ResourceRequestBody; |
| 42 class ResourceSchedulingFilter; |
42 class ThreadedDataProvider; | 43 class ThreadedDataProvider; |
43 struct ResourceResponseInfo; | 44 struct ResourceResponseInfo; |
44 struct RequestInfo; | 45 struct RequestInfo; |
45 struct ResourceResponseHead; | 46 struct ResourceResponseHead; |
46 class SharedMemoryReceivedDataFactory; | 47 class SharedMemoryReceivedDataFactory; |
47 struct SiteIsolationResponseMetaData; | 48 struct SiteIsolationResponseMetaData; |
48 struct SyncLoadResponse; | 49 struct SyncLoadResponse; |
49 | 50 |
50 // This class serves as a communication interface to the ResourceDispatcherHost | 51 // This class serves as a communication interface to the ResourceDispatcherHost |
51 // in the browser process. It can be used from any child process. | 52 // in the browser process. It can be used from any child process. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // Remembers IO thread timestamp for next resource message. | 123 // Remembers IO thread timestamp for next resource message. |
123 void set_io_timestamp(base::TimeTicks io_timestamp) { | 124 void set_io_timestamp(base::TimeTicks io_timestamp) { |
124 io_timestamp_ = io_timestamp; | 125 io_timestamp_ = io_timestamp; |
125 } | 126 } |
126 | 127 |
127 void SetMainThreadTaskRunner( | 128 void SetMainThreadTaskRunner( |
128 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { | 129 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { |
129 main_thread_task_runner_ = main_thread_task_runner; | 130 main_thread_task_runner_ = main_thread_task_runner; |
130 } | 131 } |
131 | 132 |
| 133 void SetResourceSchedulingFilter( |
| 134 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter); |
| 135 |
132 private: | 136 private: |
133 friend class ResourceDispatcherTest; | 137 friend class ResourceDispatcherTest; |
134 | 138 |
135 typedef std::deque<IPC::Message*> MessageQueue; | 139 typedef std::deque<IPC::Message*> MessageQueue; |
136 struct PendingRequestInfo { | 140 struct PendingRequestInfo { |
137 PendingRequestInfo(); | 141 PendingRequestInfo(); |
138 | 142 |
139 PendingRequestInfo(RequestPeer* peer, | 143 PendingRequestInfo(RequestPeer* peer, |
140 ResourceType resource_type, | 144 ResourceType resource_type, |
141 int origin_pid, | 145 int origin_pid, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 246 |
243 // All pending requests issued to the host | 247 // All pending requests issued to the host |
244 PendingRequestList pending_requests_; | 248 PendingRequestList pending_requests_; |
245 | 249 |
246 ResourceDispatcherDelegate* delegate_; | 250 ResourceDispatcherDelegate* delegate_; |
247 | 251 |
248 // IO thread timestamp for ongoing IPC message. | 252 // IO thread timestamp for ongoing IPC message. |
249 base::TimeTicks io_timestamp_; | 253 base::TimeTicks io_timestamp_; |
250 | 254 |
251 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 255 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 256 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_; |
252 | 257 |
253 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; | 258 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; |
254 | 259 |
255 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 260 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
256 }; | 261 }; |
257 | 262 |
258 } // namespace content | 263 } // namespace content |
259 | 264 |
260 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 265 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
OLD | NEW |