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 // This is the browser side of the resource dispatcher, it receives requests | 5 // This is the browser side of the resource dispatcher, it receives requests |
6 // from the RenderProcessHosts, and dispatches them to URLRequests. It then | 6 // from the RenderProcessHosts, and dispatches them to URLRequests. It then |
7 // fowards the messages from the URLRequests back to the correct process for | 7 // fowards the messages from the URLRequests back to the correct process for |
8 // handling. | 8 // handling. |
9 // | 9 // |
10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // If the handler returns false, then the request is cancelled. Otherwise, | 90 // If the handler returns false, then the request is cancelled. Otherwise, |
91 // once data is available, OnReadCompleted will be called. | 91 // once data is available, OnReadCompleted will be called. |
92 virtual bool OnWillRead(int request_id, | 92 virtual bool OnWillRead(int request_id, |
93 scoped_refptr<net::IOBuffer>* buf, | 93 scoped_refptr<net::IOBuffer>* buf, |
94 int* buf_size, | 94 int* buf_size, |
95 int min_size) = 0; | 95 int min_size) = 0; |
96 | 96 |
97 // Data (*bytes_read bytes) was written into the buffer provided by | 97 // Data (*bytes_read bytes) was written into the buffer provided by |
98 // OnWillRead. A return value of false cancels the request, true continues | 98 // OnWillRead. A return value of false cancels the request, true continues |
99 // reading data. Set |*defer| to true to defer reading more response data. | 99 // reading data. Set |*defer| to true to defer reading more response data. |
100 // Call controller()->Resume() to continue reading response data. | 100 // Call controller()->Resume() to continue reading response data. A zero |
| 101 // |bytes_read| signals that no further data is available. |
101 virtual bool OnReadCompleted(int request_id, int bytes_read, | 102 virtual bool OnReadCompleted(int request_id, int bytes_read, |
102 bool* defer) = 0; | 103 bool* defer) = 0; |
103 | 104 |
104 // The response is complete. The final response status is given. Set | 105 // The response is complete. The final response status is given. Set |
105 // |*defer| to true to defer destruction to a later time. Otherwise, the | 106 // |*defer| to true to defer destruction to a later time. Otherwise, the |
106 // request will be destroyed upon return. | 107 // request will be destroyed upon return. |
107 virtual void OnResponseCompleted(int request_id, | 108 virtual void OnResponseCompleted(int request_id, |
108 const net::URLRequestStatus& status, | 109 const net::URLRequestStatus& status, |
109 const std::string& security_info, | 110 const std::string& security_info, |
110 bool* defer) = 0; | 111 bool* defer) = 0; |
(...skipping 16 matching lines...) Expand all Loading... |
127 ResourceMessageFilter* GetFilter() const; | 128 ResourceMessageFilter* GetFilter() const; |
128 | 129 |
129 private: | 130 private: |
130 ResourceController* controller_; | 131 ResourceController* controller_; |
131 net::URLRequest* request_; | 132 net::URLRequest* request_; |
132 }; | 133 }; |
133 | 134 |
134 } // namespace content | 135 } // namespace content |
135 | 136 |
136 #endif // CONTENT_BROWSER_LOADER_RESOURCE_HANDLER_H_ | 137 #endif // CONTENT_BROWSER_LOADER_RESOURCE_HANDLER_H_ |
OLD | NEW |