| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "base/memory/linked_ptr.h" | 14 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/shared_memory.h" | 17 #include "base/memory/shared_memory.h" |
| 17 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 18 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 19 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 20 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
| 21 #include "content/public/common/resource_type.h" | 22 #include "content/public/common/resource_type.h" |
| 22 #include "ipc/ipc_listener.h" | 23 #include "ipc/ipc_listener.h" |
| 23 #include "ipc/ipc_sender.h" | 24 #include "ipc/ipc_sender.h" |
| 24 #include "net/base/request_priority.h" | 25 #include "net/base/request_priority.h" |
| 25 #include "url/gurl.h" | 26 #include "url/gurl.h" |
| 26 | 27 |
| 27 struct ResourceHostMsg_Request; | 28 struct ResourceHostMsg_Request; |
| 28 struct ResourceMsg_RequestCompleteData; | 29 struct ResourceMsg_RequestCompleteData; |
| 29 | 30 |
| 30 namespace blink { | 31 namespace blink { |
| 31 class WebThreadedDataReceiver; | 32 class WebThreadedDataReceiver; |
| 32 } | 33 } |
| 33 | 34 |
| 34 namespace net { | 35 namespace net { |
| 35 struct RedirectInfo; | 36 struct RedirectInfo; |
| 36 } | 37 } |
| 37 | 38 |
| 38 namespace content { | 39 namespace content { |
| 40 class RefCountedSharedMemory; |
| 39 class RequestPeer; | 41 class RequestPeer; |
| 40 class ResourceDispatcherDelegate; | 42 class ResourceDispatcherDelegate; |
| 41 class ResourceRequestBody; | 43 class ResourceRequestBody; |
| 42 class ThreadedDataProvider; | 44 class ThreadedDataProvider; |
| 43 struct ResourceResponseInfo; | 45 struct ResourceResponseInfo; |
| 44 struct RequestInfo; | 46 struct RequestInfo; |
| 45 struct ResourceResponseHead; | 47 struct ResourceResponseHead; |
| 46 struct SiteIsolationResponseMetaData; | 48 struct SiteIsolationResponseMetaData; |
| 47 struct SyncLoadResponse; | 49 struct SyncLoadResponse; |
| 48 | 50 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 GURL url; | 159 GURL url; |
| 158 // The security origin of the frame that initiates this request. | 160 // The security origin of the frame that initiates this request. |
| 159 GURL frame_origin; | 161 GURL frame_origin; |
| 160 // The url of the latest response even in case of redirection. | 162 // The url of the latest response even in case of redirection. |
| 161 GURL response_url; | 163 GURL response_url; |
| 162 bool download_to_file; | 164 bool download_to_file; |
| 163 linked_ptr<IPC::Message> pending_redirect_message; | 165 linked_ptr<IPC::Message> pending_redirect_message; |
| 164 base::TimeTicks request_start; | 166 base::TimeTicks request_start; |
| 165 base::TimeTicks response_start; | 167 base::TimeTicks response_start; |
| 166 base::TimeTicks completion_time; | 168 base::TimeTicks completion_time; |
| 167 linked_ptr<base::SharedMemory> buffer; | 169 scoped_refptr<RefCountedSharedMemory> buffer; |
| 168 linked_ptr<SiteIsolationResponseMetaData> site_isolation_metadata; | 170 linked_ptr<SiteIsolationResponseMetaData> site_isolation_metadata; |
| 169 bool blocked_response; | 171 bool blocked_response; |
| 170 int buffer_size; | 172 int buffer_size; |
| 171 }; | 173 }; |
| 172 typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; | 174 typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; |
| 173 | 175 |
| 174 // Helper to lookup the info based on the request_id. | 176 // Helper to lookup the info based on the request_id. |
| 175 // May return NULL if the request as been canceled from the client side. | 177 // May return NULL if the request as been canceled from the client side. |
| 176 PendingRequestInfo* GetPendingRequestInfo(int request_id); | 178 PendingRequestInfo* GetPendingRequestInfo(int request_id); |
| 177 | 179 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 252 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 251 | 253 |
| 252 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; | 254 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; |
| 253 | 255 |
| 254 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 256 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
| 255 }; | 257 }; |
| 256 | 258 |
| 257 } // namespace content | 259 } // namespace content |
| 258 | 260 |
| 259 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 261 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
| OLD | NEW |