| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // Response headers and meta data are available. | 43 // Response headers and meta data are available. |
| 44 virtual bool OnResponseStarted(int request_id, | 44 virtual bool OnResponseStarted(int request_id, |
| 45 ResourceResponse* response) = 0; | 45 ResourceResponse* response) = 0; |
| 46 | 46 |
| 47 // Data will be read for the response. Upon success, this method places the | 47 // Data will be read for the response. Upon success, this method places the |
| 48 // size and address of the buffer where the data is to be written in its | 48 // size and address of the buffer where the data is to be written in its |
| 49 // out-params. This call will be followed by either OnReadCompleted or | 49 // out-params. This call will be followed by either OnReadCompleted or |
| 50 // OnResponseCompleted, at which point the buffer may be recycled. | 50 // OnResponseCompleted, at which point the buffer may be recycled. |
| 51 virtual bool OnWillRead(int request_id, | 51 virtual bool OnWillRead(int request_id, |
| 52 char** buf, | 52 net::IOBuffer** buf, |
| 53 int* buf_size, | 53 int* buf_size, |
| 54 int min_size) = 0; | 54 int min_size) = 0; |
| 55 | 55 |
| 56 // Data (*bytes_read bytes) was written into the buffer provided by | 56 // Data (*bytes_read bytes) was written into the buffer provided by |
| 57 // OnWillRead. A return value of false cancels the request, true continues | 57 // OnWillRead. A return value of false cancels the request, true continues |
| 58 // reading data. | 58 // reading data. |
| 59 virtual bool OnReadCompleted(int request_id, int* bytes_read) = 0; | 59 virtual bool OnReadCompleted(int request_id, int* bytes_read) = 0; |
| 60 | 60 |
| 61 // The response is complete. The final response status is given. | 61 // The response is complete. The final response status is given. |
| 62 // Returns false if the handler is deferring the call to a later time. | 62 // Returns false if the handler is deferring the call to a later time. |
| 63 virtual bool OnResponseCompleted(int request_id, | 63 virtual bool OnResponseCompleted(int request_id, |
| 64 const URLRequestStatus& status) = 0; | 64 const URLRequestStatus& status) = 0; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_ | 67 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_HANDLER_H_ |
| OLD | NEW |