| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 PendingRequestInfo(webkit_glue::ResourceLoaderBridge::Peer* peer, | 77 PendingRequestInfo(webkit_glue::ResourceLoaderBridge::Peer* peer, |
| 78 ResourceType::Type resource_type, | 78 ResourceType::Type resource_type, |
| 79 const GURL& request_url); | 79 const GURL& request_url); |
| 80 | 80 |
| 81 ~PendingRequestInfo(); | 81 ~PendingRequestInfo(); |
| 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 bool is_ignored; |
| 87 GURL url; | 88 GURL url; |
| 88 linked_ptr<IPC::Message> pending_redirect_message; | 89 linked_ptr<IPC::Message> pending_redirect_message; |
| 89 base::TimeTicks request_start; | 90 base::TimeTicks request_start; |
| 90 base::TimeTicks response_start; | 91 base::TimeTicks response_start; |
| 91 base::TimeTicks completion_time; | 92 base::TimeTicks completion_time; |
| 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. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 117 int request_id, | 118 int request_id, |
| 118 base::SharedMemoryHandle data, | 119 base::SharedMemoryHandle data, |
| 119 int data_len, | 120 int data_len, |
| 120 int encoded_data_length); | 121 int encoded_data_length); |
| 121 void OnDownloadedData( | 122 void OnDownloadedData( |
| 122 const IPC::Message& message, | 123 const IPC::Message& message, |
| 123 int request_id, | 124 int request_id, |
| 124 int data_len); | 125 int data_len); |
| 125 void OnRequestComplete( | 126 void OnRequestComplete( |
| 126 int request_id, | 127 int request_id, |
| 127 const net::URLRequestStatus& status, | 128 int error_code, |
| 129 bool was_ignored, |
| 128 const std::string& security_info, | 130 const std::string& security_info, |
| 129 const base::TimeTicks& completion_time); | 131 const base::TimeTicks& completion_time); |
| 130 | 132 |
| 131 // Dispatch the message to one of the message response handlers. | 133 // Dispatch the message to one of the message response handlers. |
| 132 void DispatchMessage(const IPC::Message& message); | 134 void DispatchMessage(const IPC::Message& message); |
| 133 | 135 |
| 134 // Dispatch any deferred messages for the given request, provided it is not | 136 // Dispatch any deferred messages for the given request, provided it is not |
| 135 // again in the deferred state. | 137 // again in the deferred state. |
| 136 void FlushDeferredMessages(int request_id); | 138 void FlushDeferredMessages(int request_id); |
| 137 | 139 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 166 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; | 168 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; |
| 167 | 169 |
| 168 ResourceDispatcherDelegate* delegate_; | 170 ResourceDispatcherDelegate* delegate_; |
| 169 | 171 |
| 170 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 172 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
| 171 }; | 173 }; |
| 172 | 174 |
| 173 } // namespace content | 175 } // namespace content |
| 174 | 176 |
| 175 #endif // CONTENT_COMMON_RESOURCE_DISPATCHER_H_ | 177 #endif // CONTENT_COMMON_RESOURCE_DISPATCHER_H_ |
| OLD | NEW |