| 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 #ifndef NET_URL_REQUEST_URL_FETCHER_H_ | 5 #ifndef NET_URL_REQUEST_URL_FETCHER_H_ |
| 6 #define NET_URL_REQUEST_URL_FETCHER_H_ | 6 #define NET_URL_REQUEST_URL_FETCHER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 static void SetEnableInterceptionForTests(bool enabled); | 117 static void SetEnableInterceptionForTests(bool enabled); |
| 118 | 118 |
| 119 // Normally, URLFetcher will abort loads that request SSL client certificate | 119 // Normally, URLFetcher will abort loads that request SSL client certificate |
| 120 // authentication, but this method may be used to cause URLFetchers to ignore | 120 // authentication, but this method may be used to cause URLFetchers to ignore |
| 121 // requests for client certificates and continue anonymously. Because such | 121 // requests for client certificates and continue anonymously. Because such |
| 122 // behaviour affects the URLRequestContext's shared network state and socket | 122 // behaviour affects the URLRequestContext's shared network state and socket |
| 123 // pools, it should only be used for testing. | 123 // pools, it should only be used for testing. |
| 124 static void SetIgnoreCertificateRequests(bool ignored); | 124 static void SetIgnoreCertificateRequests(bool ignored); |
| 125 | 125 |
| 126 // Sets data only needed by POSTs. All callers making POST requests should | 126 // Sets data only needed by POSTs. All callers making POST requests should |
| 127 // call this before the request is started. |upload_content_type| is the MIME | 127 // call one of the SetUpload* methods before the request is started. |
| 128 // type of the content, while |upload_content| is the data to be sent (the | 128 // |upload_content_type| is the MIME type of the content, while |
| 129 // Content-Length header value will be set to the length of this data). | 129 // |upload_content| is the data to be sent (the Content-Length header value |
| 130 // will be set to the length of this data). |
| 130 virtual void SetUploadData(const std::string& upload_content_type, | 131 virtual void SetUploadData(const std::string& upload_content_type, |
| 131 const std::string& upload_content) = 0; | 132 const std::string& upload_content) = 0; |
| 132 | 133 |
| 134 // Sets data only needed by POSTs. All callers making POST requests should |
| 135 // call one of the SetUpload* methods before the request is started. |
| 136 // |upload_content_type| is the MIME type of the content, while |
| 137 // |file_path| is the path to the file containing the data to be sent (the |
| 138 // Content-Length header value will be set to the length of this file). |
| 139 // |file_task_runner| will be used for all file operations. |
| 140 virtual void SetUploadFilePath( |
| 141 const std::string& upload_content_type, |
| 142 const base::FilePath& file_path, |
| 143 scoped_refptr<base::TaskRunner> file_task_runner) = 0; |
| 144 |
| 133 // Indicates that the POST data is sent via chunked transfer encoding. | 145 // Indicates that the POST data is sent via chunked transfer encoding. |
| 134 // This may only be called before calling Start(). | 146 // This may only be called before calling Start(). |
| 135 // Use AppendChunkToUpload() to give the data chunks after calling Start(). | 147 // Use AppendChunkToUpload() to give the data chunks after calling Start(). |
| 136 virtual void SetChunkedUpload(const std::string& upload_content_type) = 0; | 148 virtual void SetChunkedUpload(const std::string& upload_content_type) = 0; |
| 137 | 149 |
| 138 // Adds the given bytes to a request's POST data transmitted using chunked | 150 // Adds the given bytes to a request's POST data transmitted using chunked |
| 139 // transfer encoding. | 151 // transfer encoding. |
| 140 // This method should be called ONLY after calling Start(). | 152 // This method should be called ONLY after calling Start(). |
| 141 virtual void AppendChunkToUpload(const std::string& data, | 153 virtual void AppendChunkToUpload(const std::string& data, |
| 142 bool is_last_chunk) = 0; | 154 bool is_last_chunk) = 0; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 // be removed once the URLFetcher is destroyed. User should not take | 289 // be removed once the URLFetcher is destroyed. User should not take |
| 278 // ownership more than once, or call this method after taking ownership. | 290 // ownership more than once, or call this method after taking ownership. |
| 279 virtual bool GetResponseAsFilePath( | 291 virtual bool GetResponseAsFilePath( |
| 280 bool take_ownership, | 292 bool take_ownership, |
| 281 base::FilePath* out_response_path) const = 0; | 293 base::FilePath* out_response_path) const = 0; |
| 282 }; | 294 }; |
| 283 | 295 |
| 284 } // namespace net | 296 } // namespace net |
| 285 | 297 |
| 286 #endif // NET_URL_REQUEST_URL_FETCHER_H_ | 298 #endif // NET_URL_REQUEST_URL_FETCHER_H_ |
| OLD | NEW |