| 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> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Creates a ResourceLoaderBridge for this type of dispatcher, this is so | 38 // Creates a ResourceLoaderBridge for this type of dispatcher, this is so |
| 39 // this can be tested regardless of the ResourceLoaderBridge::Create | 39 // this can be tested regardless of the ResourceLoaderBridge::Create |
| 40 // implementation. | 40 // implementation. |
| 41 webkit_glue::ResourceLoaderBridge* CreateBridge( | 41 webkit_glue::ResourceLoaderBridge* CreateBridge( |
| 42 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info); | 42 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info); |
| 43 | 43 |
| 44 // Adds a request from the pending_requests_ list, returning the new | 44 // Adds a request from the pending_requests_ list, returning the new |
| 45 // requests' ID | 45 // requests' ID |
| 46 int AddPendingRequest(webkit_glue::ResourceLoaderBridge::Peer* callback, | 46 int AddPendingRequest(webkit_glue::ResourceLoaderBridge::Peer* callback, |
| 47 ResourceType::Type resource_type, | 47 ResourceType::Type resource_type, |
| 48 int origin_pid, |
| 48 const GURL& frame_origin, | 49 const GURL& frame_origin, |
| 49 const GURL& request_url); | 50 const GURL& request_url); |
| 50 | 51 |
| 51 // Removes a request from the pending_requests_ list, returning true if the | 52 // Removes a request from the pending_requests_ list, returning true if the |
| 52 // request was found and removed. | 53 // request was found and removed. |
| 53 bool RemovePendingRequest(int request_id); | 54 bool RemovePendingRequest(int request_id); |
| 54 | 55 |
| 55 // Cancels a request in the pending_requests_ list. | 56 // Cancels a request in the pending_requests_ list. |
| 56 void CancelPendingRequest(int routing_id, int request_id); | 57 void CancelPendingRequest(int routing_id, int request_id); |
| 57 | 58 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 79 | 80 |
| 80 private: | 81 private: |
| 81 friend class ResourceDispatcherTest; | 82 friend class ResourceDispatcherTest; |
| 82 | 83 |
| 83 typedef std::deque<IPC::Message*> MessageQueue; | 84 typedef std::deque<IPC::Message*> MessageQueue; |
| 84 struct PendingRequestInfo { | 85 struct PendingRequestInfo { |
| 85 PendingRequestInfo(); | 86 PendingRequestInfo(); |
| 86 | 87 |
| 87 PendingRequestInfo(webkit_glue::ResourceLoaderBridge::Peer* peer, | 88 PendingRequestInfo(webkit_glue::ResourceLoaderBridge::Peer* peer, |
| 88 ResourceType::Type resource_type, | 89 ResourceType::Type resource_type, |
| 90 int origin_pid, |
| 89 const GURL& frame_origin, | 91 const GURL& frame_origin, |
| 90 const GURL& request_url); | 92 const GURL& request_url); |
| 91 | 93 |
| 92 ~PendingRequestInfo(); | 94 ~PendingRequestInfo(); |
| 93 | 95 |
| 94 webkit_glue::ResourceLoaderBridge::Peer* peer; | 96 webkit_glue::ResourceLoaderBridge::Peer* peer; |
| 95 ResourceType::Type resource_type; | 97 ResourceType::Type resource_type; |
| 98 // The PID of the original process which issued this request. This gets |
| 99 // non-zero only for a request proxied by another renderer, particularly |
| 100 // requests from plugins. |
| 101 int origin_pid; |
| 96 MessageQueue deferred_message_queue; | 102 MessageQueue deferred_message_queue; |
| 97 bool is_deferred; | 103 bool is_deferred; |
| 98 // Original requested url. | 104 // Original requested url. |
| 99 GURL url; | 105 GURL url; |
| 100 // The security origin of the frame that initiates this request. | 106 // The security origin of the frame that initiates this request. |
| 101 GURL frame_origin; | 107 GURL frame_origin; |
| 102 // The url of the latest response even in case of redirection. | 108 // The url of the latest response even in case of redirection. |
| 103 GURL response_url; | 109 GURL response_url; |
| 104 linked_ptr<IPC::Message> pending_redirect_message; | 110 linked_ptr<IPC::Message> pending_redirect_message; |
| 105 base::TimeTicks request_start; | 111 base::TimeTicks request_start; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 205 |
| 200 // IO thread timestamp for ongoing IPC message. | 206 // IO thread timestamp for ongoing IPC message. |
| 201 base::TimeTicks io_timestamp_; | 207 base::TimeTicks io_timestamp_; |
| 202 | 208 |
| 203 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 209 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
| 204 }; | 210 }; |
| 205 | 211 |
| 206 } // namespace content | 212 } // namespace content |
| 207 | 213 |
| 208 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 214 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
| OLD | NEW |