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

Unified Diff: net/url_request/url_request.cc

Issue 1569673002: [NOT FOR LANDING] Detailed loading traces Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/partial_data.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 9fa81a760b0be307ef703d024f2d5270e16b08d0..02f9233af99c9e90b2dc0abdb27793cf725e0dbd 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -5,7 +5,7 @@
#include "net/url_request/url_request.h"
#include <utility>
-
+#include "base/trace_event/trace_event.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
@@ -169,9 +169,11 @@ void URLRequest::Delegate::OnBeforeNetworkStart(URLRequest* request,
// URLRequest
URLRequest::~URLRequest() {
+ TRACE_EVENT0("toplevel", "URLRequest::~URLRequest");
Cancel();
if (network_delegate_) {
+ TRACE_EVENT0("toplevel", "NetworkDelegate::NotifyURLRequestDestroyed");
network_delegate_->NotifyURLRequestDestroyed(this);
if (job_.get())
job_->NotifyURLRequestDestroyed();
@@ -504,6 +506,7 @@ void URLRequest::set_delegate(Delegate* delegate) {
}
void URLRequest::Start() {
+ TRACE_EVENT0("toplevel", "URLRequest::Start");
DCHECK(delegate_);
// TODO(pkasting): Remove ScopedTracker below once crbug.com/456327 is fixed.
@@ -531,8 +534,12 @@ void URLRequest::Start() {
FROM_HERE_WITH_EXPLICIT_FUNCTION("456327 URLRequest::Start 2.5"));
OnCallToDelegate();
- int error = network_delegate_->NotifyBeforeURLRequest(
- this, before_request_callback_, &delegate_redirect_url_);
+ int error;
+ {
+ TRACE_EVENT0("toplevel", "NetworkDelegate::NotifyBeforeURLRequest");
+ error = network_delegate_->NotifyBeforeURLRequest(
+ this, before_request_callback_, &delegate_redirect_url_);
+ }
// If ERR_IO_PENDING is returned, the delegate will invoke
// |before_request_callback_| later.
if (error != ERR_IO_PENDING)
@@ -588,6 +595,7 @@ URLRequest::URLRequest(const GURL& url,
}
void URLRequest::BeforeRequestComplete(int error) {
+ TRACE_EVENT0("toplevel", "NetworkDelegate::BeforeRequestComplete");
DCHECK(!job_.get());
DCHECK_NE(ERR_IO_PENDING, error);
@@ -617,6 +625,7 @@ void URLRequest::BeforeRequestComplete(int error) {
}
void URLRequest::StartJob(URLRequestJob* job) {
+ TRACE_EVENT0("toplevel", "URLRequest::StartJob");
// TODO(mmenke): Remove ScopedTracker below once crbug.com/456327 is fixed.
tracked_objects::ScopedTracker tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION("456327 URLRequest::StartJob"));
@@ -737,6 +746,8 @@ void URLRequest::DoCancel(int error, const SSLInfo& ssl_info) {
}
bool URLRequest::Read(IOBuffer* dest, int dest_size, int* bytes_read) {
+ TRACE_EVENT0("toplevel", "URLRequest::Read");
+
DCHECK(job_.get());
DCHECK(bytes_read);
*bytes_read = 0;
@@ -812,6 +823,7 @@ void URLRequest::ResumeNetworkStart() {
}
void URLRequest::NotifyResponseStarted() {
+ TRACE_EVENT0("toplevel", "URLRequest::NotifyResponseStarted");
int net_error = OK;
if (!status_.is_success())
net_error = status_.error();
@@ -903,6 +915,7 @@ void URLRequest::PrepareToRestart() {
}
void URLRequest::OrphanJob() {
+ TRACE_EVENT0("toplevel", "URLRequest::OrphanJob");
// When calling this function, please check that URLRequestHttpJob is
// not in between calling NetworkDelegate::NotifyHeadersReceived receiving
// the call back. This is currently guaranteed by the following strategies:
@@ -1115,6 +1128,7 @@ void URLRequest::NotifySSLCertificateError(const SSLInfo& ssl_info,
}
bool URLRequest::CanGetCookies(const CookieList& cookie_list) const {
+ TRACE_EVENT0("toplevel", "URLRequest::CanGetCookies");
DCHECK(!(load_flags_ & LOAD_DO_NOT_SEND_COOKIES));
if (network_delegate_) {
return network_delegate_->CanGetCookies(*this, cookie_list);
@@ -1179,6 +1193,7 @@ void URLRequest::OnHeadersComplete() {
}
void URLRequest::NotifyRequestCompleted() {
+ TRACE_EVENT0("toplevel", "URLRequest::NotifyRequestCompleted");
// TODO(battre): Get rid of this check, according to willchan it should
// not be needed.
if (has_notified_completion_)
« no previous file with comments | « net/http/partial_data.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698