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

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

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 7 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
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 84001faae576d66acff8e2cef250430acb126a47..c7a215d0dd87d8beec3d0d5b948f04ca0193c0be 100644
--- a/content/browser/loader/navigation_url_loader_impl_core.cc
+++ b/content/browser/loader/navigation_url_loader_impl_core.cc
@@ -6,20 +6,21 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/time/time.h"
#include "content/browser/frame_host/navigation_request_info.h"
#include "content/browser/loader/navigation_resource_handler.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/service_worker/service_worker_navigation_handle_core.h"
#include "content/common/navigation_params.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/navigation_data.h"
#include "content/public/browser/stream_handle.h"
#include "content/public/common/resource_response.h"
#include "net/base/net_errors.h"
#include "net/url_request/redirect_info.h"
namespace content {
NavigationURLLoaderImplCore::NavigationURLLoaderImplCore(
const base::WeakPtr<NavigationURLLoaderImpl>& loader)
: loader_(loader),
@@ -87,39 +88,41 @@ void NavigationURLLoaderImplCore::NotifyRequestRedirected(
// 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,
- std::unique_ptr<StreamHandle> body) {
+ std::unique_ptr<StreamHandle> body,
+ std::unique_ptr<NavigationData> navigation_data) {
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
// and the request released at that point.
// Make a copy of the ResourceResponse before it is passed to another thread.
//
// TODO(davidben): This copy could be avoided if ResourceResponse weren't
// reference counted and the loader stack passed unique ownership of the
// response. https://crbug.com/416050
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&NavigationURLLoaderImpl::NotifyResponseStarted, loader_,
- response->DeepCopy(), base::Passed(&body)));
+ response->DeepCopy(), base::Passed(&body),
+ base::Passed(&navigation_data)));
}
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);
« no previous file with comments | « content/browser/loader/navigation_url_loader_impl_core.h ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698