Index: content/browser/loader/navigation_url_loader_network_service.cc |
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc |
index f6f5ba882512d4f27e875c51cbfcbddd355fe704..335a625f20429bb5c069fa5b35aaeec471f0f037 100644 |
--- a/content/browser/loader/navigation_url_loader_network_service.cc |
+++ b/content/browser/loader/navigation_url_loader_network_service.cc |
@@ -7,6 +7,7 @@ |
#include "base/bind.h" |
#include "base/bind_helpers.h" |
#include "base/memory/ptr_util.h" |
+#include "base/trace_event/trace_event.h" |
#include "content/browser/blob_storage/chrome_blob_storage_context.h" |
#include "content/browser/frame_host/navigation_request_info.h" |
#include "content/browser/loader/navigation_resource_handler.h" |
@@ -55,6 +56,11 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService( |
: delegate_(delegate), binding_(this), weak_factory_(this) { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( |
+ "navigation", "Navigation timeToResponseStarted", this, |
+ request_info->common_params.navigation_start, "FrameTreeNode id", |
+ request_info->frame_tree_node_id); |
+ |
// TODO(scottmg): Maybe some of this setup should be done only once, instead |
// of every time. |
ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( |
@@ -152,6 +158,11 @@ void NavigationURLLoaderNetworkService::OnTransferSizeUpdated( |
void NavigationURLLoaderNetworkService::OnStartLoadingResponseBody( |
mojo::ScopedDataPipeConsumerHandle body) { |
DCHECK(response_); |
+ |
+ TRACE_EVENT_ASYNC_END2("navigation", "Navigation timeToResponseStarted", this, |
+ "&NavigationURLLoaderNetworkService", this, "success", |
+ true); |
+ |
// Temporarily, we pass both a stream (null) and the data pipe to the |
// delegate until PlzNavigate has shipped and we can be comfortable fully |
// switching to the data pipe. |
@@ -164,6 +175,10 @@ void NavigationURLLoaderNetworkService::OnStartLoadingResponseBody( |
void NavigationURLLoaderNetworkService::OnComplete( |
const ResourceRequestCompletionStatus& completion_status) { |
if (completion_status.error_code != net::OK) { |
+ TRACE_EVENT_ASYNC_END2("navigation", "Navigation timeToResponseStarted", |
+ this, "&NavigationURLLoaderNetworkService", this, |
+ "success", false); |
+ |
delegate_->OnRequestFailed(completion_status.exists_in_cache, |
completion_status.error_code); |
} |