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

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

Issue 10830182: net: Return size of upload as well as position from URLRequest::GetUploadProgress() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 years, 4 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_core.cc ('k') | net/url_request/url_request.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_REQUEST_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_H_
6 #define NET_URL_REQUEST_URL_REQUEST_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/debug/leak_tracker.h" 11 #include "base/debug/leak_tracker.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/string16.h" 14 #include "base/string16.h"
15 #include "base/supports_user_data.h" 15 #include "base/supports_user_data.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "base/threading/non_thread_safe.h" 17 #include "base/threading/non_thread_safe.h"
18 #include "googleurl/src/gurl.h" 18 #include "googleurl/src/gurl.h"
19 #include "net/base/auth.h" 19 #include "net/base/auth.h"
20 #include "net/base/completion_callback.h" 20 #include "net/base/completion_callback.h"
21 #include "net/base/load_states.h" 21 #include "net/base/load_states.h"
22 #include "net/base/net_export.h" 22 #include "net/base/net_export.h"
23 #include "net/base/net_log.h" 23 #include "net/base/net_log.h"
24 #include "net/base/network_delegate.h" 24 #include "net/base/network_delegate.h"
25 #include "net/base/request_priority.h" 25 #include "net/base/request_priority.h"
26 #include "net/base/upload_progress.h"
26 #include "net/cookies/canonical_cookie.h" 27 #include "net/cookies/canonical_cookie.h"
27 #include "net/http/http_request_headers.h" 28 #include "net/http/http_request_headers.h"
28 #include "net/http/http_response_info.h" 29 #include "net/http/http_response_info.h"
29 #include "net/url_request/url_request_status.h" 30 #include "net/url_request/url_request_status.h"
30 31
31 class FilePath; 32 class FilePath;
32 // Temporary layering violation to allow existing users of a deprecated 33 // Temporary layering violation to allow existing users of a deprecated
33 // interface. 34 // interface.
34 class AutoUpdateInterceptor; 35 class AutoUpdateInterceptor;
35 class ChildProcessSecurityPolicyTest; 36 class ChildProcessSecurityPolicyTest;
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 438
438 // Returns the current load state for the request. |param| is an optional 439 // Returns the current load state for the request. |param| is an optional
439 // parameter describing details related to the load state. Not all load states 440 // parameter describing details related to the load state. Not all load states
440 // have a parameter. 441 // have a parameter.
441 LoadStateWithParam GetLoadState() const; 442 LoadStateWithParam GetLoadState() const;
442 void SetLoadStateParam(const string16& param) { 443 void SetLoadStateParam(const string16& param) {
443 load_state_param_ = param; 444 load_state_param_ = param;
444 } 445 }
445 446
446 // Returns the current upload progress in bytes. 447 // Returns the current upload progress in bytes.
447 uint64 GetUploadProgress() const; 448 UploadProgress GetUploadProgress() const;
448 449
449 // Get response header(s) by ID or name. These methods may only be called 450 // Get response header(s) by ID or name. These methods may only be called
450 // once the delegate's OnResponseStarted method has been called. Headers 451 // once the delegate's OnResponseStarted method has been called. Headers
451 // that appear more than once in the response are coalesced, with values 452 // that appear more than once in the response are coalesced, with values
452 // separated by commas (per RFC 2616). This will not work with cookies since 453 // separated by commas (per RFC 2616). This will not work with cookies since
453 // comma can be used in cookie values. 454 // comma can be used in cookie values.
454 // TODO(darin): add API to enumerate response headers. 455 // TODO(darin): add API to enumerate response headers.
455 void GetResponseHeaderById(int header_id, std::string* value); 456 void GetResponseHeaderById(int header_id, std::string* value);
456 void GetResponseHeaderByName(const std::string& name, std::string* value); 457 void GetResponseHeaderByName(const std::string& name, std::string* value);
457 458
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 // Start() is called to the time we dispatch RequestComplete and indicates 766 // Start() is called to the time we dispatch RequestComplete and indicates
766 // whether the job is active. 767 // whether the job is active.
767 bool is_pending_; 768 bool is_pending_;
768 769
769 // Number of times we're willing to redirect. Used to guard against 770 // Number of times we're willing to redirect. Used to guard against
770 // infinite redirects. 771 // infinite redirects.
771 int redirect_limit_; 772 int redirect_limit_;
772 773
773 // Cached value for use after we've orphaned the job handling the 774 // Cached value for use after we've orphaned the job handling the
774 // first transaction in a request involving redirects. 775 // first transaction in a request involving redirects.
775 uint64 final_upload_progress_; 776 UploadProgress final_upload_progress_;
776 777
777 // The priority level for this request. Objects like ClientSocketPool use 778 // The priority level for this request. Objects like ClientSocketPool use
778 // this to determine which URLRequest to allocate sockets to first. 779 // this to determine which URLRequest to allocate sockets to first.
779 RequestPriority priority_; 780 RequestPriority priority_;
780 781
781 // TODO(battre): The only consumer of the identifier_ is currently the 782 // TODO(battre): The only consumer of the identifier_ is currently the
782 // web request API. We need to match identifiers of requests between the 783 // web request API. We need to match identifiers of requests between the
783 // web request API and the web navigation API. As the URLRequest does not 784 // web request API and the web navigation API. As the URLRequest does not
784 // exist when the web navigation API is triggered, the tracking probably 785 // exist when the web navigation API is triggered, the tracking probably
785 // needs to be done outside of the URLRequest anyway. Therefore, this 786 // needs to be done outside of the URLRequest anyway. Therefore, this
(...skipping 30 matching lines...) Expand all
816 base::TimeTicks creation_time_; 817 base::TimeTicks creation_time_;
817 818
818 scoped_ptr<const base::debug::StackTrace> stack_trace_; 819 scoped_ptr<const base::debug::StackTrace> stack_trace_;
819 820
820 DISALLOW_COPY_AND_ASSIGN(URLRequest); 821 DISALLOW_COPY_AND_ASSIGN(URLRequest);
821 }; 822 };
822 823
823 } // namespace net 824 } // namespace net
824 825
825 #endif // NET_URL_REQUEST_URL_REQUEST_H_ 826 #endif // NET_URL_REQUEST_URL_REQUEST_H_
OLDNEW
« no previous file with comments | « net/url_request/url_fetcher_core.cc ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698