Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: net/url_request/url_fetcher_core.h

Issue 11843003: Add SetUploadDataStream method to URLFetcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_fetcher.h ('k') | net/url_request/url_fetcher_core.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void Start(); 54 void Start();
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,
65 scoped_ptr<UploadDataStream> upload_content);
64 void SetUploadData(const std::string& upload_content_type, 66 void SetUploadData(const std::string& upload_content_type,
65 const std::string& upload_content); 67 const std::string& upload_content);
66 void SetChunkedUpload(const std::string& upload_content_type); 68 void SetChunkedUpload(const std::string& upload_content_type);
67 // 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
68 // called after Start(). 70 // called after Start().
69 void AppendChunkToUpload(const std::string& data, bool is_last_chunk); 71 void AppendChunkToUpload(const std::string& data, bool is_last_chunk);
70 // |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
71 // 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.
72 void SetLoadFlags(int load_flags); 74 void SetLoadFlags(int load_flags);
73 int GetLoadFlags() const; 75 int GetLoadFlags() const;
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 GURL first_party_for_cookies_; // The first party URL for the request 327 GURL first_party_for_cookies_; // The first party URL for the request
326 // The user data to add to each newly-created URLRequest. 328 // The user data to add to each newly-created URLRequest.
327 const void* url_request_data_key_; 329 const void* url_request_data_key_;
328 URLFetcher::CreateDataCallback url_request_create_data_callback_; 330 URLFetcher::CreateDataCallback url_request_create_data_callback_;
329 ResponseCookies cookies_; // Response cookies 331 ResponseCookies cookies_; // Response cookies
330 HttpRequestHeaders extra_request_headers_; 332 HttpRequestHeaders extra_request_headers_;
331 scoped_refptr<HttpResponseHeaders> response_headers_; 333 scoped_refptr<HttpResponseHeaders> response_headers_;
332 bool was_fetched_via_proxy_; 334 bool was_fetched_via_proxy_;
333 HostPortPair socket_address_; 335 HostPortPair socket_address_;
334 336
335 std::string upload_content_; // HTTP POST payload 337 scoped_ptr<UploadDataStream> upload_content_; // HTTP POST payload
336 std::string upload_content_type_; // MIME type of POST payload 338 std::string upload_content_type_; // MIME type of POST payload
337 std::string referrer_; // HTTP Referer header value 339 std::string referrer_; // HTTP Referer header value
338 bool is_chunked_upload_; // True if using chunked transfer encoding 340 bool is_chunked_upload_; // True if using chunked transfer encoding
339 341
340 // Used to determine how long to wait before making a request or doing a 342 // Used to determine how long to wait before making a request or doing a
341 // retry. 343 // retry.
342 // 344 //
343 // Both of them can only be accessed on the IO thread. 345 // Both of them can only be accessed on the IO thread.
344 // 346 //
345 // We need not only the throttler entry for |original_URL|, but also 347 // We need not only the throttler entry for |original_URL|, but also
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 base::debug::StackTrace stack_trace_; 416 base::debug::StackTrace stack_trace_;
415 417
416 static base::LazyInstance<Registry> g_registry; 418 static base::LazyInstance<Registry> g_registry;
417 419
418 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore); 420 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore);
419 }; 421 };
420 422
421 } // namespace net 423 } // namespace net
422 424
423 #endif // NET_URL_REQUEST_URL_FETCHER_CORE_H_ 425 #endif // NET_URL_REQUEST_URL_FETCHER_CORE_H_
OLDNEW
« no previous file with comments | « net/url_request/url_fetcher.h ('k') | net/url_request/url_fetcher_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698