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

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

Powered by Google App Engine
This is Rietveld 408576698