Commit 2cc2073f authored by John Abd-El-Malek's avatar John Abd-El-Malek Committed by Commit Bot

Remove ResourceDispatcherHostDelegate calling LogResourceRequestTime for non-PlzNavigate path.

This is used for UMA only, so we can remove the old path now.

This is working towards eliminating LoaderDelegate interface, as it doesn't work with network service.

Change-Id: Ie1e38dfc094cad75e71375c0a0fbeb6226e00567
Reviewed-on: https://chromium-review.googlesource.com/807590
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521734}
parent 4d7a4631
......@@ -9,7 +9,6 @@
#include <memory>
#include "base/time/time.h"
#include "content/common/content_export.h"
#include "content/public/browser/resource_request_info.h"
#include "net/base/load_states.h"
......@@ -39,11 +38,6 @@ class CONTENT_EXPORT LoaderDelegate {
uint64_t upload_position,
uint64_t upload_size) = 0;
// Called when the network stack started handling the navigation request.
virtual void LogResourceRequestTime(base::TimeTicks timestamp,
int render_process_id,
int render_frame_id,
const GURL& url) = 0;
};
} // namespace content
......
......@@ -819,18 +819,6 @@ void ResourceDispatcherHostImpl::OnRequestResourceInternal(
mojom::URLLoaderClientPtr url_loader_client,
const net::NetworkTrafficAnnotationTag& traffic_annotation) {
DCHECK(requester_info->IsRenderer() || requester_info->IsNavigationPreload());
// When logging time-to-network only care about main frame and non-transfer
// navigations.
// PlzNavigate: this log happens from NavigationRequest::OnRequestStarted
// instead.
if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME &&
request_data.transferred_request_request_id == -1 &&
!IsBrowserSideNavigationEnabled() && loader_delegate_) {
loader_delegate_->LogResourceRequestTime(TimeTicks::Now(),
requester_info->child_id(),
request_data.render_frame_id,
request_data.url);
}
BeginRequest(requester_info, request_id, request_data, is_sync_load,
SyncLoadResultCallback(), routing_id, std::move(mojo_request),
std::move(url_loader_client), traffic_annotation);
......
......@@ -14,22 +14,6 @@ namespace content {
namespace {
// This method is called in the UI thread to send the timestamp of a resource
// request to the respective Navigator (for an UMA histogram).
void DidGetLogResourceRequestTimeOnUI(base::TimeTicks timestamp,
int render_process_id,
int render_frame_id,
const GURL& url) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RenderFrameHostImpl* host =
RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
if (host != nullptr) {
DCHECK(host->frame_tree_node()->IsMainFrame());
host->frame_tree_node()->navigator()->LogResourceRequestTime(
timestamp, url);
}
}
} // namespace
LoaderDelegateImpl::~LoaderDelegateImpl() {}
......@@ -45,15 +29,4 @@ void LoaderDelegateImpl::LoadStateChanged(
url, load_state, upload_position, upload_size);
}
void LoaderDelegateImpl::LogResourceRequestTime(base::TimeTicks timestamp,
int render_process_id,
int render_frame_id,
const GURL& url) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::BindOnce(&DidGetLogResourceRequestTimeOnUI, timestamp,
render_process_id, render_frame_id, url));
}
} // namespace content
......@@ -21,10 +21,6 @@ class CONTENT_EXPORT LoaderDelegateImpl : public LoaderDelegate {
const net::LoadStateWithParam& load_state,
uint64_t upload_position,
uint64_t upload_size) override;
void LogResourceRequestTime(base::TimeTicks timestamp,
int render_process_id,
int render_frame_id,
const GURL& url) override;
};
} // namespace content
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment