| 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/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 19 #include "content/public/common/resource_type.h" | 19 #include "content/public/common/resource_type.h" |
| 20 #include "ipc/ipc_listener.h" | 20 #include "ipc/ipc_listener.h" |
| 21 #include "ipc/ipc_sender.h" | 21 #include "ipc/ipc_sender.h" |
| 22 #include "net/base/request_priority.h" | 22 #include "net/base/request_priority.h" |
| 23 | 23 |
| 24 struct ResourceMsg_RequestCompleteData; | 24 struct ResourceMsg_RequestCompleteData; |
| 25 | 25 |
| 26 namespace blink { | 26 namespace blink { |
| 27 class WebThreadedDataReceiver; | 27 class WebThreadedDataReceiver; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace net { |
| 31 struct RedirectInfo; |
| 32 } |
| 33 |
| 30 namespace webkit_glue { | 34 namespace webkit_glue { |
| 31 class ResourceLoaderBridge; | 35 class ResourceLoaderBridge; |
| 32 } | 36 } |
| 33 | 37 |
| 34 namespace content { | 38 namespace content { |
| 35 class RequestPeer; | 39 class RequestPeer; |
| 36 class ResourceDispatcherDelegate; | 40 class ResourceDispatcherDelegate; |
| 37 class ThreadedDataProvider; | 41 class ThreadedDataProvider; |
| 38 struct ResourceResponseInfo; | 42 struct ResourceResponseInfo; |
| 39 struct RequestInfo; | 43 struct RequestInfo; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 PendingRequestInfo* GetPendingRequestInfo(int request_id); | 152 PendingRequestInfo* GetPendingRequestInfo(int request_id); |
| 149 | 153 |
| 150 // Follows redirect, if any, for the given request. | 154 // Follows redirect, if any, for the given request. |
| 151 void FollowPendingRedirect(int request_id, PendingRequestInfo& request_info); | 155 void FollowPendingRedirect(int request_id, PendingRequestInfo& request_info); |
| 152 | 156 |
| 153 // Message response handlers, called by the message handler for this process. | 157 // Message response handlers, called by the message handler for this process. |
| 154 void OnUploadProgress(int request_id, int64 position, int64 size); | 158 void OnUploadProgress(int request_id, int64 position, int64 size); |
| 155 void OnReceivedResponse(int request_id, const ResourceResponseHead&); | 159 void OnReceivedResponse(int request_id, const ResourceResponseHead&); |
| 156 void OnReceivedCachedMetadata(int request_id, const std::vector<char>& data); | 160 void OnReceivedCachedMetadata(int request_id, const std::vector<char>& data); |
| 157 void OnReceivedRedirect(int request_id, | 161 void OnReceivedRedirect(int request_id, |
| 158 const GURL& new_url, | 162 const net::RedirectInfo& redirect_info, |
| 159 const GURL& new_first_party_for_cookies, | |
| 160 const ResourceResponseHead& response_head); | 163 const ResourceResponseHead& response_head); |
| 161 void OnSetDataBuffer(int request_id, | 164 void OnSetDataBuffer(int request_id, |
| 162 base::SharedMemoryHandle shm_handle, | 165 base::SharedMemoryHandle shm_handle, |
| 163 int shm_size, | 166 int shm_size, |
| 164 base::ProcessId renderer_pid); | 167 base::ProcessId renderer_pid); |
| 165 void OnReceivedData(int request_id, | 168 void OnReceivedData(int request_id, |
| 166 int data_offset, | 169 int data_offset, |
| 167 int data_length, | 170 int data_length, |
| 168 int encoded_data_length); | 171 int encoded_data_length); |
| 169 void OnDownloadedData(int request_id, int data_len, int encoded_data_length); | 172 void OnDownloadedData(int request_id, int data_len, int encoded_data_length); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 219 |
| 217 // IO thread timestamp for ongoing IPC message. | 220 // IO thread timestamp for ongoing IPC message. |
| 218 base::TimeTicks io_timestamp_; | 221 base::TimeTicks io_timestamp_; |
| 219 | 222 |
| 220 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 223 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
| 221 }; | 224 }; |
| 222 | 225 |
| 223 } // namespace content | 226 } // namespace content |
| 224 | 227 |
| 225 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 228 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
| OLD | NEW |