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

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

Issue 12224066: Fix UrlFetcher upload retry handling. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Revert http://crrev.com/178535 Created 7 years, 10 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
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);
66 void SetUploadData(const std::string& upload_content_type, 64 void SetUploadData(const std::string& upload_content_type,
67 const std::string& upload_content); 65 const std::string& upload_content);
68 void SetChunkedUpload(const std::string& upload_content_type); 66 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 67 // Adds a block of data to be uploaded in a POST body. This can only be
70 // called after Start(). 68 // called after Start().
71 void AppendChunkToUpload(const std::string& data, bool is_last_chunk); 69 void AppendChunkToUpload(const std::string& data, bool is_last_chunk);
72 // |flags| are flags to apply to the load operation--these should be 70 // |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. 71 // one or more of the LOAD_* flags defined in net/base/load_flags.h.
74 void SetLoadFlags(int load_flags); 72 void SetLoadFlags(int load_flags);
75 int GetLoadFlags() const; 73 int GetLoadFlags() const;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 GURL first_party_for_cookies_; // The first party URL for the request 326 GURL first_party_for_cookies_; // The first party URL for the request
329 // The user data to add to each newly-created URLRequest. 327 // The user data to add to each newly-created URLRequest.
330 const void* url_request_data_key_; 328 const void* url_request_data_key_;
331 URLFetcher::CreateDataCallback url_request_create_data_callback_; 329 URLFetcher::CreateDataCallback url_request_create_data_callback_;
332 ResponseCookies cookies_; // Response cookies 330 ResponseCookies cookies_; // Response cookies
333 HttpRequestHeaders extra_request_headers_; 331 HttpRequestHeaders extra_request_headers_;
334 scoped_refptr<HttpResponseHeaders> response_headers_; 332 scoped_refptr<HttpResponseHeaders> response_headers_;
335 bool was_fetched_via_proxy_; 333 bool was_fetched_via_proxy_;
336 HostPortPair socket_address_; 334 HostPortPair socket_address_;
337 335
338 scoped_ptr<UploadDataStream> upload_content_; // HTTP POST payload 336 std::string upload_content_; // HTTP POST payload
339 std::string upload_content_type_; // MIME type of POST payload 337 std::string upload_content_type_; // MIME type of POST payload
340 std::string referrer_; // HTTP Referer header value 338 std::string referrer_; // HTTP Referer header value
341 bool is_chunked_upload_; // True if using chunked transfer encoding 339 bool is_chunked_upload_; // True if using chunked transfer encoding
342 340
343 // Used to determine how long to wait before making a request or doing a 341 // Used to determine how long to wait before making a request or doing a
344 // retry. 342 // retry.
345 // 343 //
346 // Both of them can only be accessed on the IO thread. 344 // Both of them can only be accessed on the IO thread.
347 // 345 //
348 // We need not only the throttler entry for |original_URL|, but also 346 // We need not only the throttler entry for |original_URL|, but also
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 base::debug::StackTrace stack_trace_; 415 base::debug::StackTrace stack_trace_;
418 416
419 static base::LazyInstance<Registry> g_registry; 417 static base::LazyInstance<Registry> g_registry;
420 418
421 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore); 419 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore);
422 }; 420 };
423 421
424 } // namespace net 422 } // namespace net
425 423
426 #endif // NET_URL_REQUEST_URL_FETCHER_CORE_H_ 424 #endif // NET_URL_REQUEST_URL_FETCHER_CORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698