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

Side by Side Diff: net/http/http_cache_transaction.h

Issue 10834178: net: Return size of upload as well as position from HttpTransaction::GetUploadProgress() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make UploadProgress a class instead of a struct Created 8 years, 3 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 // This file declares HttpCache::Transaction, a private class of HttpCache so 5 // This file declares HttpCache::Transaction, a private class of HttpCache so
6 // it should only be included by http_cache.cc 6 // it should only be included by http_cache.cc
7 7
8 #ifndef NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 8 #ifndef NET_HTTP_HTTP_CACHE_TRANSACTION_H_
9 #define NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 9 #define NET_HTTP_HTTP_CACHE_TRANSACTION_H_
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 virtual int RestartWithAuth(const AuthCredentials& credentials, 112 virtual int RestartWithAuth(const AuthCredentials& credentials,
113 const CompletionCallback& callback) OVERRIDE; 113 const CompletionCallback& callback) OVERRIDE;
114 virtual bool IsReadyToRestartForAuth() OVERRIDE; 114 virtual bool IsReadyToRestartForAuth() OVERRIDE;
115 virtual int Read(IOBuffer* buf, 115 virtual int Read(IOBuffer* buf,
116 int buf_len, 116 int buf_len,
117 const CompletionCallback& callback) OVERRIDE; 117 const CompletionCallback& callback) OVERRIDE;
118 virtual void StopCaching() OVERRIDE; 118 virtual void StopCaching() OVERRIDE;
119 virtual void DoneReading() OVERRIDE; 119 virtual void DoneReading() OVERRIDE;
120 virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE; 120 virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE;
121 virtual LoadState GetLoadState() const OVERRIDE; 121 virtual LoadState GetLoadState() const OVERRIDE;
122 virtual uint64 GetUploadProgress(void) const OVERRIDE; 122 virtual UploadProgress GetUploadProgress(void) const OVERRIDE;
123 123
124 private: 124 private:
125 static const size_t kNumValidationHeaders = 2; 125 static const size_t kNumValidationHeaders = 2;
126 // Helper struct to pair a header name with its value, for 126 // Helper struct to pair a header name with its value, for
127 // headers used to validate cache entries. 127 // headers used to validate cache entries.
128 struct ValidationHeaders { 128 struct ValidationHeaders {
129 ValidationHeaders() : initialized(false) {} 129 ValidationHeaders() : initialized(false) {}
130 130
131 std::string values[kNumValidationHeaders]; 131 std::string values[kNumValidationHeaders];
132 bool initialized; 132 bool initialized;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 bool range_requested_; // The user requested a byte range. 386 bool range_requested_; // The user requested a byte range.
387 bool handling_206_; // We must deal with this 206 response. 387 bool handling_206_; // We must deal with this 206 response.
388 bool cache_pending_; // We are waiting for the HttpCache. 388 bool cache_pending_; // We are waiting for the HttpCache.
389 bool done_reading_; 389 bool done_reading_;
390 scoped_refptr<IOBuffer> read_buf_; 390 scoped_refptr<IOBuffer> read_buf_;
391 int io_buf_len_; 391 int io_buf_len_;
392 int read_offset_; 392 int read_offset_;
393 int effective_load_flags_; 393 int effective_load_flags_;
394 int write_len_; 394 int write_len_;
395 scoped_ptr<PartialData> partial_; // We are dealing with range requests. 395 scoped_ptr<PartialData> partial_; // We are dealing with range requests.
396 uint64 final_upload_progress_; 396 UploadProgress final_upload_progress_;
397 base::WeakPtrFactory<Transaction> weak_factory_; 397 base::WeakPtrFactory<Transaction> weak_factory_;
398 CompletionCallback io_callback_; 398 CompletionCallback io_callback_;
399 399
400 // Members used to track data for histograms. 400 // Members used to track data for histograms.
401 TransactionPattern transaction_pattern_; 401 TransactionPattern transaction_pattern_;
402 int bytes_read_from_cache_; 402 int bytes_read_from_cache_;
403 int bytes_read_from_network_; 403 int bytes_read_from_network_;
404 base::TimeTicks entry_lock_waiting_since_; 404 base::TimeTicks entry_lock_waiting_since_;
405 base::TimeTicks first_cache_access_since_; 405 base::TimeTicks first_cache_access_since_;
406 base::TimeTicks send_request_since_; 406 base::TimeTicks send_request_since_;
407 407
408 HttpTransactionDelegate* transaction_delegate_; 408 HttpTransactionDelegate* transaction_delegate_;
409 }; 409 };
410 410
411 } // namespace net 411 } // namespace net
412 412
413 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 413 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698