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

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: Fixed crash issue for synchronous navigations. 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..bd7ef98f8eaaf69fc862f0ae36eed0ed7c2ea8c2 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,22 @@ void NavigationURLLoaderImplCore::NotifyRequestRedirected(
BrowserThread::UI, FROM_HERE,
base::Bind(&NavigationURLLoaderImpl::NotifyRequestRedirected, loader_,
redirect_info, response->DeepCopy()));
+
+ // TODO(carlosk): extend this trace to support non-PlzNavigate navigations.
+ // For the trace below we're using the NavigationURLLoaderImplCore as the
+ // async trace id and reporting the new redirect URL as a parameter.
+ TRACE_EVENT_ASYNC_BEGIN2("navigation", "Navigation redirectDelay", this,
+ "&NavigationURLLoaderImplCore", this, "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 +111,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,
« no previous file with comments | « content/browser/loader/navigation_url_loader_impl.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698