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

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

Issue 1072423005: Set network_accessed earlier, when network transaction creates stream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also set network_accessed in URLRequest::NotifyBeforeNetworkStart Created 5 years, 7 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
« no previous file with comments | « no previous file | net/url_request/url_request.cc » ('j') | net/url_request/url_request.cc » ('J')
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 #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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 return OK; 732 return OK;
733 return ERR_IO_PENDING; 733 return ERR_IO_PENDING;
734 } 734 }
735 735
736 int HttpNetworkTransaction::DoCreateStream() { 736 int HttpNetworkTransaction::DoCreateStream() {
737 // TODO(pkasting): Remove ScopedTracker below once crbug.com/424359 is fixed. 737 // TODO(pkasting): Remove ScopedTracker below once crbug.com/424359 is fixed.
738 tracked_objects::ScopedTracker tracking_profile( 738 tracked_objects::ScopedTracker tracking_profile(
739 FROM_HERE_WITH_EXPLICIT_FUNCTION( 739 FROM_HERE_WITH_EXPLICIT_FUNCTION(
740 "424359 HttpNetworkTransaction::DoCreateStream")); 740 "424359 HttpNetworkTransaction::DoCreateStream"));
741 741
742 response_.network_accessed = true;
743
742 next_state_ = STATE_CREATE_STREAM_COMPLETE; 744 next_state_ = STATE_CREATE_STREAM_COMPLETE;
743 if (ForWebSocketHandshake()) { 745 if (ForWebSocketHandshake()) {
744 stream_request_.reset( 746 stream_request_.reset(
745 session_->http_stream_factory_for_websocket() 747 session_->http_stream_factory_for_websocket()
746 ->RequestWebSocketHandshakeStream( 748 ->RequestWebSocketHandshakeStream(
747 *request_, 749 *request_,
748 priority_, 750 priority_,
749 server_ssl_config_, 751 server_ssl_config_,
750 proxy_ssl_config_, 752 proxy_ssl_config_,
751 this, 753 this,
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 1023
1022 int HttpNetworkTransaction::DoSendRequestComplete(int result) { 1024 int HttpNetworkTransaction::DoSendRequestComplete(int result) {
1023 // TODO(pkasting): Remove ScopedTracker below once crbug.com/424359 is fixed. 1025 // TODO(pkasting): Remove ScopedTracker below once crbug.com/424359 is fixed.
1024 tracked_objects::ScopedTracker tracking_profile( 1026 tracked_objects::ScopedTracker tracking_profile(
1025 FROM_HERE_WITH_EXPLICIT_FUNCTION( 1027 FROM_HERE_WITH_EXPLICIT_FUNCTION(
1026 "424359 HttpNetworkTransaction::DoSendRequestComplete")); 1028 "424359 HttpNetworkTransaction::DoSendRequestComplete"));
1027 1029
1028 send_end_time_ = base::TimeTicks::Now(); 1030 send_end_time_ = base::TimeTicks::Now();
1029 if (result < 0) 1031 if (result < 0)
1030 return HandleIOError(result); 1032 return HandleIOError(result);
1031 response_.network_accessed = true;
1032 next_state_ = STATE_READ_HEADERS; 1033 next_state_ = STATE_READ_HEADERS;
1033 return OK; 1034 return OK;
1034 } 1035 }
1035 1036
1036 int HttpNetworkTransaction::DoReadHeaders() { 1037 int HttpNetworkTransaction::DoReadHeaders() {
1037 // TODO(pkasting): Remove ScopedTracker below once crbug.com/424359 is fixed. 1038 // TODO(pkasting): Remove ScopedTracker below once crbug.com/424359 is fixed.
1038 tracked_objects::ScopedTracker tracking_profile( 1039 tracked_objects::ScopedTracker tracking_profile(
1039 FROM_HERE_WITH_EXPLICIT_FUNCTION( 1040 FROM_HERE_WITH_EXPLICIT_FUNCTION(
1040 "424359 HttpNetworkTransaction::DoReadHeaders")); 1041 "424359 HttpNetworkTransaction::DoReadHeaders"));
1041 1042
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1653 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1654 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1654 state); 1655 state);
1655 break; 1656 break;
1656 } 1657 }
1657 return description; 1658 return description;
1658 } 1659 }
1659 1660
1660 #undef STATE_CASE 1661 #undef STATE_CASE
1661 1662
1662 } // namespace net 1663 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/url_request/url_request.cc » ('j') | net/url_request/url_request.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698