| 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_CORE_H_ | 5 #ifndef NET_URL_REQUEST_URL_FETCHER_CORE_H_ |
| 6 #define NET_URL_REQUEST_URL_FETCHER_CORE_H_ | 6 #define NET_URL_REQUEST_URL_FETCHER_CORE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 // Stops any in-progress load and ensures no callback will happen. It is | 56 // Stops any in-progress load and ensures no callback will happen. It is |
| 57 // safe to call this multiple times. | 57 // safe to call this multiple times. |
| 58 void Stop(); | 58 void Stop(); |
| 59 | 59 |
| 60 // URLFetcher-like functions. | 60 // URLFetcher-like functions. |
| 61 | 61 |
| 62 // For POST requests, set |content_type| to the MIME type of the | 62 // For POST requests, set |content_type| to the MIME type of the |
| 63 // content and set |content| to the data to upload. | 63 // content and set |content| to the data to upload. |
| 64 void SetUploadDataStream(const std::string& upload_content_type, | 64 void SetUploadDataStream(const std::string& upload_content_type, |
| 65 scoped_ptr<UploadDataStream> upload_content); | 65 scoped_ptr<UploadDataStream> upload_data_stream); |
| 66 void SetUploadData(const std::string& upload_content_type, | 66 void SetUploadData(const std::string& upload_content_type, |
| 67 const std::string& upload_content); | 67 const std::string& upload_content); |
| 68 void SetChunkedUpload(const std::string& upload_content_type); | 68 void SetChunkedUpload(const std::string& upload_content_type); |
| 69 // Adds a block of data to be uploaded in a POST body. This can only be | 69 // Adds a block of data to be uploaded in a POST body. This can only be |
| 70 // called after Start(). | 70 // called after Start(). |
| 71 void AppendChunkToUpload(const std::string& data, bool is_last_chunk); | 71 void AppendChunkToUpload(const std::string& data, bool is_last_chunk); |
| 72 // |flags| are flags to apply to the load operation--these should be | 72 // |flags| are flags to apply to the load operation--these should be |
| 73 // one or more of the LOAD_* flags defined in net/base/load_flags.h. | 73 // one or more of the LOAD_* flags defined in net/base/load_flags.h. |
| 74 void SetLoadFlags(int load_flags); | 74 void SetLoadFlags(int load_flags); |
| 75 int GetLoadFlags() const; | 75 int GetLoadFlags() const; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 GURL first_party_for_cookies_; // The first party URL for the request | 328 GURL first_party_for_cookies_; // The first party URL for the request |
| 329 // The user data to add to each newly-created URLRequest. | 329 // The user data to add to each newly-created URLRequest. |
| 330 const void* url_request_data_key_; | 330 const void* url_request_data_key_; |
| 331 URLFetcher::CreateDataCallback url_request_create_data_callback_; | 331 URLFetcher::CreateDataCallback url_request_create_data_callback_; |
| 332 ResponseCookies cookies_; // Response cookies | 332 ResponseCookies cookies_; // Response cookies |
| 333 HttpRequestHeaders extra_request_headers_; | 333 HttpRequestHeaders extra_request_headers_; |
| 334 scoped_refptr<HttpResponseHeaders> response_headers_; | 334 scoped_refptr<HttpResponseHeaders> response_headers_; |
| 335 bool was_fetched_via_proxy_; | 335 bool was_fetched_via_proxy_; |
| 336 HostPortPair socket_address_; | 336 HostPortPair socket_address_; |
| 337 | 337 |
| 338 scoped_ptr<UploadDataStream> upload_content_; // HTTP POST payload | 338 scoped_ptr<UploadDataStream> upload_data_stream_; // POST payload stream. |
| 339 std::string upload_content_; // POST payload contents. |
| 340 |
| 339 std::string upload_content_type_; // MIME type of POST payload | 341 std::string upload_content_type_; // MIME type of POST payload |
| 340 std::string referrer_; // HTTP Referer header value | 342 std::string referrer_; // HTTP Referer header value |
| 341 bool is_chunked_upload_; // True if using chunked transfer encoding | 343 bool is_chunked_upload_; // True if using chunked transfer encoding |
| 342 | 344 |
| 343 // Used to determine how long to wait before making a request or doing a | 345 // Used to determine how long to wait before making a request or doing a |
| 344 // retry. | 346 // retry. |
| 345 // | 347 // |
| 346 // Both of them can only be accessed on the IO thread. | 348 // Both of them can only be accessed on the IO thread. |
| 347 // | 349 // |
| 348 // We need not only the throttler entry for |original_URL|, but also | 350 // We need not only the throttler entry for |original_URL|, but also |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 base::debug::StackTrace stack_trace_; | 419 base::debug::StackTrace stack_trace_; |
| 418 | 420 |
| 419 static base::LazyInstance<Registry> g_registry; | 421 static base::LazyInstance<Registry> g_registry; |
| 420 | 422 |
| 421 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore); | 423 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore); |
| 422 }; | 424 }; |
| 423 | 425 |
| 424 } // namespace net | 426 } // namespace net |
| 425 | 427 |
| 426 #endif // NET_URL_REQUEST_URL_FETCHER_CORE_H_ | 428 #endif // NET_URL_REQUEST_URL_FETCHER_CORE_H_ |
| OLD | NEW |