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

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

Issue 808483004: Instrumenting URLRequestJob::ReadRawDataHelper for jank. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | no next file » | 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 #include "net/url_request/url_request_job.h" 5 #include "net/url_request/url_request_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/power_monitor/power_monitor.h" 10 #include "base/power_monitor/power_monitor.h"
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 DCHECK(!request_->status().is_io_pending()); 827 DCHECK(!request_->status().is_io_pending());
828 DCHECK(raw_read_buffer_.get() == NULL); 828 DCHECK(raw_read_buffer_.get() == NULL);
829 829
830 // Keep a pointer to the read buffer, so we have access to it in the 830 // Keep a pointer to the read buffer, so we have access to it in the
831 // OnRawReadComplete() callback in the event that the read completes 831 // OnRawReadComplete() callback in the event that the read completes
832 // asynchronously. 832 // asynchronously.
833 raw_read_buffer_ = buf; 833 raw_read_buffer_ = buf;
834 bool rv = ReadRawData(buf, buf_size, bytes_read); 834 bool rv = ReadRawData(buf, buf_size, bytes_read);
835 835
836 if (!request_->status().is_io_pending()) { 836 if (!request_->status().is_io_pending()) {
837 // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed.
838 tracked_objects::ScopedTracker tracking_profile1(
839 FROM_HERE_WITH_EXPLICIT_FUNCTION(
840 "423948 URLRequestJob::ReadRawDataHelper1"));
841
837 // If the read completes synchronously, either success or failure, 842 // If the read completes synchronously, either success or failure,
838 // invoke the OnRawReadComplete callback so we can account for the 843 // invoke the OnRawReadComplete callback so we can account for the
839 // completed read. 844 // completed read.
840 OnRawReadComplete(*bytes_read); 845 OnRawReadComplete(*bytes_read);
841 } 846 }
842 return rv; 847 return rv;
843 } 848 }
844 849
845 void URLRequestJob::FollowRedirect(const RedirectInfo& redirect_info) { 850 void URLRequestJob::FollowRedirect(const RedirectInfo& redirect_info) {
846 int rv = request_->Redirect(redirect_info); 851 int rv = request_->Redirect(redirect_info);
(...skipping 22 matching lines...) Expand all
869 prefilter_bytes_read_ += bytes_read; 874 prefilter_bytes_read_ += bytes_read;
870 if (!filter_.get()) 875 if (!filter_.get())
871 postfilter_bytes_read_ += bytes_read; 876 postfilter_bytes_read_ += bytes_read;
872 DVLOG(2) << __FUNCTION__ << "() " 877 DVLOG(2) << __FUNCTION__ << "() "
873 << "\"" << (request_ ? request_->url().spec() : "???") << "\"" 878 << "\"" << (request_ ? request_->url().spec() : "???") << "\""
874 << " pre bytes read = " << bytes_read 879 << " pre bytes read = " << bytes_read
875 << " pre total = " << prefilter_bytes_read_ 880 << " pre total = " << prefilter_bytes_read_
876 << " post total = " << postfilter_bytes_read_; 881 << " post total = " << postfilter_bytes_read_;
877 UpdatePacketReadTimes(); // Facilitate stats recording if it is active. 882 UpdatePacketReadTimes(); // Facilitate stats recording if it is active.
878 if (network_delegate_) 883 if (network_delegate_)
879 network_delegate_->NotifyRawBytesRead(*request_, bytes_read); 884 network_delegate_->NotifyRawBytesRead(*request_, bytes_read);
mmenke 2014/12/16 16:20:25 Just a note that this is probably the only line in
vadimt 2014/12/16 18:47:09 Done.
880 } 885 }
881 886
882 bool URLRequestJob::FilterHasData() { 887 bool URLRequestJob::FilterHasData() {
883 return filter_.get() && filter_->stream_data_len(); 888 return filter_.get() && filter_->stream_data_len();
884 } 889 }
885 890
886 void URLRequestJob::UpdatePacketReadTimes() { 891 void URLRequestJob::UpdatePacketReadTimes() {
887 } 892 }
888 893
889 RedirectInfo URLRequestJob::ComputeRedirectInfo(const GURL& location, 894 RedirectInfo URLRequestJob::ComputeRedirectInfo(const GURL& location,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). 929 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS).
925 redirect_info.new_referrer = 930 redirect_info.new_referrer =
926 ComputeReferrerForRedirect(request_->referrer_policy(), 931 ComputeReferrerForRedirect(request_->referrer_policy(),
927 request_->referrer(), 932 request_->referrer(),
928 redirect_info.new_url).spec(); 933 redirect_info.new_url).spec();
929 934
930 return redirect_info; 935 return redirect_info;
931 } 936 }
932 937
933 } // namespace net 938 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698