| Index: content/browser/loader/resource_dispatcher_host_impl.cc
|
| diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
|
| index ebfce6cdca9ef6cb37e6bf14c1dbb9cd11968d4f..029603378014cb4a57fd2551e552cd056483f576 100644
|
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc
|
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
|
| @@ -32,6 +32,7 @@
|
| #include "content/browser/download/save_file_resource_handler.h"
|
| #include "content/browser/fileapi/chrome_blob_storage_context.h"
|
| #include "content/browser/frame_host/navigation_request_info.h"
|
| +#include "content/browser/frame_host/navigator.h"
|
| #include "content/browser/loader/async_resource_handler.h"
|
| #include "content/browser/loader/buffered_resource_handler.h"
|
| #include "content/browser/loader/cross_site_resource_handler.h"
|
| @@ -329,6 +330,25 @@ void AttachRequestBodyBlobDataHandles(
|
| }
|
| }
|
|
|
| +// PlzNavigate
|
| +// This method is called in the UI thread to send the timestamp of a resource
|
| +// request to the respective NavigatorImpl (for an UMA histogram).
|
| +void LogResourceRequestTimeOnUI(
|
| + base::TimeTicks timestamp, int render_process_id, int render_frame_host) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + RenderFrameHostImpl* host =
|
| + RenderFrameHostImpl::FromID(render_process_id, render_frame_host);
|
| + if (host != NULL) {
|
| + DCHECK(host->frame_tree_node()->IsMainFrame());
|
| + LOG(WARNING) << "$$$$$$$$$$$$$$$";
|
| + LOG(WARNING) << "Found RenderFrameHostImpl";
|
| + LOG(WARNING) << "process_id / child_id = " << render_process_id;
|
| + LOG(WARNING) << "routing_id / render_frame_host = " << render_frame_host;
|
| + content::Navigator* navigator = host->frame_tree_node()->navigator();
|
| + navigator->LogResourceRequestTime(timestamp);
|
| + }
|
| +}
|
| +
|
| } // namespace
|
|
|
| // static
|
| @@ -888,6 +908,14 @@ void ResourceDispatcherHostImpl::OnRequestResource(
|
| int routing_id,
|
| int request_id,
|
| const ResourceHostMsg_Request& request_data) {
|
| + if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) {
|
| + int child_id = filter_->child_id();
|
| + BrowserThread::PostTask(
|
| + BrowserThread::UI,
|
| + FROM_HERE,
|
| + base::Bind(&LogResourceRequestTimeOnUI,
|
| + TimeTicks::Now(), child_id, request_data.render_frame_id));
|
| + }
|
| BeginRequest(request_id, request_data, NULL, routing_id);
|
| }
|
|
|
|
|