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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 498883002: Add/improve tracing in navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes based on Charlie's review Created 6 years, 4 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index ba00e9f90e1557ea40a3bf5c1c59b535d6e4b3ca..108835dc2366d1d6e7e6036f057aba1795c0e961 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -799,6 +799,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
}
void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) {
+ TRACE_EVENT2("navigation", "RenderFrameImpl::OnNavigate",
+ "id", routing_id_, "url", params.url.possibly_invalid_spec());
MaybeHandleDebugURL(params.url);
if (!render_view_->webview())
return;
@@ -995,6 +997,8 @@ void RenderFrameImpl::BindServiceRegistry(
}
void RenderFrameImpl::OnBeforeUnload() {
+ TRACE_EVENT1("navigation", "RenderFrameImpl::OnBeforeUnload",
+ "id", routing_id_);
// TODO(creis): Right now, this is only called on the main frame. Make the
// browser process send dispatchBeforeUnloadEvent to every frame that needs
// it.
@@ -1009,6 +1013,7 @@ void RenderFrameImpl::OnBeforeUnload() {
}
void RenderFrameImpl::OnSwapOut(int proxy_routing_id) {
+ TRACE_EVENT1("navigation", "RenderFrameImpl::OnSwapOut", "id", routing_id_);
RenderFrameProxy* proxy = NULL;
bool is_site_per_process =
CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess);
@@ -1935,6 +1940,8 @@ void RenderFrameImpl::didStartProvisionalLoad(blink::WebLocalFrame* frame,
if (!ds)
return;
+ TRACE_EVENT2("navigation", "RenderFrameImpl::didStartProvisionalLoad",
+ "id", routing_id_, "url", ds->request().url().string().utf8());
DocumentState* document_state = DocumentState::FromDataSource(ds);
// We should only navigate to swappedout:// when is_swapped_out_ is true.
@@ -2000,6 +2007,8 @@ void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad(
void RenderFrameImpl::didFailProvisionalLoad(blink::WebLocalFrame* frame,
const blink::WebURLError& error) {
+ TRACE_EVENT1("navigation", "RenderFrameImpl::didFailProvisionalLoad",
+ "id", routing_id_);
DCHECK(!frame_ || frame_ == frame);
WebDataSource* ds = frame->provisionalDataSource();
DCHECK(ds);
@@ -2105,6 +2114,9 @@ void RenderFrameImpl::didCommitProvisionalLoad(
blink::WebLocalFrame* frame,
const blink::WebHistoryItem& item,
blink::WebHistoryCommitType commit_type) {
+ TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad",
+ "id", routing_id_,
+ "url", GetLoadingUrl().possibly_invalid_spec());
DCHECK(!frame_ || frame_ == frame);
DocumentState* document_state =
DocumentState::FromDataSource(frame->dataSource());
@@ -2277,6 +2289,8 @@ void RenderFrameImpl::didChangeIcon(blink::WebLocalFrame* frame,
}
void RenderFrameImpl::didFinishDocumentLoad(blink::WebLocalFrame* frame) {
+ TRACE_EVENT1("navigation", "RenderFrameImpl::didFinishDocumentLoad",
+ "id", routing_id_);
DCHECK(!frame_ || frame_ == frame);
WebDataSource* ds = frame->dataSource();
DocumentState* document_state = DocumentState::FromDataSource(ds);
@@ -2300,6 +2314,8 @@ void RenderFrameImpl::didHandleOnloadEvents(blink::WebLocalFrame* frame) {
void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame,
const blink::WebURLError& error) {
+ TRACE_EVENT1("navigation", "RenderFrameImpl::didFailLoad",
+ "id", routing_id_);
DCHECK(!frame_ || frame_ == frame);
// TODO(nasko): Move implementation here. No state needed.
WebDataSource* ds = frame->dataSource();
@@ -2324,6 +2340,8 @@ void RenderFrameImpl::didFailLoad(blink::WebLocalFrame* frame,
}
void RenderFrameImpl::didFinishLoad(blink::WebLocalFrame* frame) {
+ TRACE_EVENT1("navigation", "RenderFrameImpl::didFinishLoad",
+ "id", routing_id_);
DCHECK(!frame_ || frame_ == frame);
WebDataSource* ds = frame->dataSource();
DocumentState* document_state = DocumentState::FromDataSource(ds);
@@ -2350,6 +2368,8 @@ void RenderFrameImpl::didFinishLoad(blink::WebLocalFrame* frame) {
void RenderFrameImpl::didNavigateWithinPage(blink::WebLocalFrame* frame,
const blink::WebHistoryItem& item,
blink::WebHistoryCommitType commit_type) {
+ TRACE_EVENT1("navigation", "RenderFrameImpl::didNavigateWithinPage",
+ "id", routing_id_);
DCHECK(!frame_ || frame_ == frame);
// If this was a reference fragment navigation that we initiated, then we
// could end up having a non-null pending navigation params. We just need to
@@ -3357,11 +3377,15 @@ WebElement RenderFrameImpl::GetFocusedElement() {
}
void RenderFrameImpl::didStartLoading(bool to_different_document) {
+ TRACE_EVENT1("navigation", "RenderFrameImpl::didStartLoading",
+ "id", routing_id_);
render_view_->FrameDidStartLoading(frame_);
Send(new FrameHostMsg_DidStartLoading(routing_id_, to_different_document));
}
void RenderFrameImpl::didStopLoading() {
+ TRACE_EVENT1("navigation", "RenderFrameImpl::didStopLoading",
+ "id", routing_id_);
render_view_->FrameDidStopLoading(frame_);
Send(new FrameHostMsg_DidStopLoading(routing_id_));
}
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698