| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 webkit_glue::ResourceLoaderBridge::Peer* peer; | 83 webkit_glue::ResourceLoaderBridge::Peer* peer; |
| 84 ResourceType::Type resource_type; | 84 ResourceType::Type resource_type; |
| 85 MessageQueue deferred_message_queue; | 85 MessageQueue deferred_message_queue; |
| 86 bool is_deferred; | 86 bool is_deferred; |
| 87 GURL url; | 87 GURL url; |
| 88 linked_ptr<IPC::Message> pending_redirect_message; | 88 linked_ptr<IPC::Message> pending_redirect_message; |
| 89 base::TimeTicks request_start; | 89 base::TimeTicks request_start; |
| 90 base::TimeTicks response_start; | 90 base::TimeTicks response_start; |
| 91 base::TimeTicks completion_time; | 91 base::TimeTicks completion_time; |
| 92 linked_ptr<base::SharedMemory> buffer; |
| 92 }; | 93 }; |
| 93 typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; | 94 typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; |
| 94 | 95 |
| 95 // Helper to lookup the info based on the request_id. | 96 // Helper to lookup the info based on the request_id. |
| 96 // May return NULL if the request as been canceled from the client side. | 97 // May return NULL if the request as been canceled from the client side. |
| 97 PendingRequestInfo* GetPendingRequestInfo(int request_id); | 98 PendingRequestInfo* GetPendingRequestInfo(int request_id); |
| 98 | 99 |
| 99 // Follows redirect, if any, for the given request. | 100 // Follows redirect, if any, for the given request. |
| 100 void FollowPendingRedirect(int request_id, PendingRequestInfo& request_info); | 101 void FollowPendingRedirect(int request_id, PendingRequestInfo& request_info); |
| 101 | 102 |
| 102 // Message response handlers, called by the message handler for this process. | 103 // Message response handlers, called by the message handler for this process. |
| 103 void OnUploadProgress( | 104 void OnUploadProgress( |
| 104 const IPC::Message& message, | 105 const IPC::Message& message, |
| 105 int request_id, | 106 int request_id, |
| 106 int64 position, | 107 int64 position, |
| 107 int64 size); | 108 int64 size); |
| 108 void OnReceivedResponse(int request_id, const ResourceResponseHead&); | 109 void OnReceivedResponse(int request_id, const ResourceResponseHead&); |
| 109 void OnReceivedCachedMetadata(int request_id, const std::vector<char>& data); | 110 void OnReceivedCachedMetadata(int request_id, const std::vector<char>& data); |
| 110 void OnReceivedRedirect( | 111 void OnReceivedRedirect( |
| 111 const IPC::Message& message, | 112 const IPC::Message& message, |
| 112 int request_id, | 113 int request_id, |
| 113 const GURL& new_url, | 114 const GURL& new_url, |
| 114 const ResourceResponseHead& response_head); | 115 const ResourceResponseHead& response_head); |
| 116 void OnSetDataBuffer( |
| 117 const IPC::Message& message, |
| 118 int request_id, |
| 119 base::SharedMemoryHandle shm_handle, |
| 120 int shm_size); |
| 115 void OnReceivedData( | 121 void OnReceivedData( |
| 116 const IPC::Message& message, | 122 const IPC::Message& message, |
| 117 int request_id, | 123 int request_id, |
| 118 base::SharedMemoryHandle data, | 124 int data_offset, |
| 119 int data_len, | 125 int data_length, |
| 120 int encoded_data_length); | 126 int encoded_data_length); |
| 121 void OnDownloadedData( | 127 void OnDownloadedData( |
| 122 const IPC::Message& message, | 128 const IPC::Message& message, |
| 123 int request_id, | 129 int request_id, |
| 124 int data_len); | 130 int data_len); |
| 125 void OnRequestComplete( | 131 void OnRequestComplete( |
| 126 int request_id, | 132 int request_id, |
| 127 int error_code, | 133 int error_code, |
| 128 bool was_ignored_by_handler, | 134 bool was_ignored_by_handler, |
| 129 const std::string& security_info, | 135 const std::string& security_info, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; | 173 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; |
| 168 | 174 |
| 169 ResourceDispatcherDelegate* delegate_; | 175 ResourceDispatcherDelegate* delegate_; |
| 170 | 176 |
| 171 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 177 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
| 172 }; | 178 }; |
| 173 | 179 |
| 174 } // namespace content | 180 } // namespace content |
| 175 | 181 |
| 176 #endif // CONTENT_COMMON_RESOURCE_DISPATCHER_H_ | 182 #endif // CONTENT_COMMON_RESOURCE_DISPATCHER_H_ |
| OLD | NEW |