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

Side by Side Diff: net/http/http_network_transaction.cc

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: rebase 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 #include "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 return LOAD_STATE_SENDING_REQUEST; 367 return LOAD_STATE_SENDING_REQUEST;
368 case STATE_READ_HEADERS_COMPLETE: 368 case STATE_READ_HEADERS_COMPLETE:
369 return LOAD_STATE_WAITING_FOR_RESPONSE; 369 return LOAD_STATE_WAITING_FOR_RESPONSE;
370 case STATE_READ_BODY_COMPLETE: 370 case STATE_READ_BODY_COMPLETE:
371 return LOAD_STATE_READING_RESPONSE; 371 return LOAD_STATE_READING_RESPONSE;
372 default: 372 default:
373 return LOAD_STATE_IDLE; 373 return LOAD_STATE_IDLE;
374 } 374 }
375 } 375 }
376 376
377 uint64 HttpNetworkTransaction::GetUploadProgress() const { 377 UploadProgress HttpNetworkTransaction::GetUploadProgress() const {
378 if (!stream_.get()) 378 if (!stream_.get())
379 return 0; 379 return UploadProgress();
380 380
381 return stream_->GetUploadProgress(); 381 return stream_->GetUploadProgress();
382 } 382 }
383 383
384 void HttpNetworkTransaction::OnStreamReady(const SSLConfig& used_ssl_config, 384 void HttpNetworkTransaction::OnStreamReady(const SSLConfig& used_ssl_config,
385 const ProxyInfo& used_proxy_info, 385 const ProxyInfo& used_proxy_info,
386 HttpStream* stream) { 386 HttpStream* stream) {
387 DCHECK_EQ(STATE_CREATE_STREAM_COMPLETE, next_state_); 387 DCHECK_EQ(STATE_CREATE_STREAM_COMPLETE, next_state_);
388 DCHECK(stream_request_.get()); 388 DCHECK(stream_request_.get());
389 389
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1414 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1415 state); 1415 state);
1416 break; 1416 break;
1417 } 1417 }
1418 return description; 1418 return description;
1419 } 1419 }
1420 1420
1421 #undef STATE_CASE 1421 #undef STATE_CASE
1422 1422
1423 } // namespace net 1423 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698