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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 url(request_url), | 87 url(request_url), |
88 request_start(base::TimeTicks::Now()) { | 88 request_start(base::TimeTicks::Now()) { |
89 } | 89 } |
90 | 90 |
91 ~PendingRequestInfo() {} | 91 ~PendingRequestInfo() {} |
92 | 92 |
93 webkit_glue::ResourceLoaderBridge::Peer* peer; | 93 webkit_glue::ResourceLoaderBridge::Peer* peer; |
94 ResourceType::Type resource_type; | 94 ResourceType::Type resource_type; |
95 MessageQueue deferred_message_queue; | 95 MessageQueue deferred_message_queue; |
96 bool is_deferred; | 96 bool is_deferred; |
| 97 bool is_handled_externally; |
97 GURL url; | 98 GURL url; |
98 linked_ptr<IPC::Message> pending_redirect_message; | 99 linked_ptr<IPC::Message> pending_redirect_message; |
99 base::TimeTicks request_start; | 100 base::TimeTicks request_start; |
100 base::TimeTicks response_start; | 101 base::TimeTicks response_start; |
101 base::TimeTicks completion_time; | 102 base::TimeTicks completion_time; |
102 }; | 103 }; |
103 typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; | 104 typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; |
104 | 105 |
105 // Helper to lookup the info based on the request_id. | 106 // Helper to lookup the info based on the request_id. |
106 // May return NULL if the request as been canceled from the client side. | 107 // May return NULL if the request as been canceled from the client side. |
(...skipping 20 matching lines...) Expand all Loading... |
127 int request_id, | 128 int request_id, |
128 base::SharedMemoryHandle data, | 129 base::SharedMemoryHandle data, |
129 int data_len, | 130 int data_len, |
130 int encoded_data_length); | 131 int encoded_data_length); |
131 void OnDownloadedData( | 132 void OnDownloadedData( |
132 const IPC::Message& message, | 133 const IPC::Message& message, |
133 int request_id, | 134 int request_id, |
134 int data_len); | 135 int data_len); |
135 void OnRequestComplete( | 136 void OnRequestComplete( |
136 int request_id, | 137 int request_id, |
137 const net::URLRequestStatus& status, | 138 int error_code, |
| 139 bool handled_externally, |
138 const std::string& security_info, | 140 const std::string& security_info, |
139 const base::TimeTicks& completion_time); | 141 const base::TimeTicks& completion_time); |
140 | 142 |
141 // Dispatch the message to one of the message response handlers. | 143 // Dispatch the message to one of the message response handlers. |
142 void DispatchMessage(const IPC::Message& message); | 144 void DispatchMessage(const IPC::Message& message); |
143 | 145 |
144 // Dispatch any deferred messages for the given request, provided it is not | 146 // Dispatch any deferred messages for the given request, provided it is not |
145 // again in the deferred state. | 147 // again in the deferred state. |
146 void FlushDeferredMessages(int request_id); | 148 void FlushDeferredMessages(int request_id); |
147 | 149 |
(...skipping 28 matching lines...) Expand all Loading... |
176 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; | 178 base::WeakPtrFactory<ResourceDispatcher> weak_factory_; |
177 | 179 |
178 ResourceDispatcherDelegate* delegate_; | 180 ResourceDispatcherDelegate* delegate_; |
179 | 181 |
180 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 182 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
181 }; | 183 }; |
182 | 184 |
183 } // namespace content | 185 } // namespace content |
184 | 186 |
185 #endif // CONTENT_COMMON_RESOURCE_DISPATCHER_H_ | 187 #endif // CONTENT_COMMON_RESOURCE_DISPATCHER_H_ |
OLD | NEW |