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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const GURL& frame_origin, | 49 const GURL& frame_origin, |
50 const GURL& request_url); | 50 const GURL& request_url); |
51 | 51 |
52 // 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 |
53 // request was found and removed. | 53 // request was found and removed. |
54 bool RemovePendingRequest(int request_id); | 54 bool RemovePendingRequest(int request_id); |
55 | 55 |
56 // Cancels a request in the pending_requests_ list. | 56 // Cancels a request in the pending_requests_ list. |
57 void CancelPendingRequest(int request_id); | 57 void CancelPendingRequest(int request_id); |
58 | 58 |
| 59 // Stop sending ACKs back for received data packets. |
| 60 void StopSendingDataACKs(int request_id); |
| 61 |
| 62 // ACK a data packet. |
| 63 void SendDataACK(int request_id); |
| 64 |
59 IPC::Sender* message_sender() const { | 65 IPC::Sender* message_sender() const { |
60 return message_sender_; | 66 return message_sender_; |
61 } | 67 } |
62 | 68 |
63 // Toggles the is_deferred attribute for the specified request. | 69 // Toggles the is_deferred attribute for the specified request. |
64 void SetDefersLoading(int request_id, bool value); | 70 void SetDefersLoading(int request_id, bool value); |
65 | 71 |
66 // Indicates the priority of the specified request changed. | 72 // Indicates the priority of the specified request changed. |
67 void DidChangePriority(int routing_id, int request_id, | 73 void DidChangePriority(int routing_id, int request_id, |
68 net::RequestPriority new_priority); | 74 net::RequestPriority new_priority); |
69 | 75 |
| 76 // Construct a WebThreadedResourceProvider for passing back to Blink. |
| 77 blink::WebThreadedResourceProvider* CreateThreadedResourceProvider( |
| 78 int request_id); |
| 79 |
70 // This does not take ownership of the delegate. It is expected that the | 80 // This does not take ownership of the delegate. It is expected that the |
71 // delegate have a longer lifetime than the ResourceDispatcher. | 81 // delegate have a longer lifetime than the ResourceDispatcher. |
72 void set_delegate(ResourceDispatcherDelegate* delegate) { | 82 void set_delegate(ResourceDispatcherDelegate* delegate) { |
73 delegate_ = delegate; | 83 delegate_ = delegate; |
74 } | 84 } |
75 | 85 |
76 // Remembers IO thread timestamp for next resource message. | 86 // Remembers IO thread timestamp for next resource message. |
77 void set_io_timestamp(base::TimeTicks io_timestamp) { | 87 void set_io_timestamp(base::TimeTicks io_timestamp) { |
78 io_timestamp_ = io_timestamp; | 88 io_timestamp_ = io_timestamp; |
79 } | 89 } |
(...skipping 26 matching lines...) Expand all Loading... |
106 // The security origin of the frame that initiates this request. | 116 // The security origin of the frame that initiates this request. |
107 GURL frame_origin; | 117 GURL frame_origin; |
108 // The url of the latest response even in case of redirection. | 118 // The url of the latest response even in case of redirection. |
109 GURL response_url; | 119 GURL response_url; |
110 linked_ptr<IPC::Message> pending_redirect_message; | 120 linked_ptr<IPC::Message> pending_redirect_message; |
111 base::TimeTicks request_start; | 121 base::TimeTicks request_start; |
112 base::TimeTicks response_start; | 122 base::TimeTicks response_start; |
113 base::TimeTicks completion_time; | 123 base::TimeTicks completion_time; |
114 linked_ptr<base::SharedMemory> buffer; | 124 linked_ptr<base::SharedMemory> buffer; |
115 int buffer_size; | 125 int buffer_size; |
| 126 bool send_data_acks; |
116 }; | 127 }; |
117 typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; | 128 typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; |
118 | 129 |
119 // Helper to lookup the info based on the request_id. | 130 // Helper to lookup the info based on the request_id. |
120 // May return NULL if the request as been canceled from the client side. | 131 // May return NULL if the request as been canceled from the client side. |
121 PendingRequestInfo* GetPendingRequestInfo(int request_id); | 132 PendingRequestInfo* GetPendingRequestInfo(int request_id); |
122 | 133 |
123 // Follows redirect, if any, for the given request. | 134 // Follows redirect, if any, for the given request. |
124 void FollowPendingRedirect(int request_id, PendingRequestInfo& request_info); | 135 void FollowPendingRedirect(int request_id, PendingRequestInfo& request_info); |
125 | 136 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 212 |
202 // IO thread timestamp for ongoing IPC message. | 213 // IO thread timestamp for ongoing IPC message. |
203 base::TimeTicks io_timestamp_; | 214 base::TimeTicks io_timestamp_; |
204 | 215 |
205 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); | 216 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher); |
206 }; | 217 }; |
207 | 218 |
208 } // namespace content | 219 } // namespace content |
209 | 220 |
210 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ | 221 #endif // CONTENT_CHILD_RESOURCE_DISPATCHER_H_ |
OLD | NEW |