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

Unified Diff: content/browser/loader/navigation_url_loader_impl_core.cc

Issue 1532873003: PlzNavigate: add initial traces for new TBM benchmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address CR comments Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/loader/navigation_url_loader_impl_core.cc
diff --git a/content/browser/loader/navigation_url_loader_impl_core.cc b/content/browser/loader/navigation_url_loader_impl_core.cc
index 05d4b654efd8f0b9d601f2f2bff8f8ecd2ec39bc..b1276e6bb54d3af4fe4228362375764ef73fb412 100644
--- a/content/browser/loader/navigation_url_loader_impl_core.cc
+++ b/content/browser/loader/navigation_url_loader_impl_core.cc
@@ -65,6 +65,7 @@ void NavigationURLLoaderImplCore::NotifyRequestRedirected(
const net::RedirectInfo& redirect_info,
ResourceResponse* response) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ TRACE_EVENT_ASYNC_END0("navigation", "Navigation redirectDelay", this);
// Make a copy of the ResourceResponse before it is passed to another thread.
//
@@ -75,12 +76,24 @@ void NavigationURLLoaderImplCore::NotifyRequestRedirected(
BrowserThread::UI, FROM_HERE,
base::Bind(&NavigationURLLoaderImpl::NotifyRequestRedirected, loader_,
redirect_info, response->DeepCopy()));
+ TRACE_EVENT_ASYNC_BEGIN2(
+ // category and name
+ "navigation", "Navigation redirectDelay",
+ // use this NavigationURLLoaderImplCore instance as the async trace id
+ this,
+ // add this instance address as a parameter
+ "&NavigationURLLoaderImplCore", this,
clamy 2015/12/21 10:43:32 Why the & here? Also as mentioned somewhere else,
carlosk 2015/12/21 11:19:25 Done.
+ // add the redirected URL as a parameter
+ "New URL", redirect_info.new_url.spec());
}
void NavigationURLLoaderImplCore::NotifyResponseStarted(
ResourceResponse* response,
scoped_ptr<StreamHandle> body) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ TRACE_EVENT_ASYNC_END0("navigation", "Navigation redirectDelay", this);
+ TRACE_EVENT_ASYNC_END2("navigation", "Navigation timeToResponseStarted", this,
+ "&NavigationURLLoaderImplCore", this, "success", true);
// If, by the time the task reaches the UI thread, |loader_| has already been
// destroyed, NotifyResponseStarted will not run. |body| will be destructed
@@ -100,6 +113,10 @@ void NavigationURLLoaderImplCore::NotifyResponseStarted(
void NavigationURLLoaderImplCore::NotifyRequestFailed(bool in_cache,
int net_error) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ TRACE_EVENT_ASYNC_END0("navigation", "Navigation redirectDelay", this);
+ TRACE_EVENT_ASYNC_END2("navigation", "Navigation timeToResponseStarted", this,
+ "&NavigationURLLoaderImplCore", this, "success",
+ false);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698