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

Side by Side Diff: net/url_request/url_request_simple_job.cc

Issue 653863003: Adding instrumentation to locate the source of jankiness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 #include "net/url_request/url_request_simple_job.h" 5 #include "net/url_request/url_request_simple_job.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed. 93 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
94 tracked_objects::ScopedProfile tracking_profile( 94 tracked_objects::ScopedProfile tracking_profile(
95 FROM_HERE_WITH_EXPLICIT_FUNCTION( 95 FROM_HERE_WITH_EXPLICIT_FUNCTION(
96 "422489 URLRequestSimpleJob::StartAsync 3")); 96 "422489 URLRequestSimpleJob::StartAsync 3"));
97 97
98 OnGetDataCompleted(result); 98 OnGetDataCompleted(result);
99 } 99 }
100 } 100 }
101 101
102 void URLRequestSimpleJob::OnGetDataCompleted(int result) { 102 void URLRequestSimpleJob::OnGetDataCompleted(int result) {
103 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
104 tracked_objects::ScopedProfile tracking_profile(
105 FROM_HERE_WITH_EXPLICIT_FUNCTION(
106 "422489 URLRequestSimpleJob::OnGetDataCompleted"));
107
103 if (result == OK) { 108 if (result == OK) {
104 // Notify that the headers are complete 109 // Notify that the headers are complete
105 if (!byte_range_.ComputeBounds(data_.size())) { 110 if (!byte_range_.ComputeBounds(data_.size())) {
106 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, 111 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
107 ERR_REQUEST_RANGE_NOT_SATISFIABLE)); 112 ERR_REQUEST_RANGE_NOT_SATISFIABLE));
108 return; 113 return;
109 } 114 }
110 115
111 data_offset_ = byte_range_.first_byte_position(); 116 data_offset_ = byte_range_.first_byte_position();
112 int remaining_bytes = byte_range_.last_byte_position() - 117 int remaining_bytes = byte_range_.last_byte_position() -
113 byte_range_.first_byte_position() + 1; 118 byte_range_.first_byte_position() + 1;
114 set_expected_content_size(remaining_bytes); 119 set_expected_content_size(remaining_bytes);
115 NotifyHeadersComplete(); 120 NotifyHeadersComplete();
116 } else { 121 } else {
117 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result)); 122 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result));
118 } 123 }
119 } 124 }
120 125
121 } // namespace net 126 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_data_job.cc ('k') | storage/browser/blob/view_blob_internals_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698