| 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 <stdint.h> | 10 #include <stdint.h> |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 139 } |
| 140 | 140 |
| 141 void SetMainThreadTaskRunner( | 141 void SetMainThreadTaskRunner( |
| 142 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { | 142 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { |
| 143 main_thread_task_runner_ = main_thread_task_runner; | 143 main_thread_task_runner_ = main_thread_task_runner; |
| 144 } | 144 } |
| 145 | 145 |
| 146 void SetResourceSchedulingFilter( | 146 void SetResourceSchedulingFilter( |
| 147 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter); | 147 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter); |
| 148 | 148 |
| 149 base::WeakPtr<ResourceDispatcher> GetWeakPtr() { |
| 150 return weak_factory_.GetWeakPtr(); |
| 151 } |
| 152 |
| 149 private: | 153 private: |
| 150 friend class URLResponseBodyConsumer; | 154 friend class URLResponseBodyConsumer; |
| 151 friend class ResourceDispatcherTest; | 155 friend class ResourceDispatcherTest; |
| 152 | 156 |
| 153 typedef std::deque<IPC::Message*> MessageQueue; | 157 typedef std::deque<IPC::Message*> MessageQueue; |
| 154 struct PendingRequestInfo { | 158 struct PendingRequestInfo { |
| 155 PendingRequestInfo(std::unique_ptr<RequestPeer> peer, | 159 PendingRequestInfo(std::unique_ptr<RequestPeer> peer, |
| 156 ResourceType resource_type, | 160 ResourceType resource_type, |
| 157 int origin_pid, | 161 int origin_pid, |
| 158 const GURL& frame_origin, | 162 const GURL& frame_origin, |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_; | 280 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_; |
| 277 | 281 |
| 278 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; | 282 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; |
| 279 | 283 |
| 280 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 284 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
| 281 }; | 285 }; |
| 282 | 286 |
| 283 } // namespace content | 287 } // namespace content |
| 284 | 288 |
| 285 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 289 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
| OLD | NEW |