diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 16:39:01 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 16:39:01 +0000 |
commit | 41da4799559e2e8c2b8434dc74bee5f1fa030dc1 (patch) | |
tree | b94bb0690f2a306c70944e0cf6a8f76015857796 /chrome/renderer | |
parent | d371c0d2acecbe92f475c8332ab8e19e56e3f1b1 (diff) | |
download | chromium_src-41da4799559e2e8c2b8434dc74bee5f1fa030dc1.zip chromium_src-41da4799559e2e8c2b8434dc74bee5f1fa030dc1.tar.gz chromium_src-41da4799559e2e8c2b8434dc74bee5f1fa030dc1.tar.bz2 |
Reverting 19361.
tbr=darin
Review URL: http://codereview.chromium.org/149081
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19368 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/loadtimes_extension_bindings.cc | 16 | ||||
-rw-r--r-- | chrome/renderer/navigation_state.h | 21 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 80 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 3 | ||||
-rw-r--r-- | chrome/renderer/render_widget.cc | 3 | ||||
-rw-r--r-- | chrome/renderer/render_widget.h | 4 |
6 files changed, 38 insertions, 89 deletions
diff --git a/chrome/renderer/loadtimes_extension_bindings.cc b/chrome/renderer/loadtimes_extension_bindings.cc index 5a65af7..4b800a7 100644 --- a/chrome/renderer/loadtimes_extension_bindings.cc +++ b/chrome/renderer/loadtimes_extension_bindings.cc @@ -29,10 +29,10 @@ class LoadTimesExtensionWrapper : public v8::Extension { // navigationType: A string describing what user action initiated the load LoadTimesExtensionWrapper() : v8::Extension(kLoadTimesExtensionName, - "var chrome;" - "if (!chrome)" - " chrome = {};" - "chrome.GetLoadTimes = function() {" + "var chromium;" + "if (!chromium)" + " chromium = {};" + "chromium.GetLoadTimes = function() {" " native function GetLoadTimes();" " return GetLoadTimes();" "}") {} @@ -78,9 +78,6 @@ class LoadTimesExtensionWrapper : public v8::Extension { v8::String::New("startLoadTime"), v8::Number::New(navigation_state->start_load_time().ToDoubleT())); load_times->Set( - v8::String::New("commitLoadTime"), - v8::Number::New(navigation_state->commit_load_time().ToDoubleT())); - load_times->Set( v8::String::New("finishDocumentLoadTime"), v8::Number::New( navigation_state->finish_document_load_time().ToDoubleT())); @@ -88,12 +85,11 @@ class LoadTimesExtensionWrapper : public v8::Extension { v8::String::New("finishLoadTime"), v8::Number::New(navigation_state->finish_load_time().ToDoubleT())); load_times->Set( - v8::String::New("firstPaintTime"), - v8::Number::New(navigation_state->first_paint_time().ToDoubleT())); + v8::String::New("firstLayoutTime"), + v8::Number::New(navigation_state->first_layout_time().ToDoubleT())); load_times->Set( v8::String::New("navigationType"), v8::String::New(GetNavigationType(data_source->navigationType()))); - return load_times; } } diff --git a/chrome/renderer/navigation_state.h b/chrome/renderer/navigation_state.h index 46c17f3..7d6aed5 100644 --- a/chrome/renderer/navigation_state.h +++ b/chrome/renderer/navigation_state.h @@ -54,7 +54,7 @@ class NavigationState : public WebKit::WebDataSource::ExtraData { request_time_ = value; } - // The time that the document load started. + // The time that this navigation actually started. const base::Time& start_load_time() const { return start_load_time_; } @@ -62,14 +62,6 @@ class NavigationState : public WebKit::WebDataSource::ExtraData { start_load_time_ = value; } - // The time that the document load was committed. - const base::Time& commit_load_time() const { - return commit_load_time_; - } - void set_commit_load_time(const base::Time& value) { - commit_load_time_ = value; - } - // The time that the document finished loading. const base::Time& finish_document_load_time() const { return finish_document_load_time_; @@ -87,11 +79,11 @@ class NavigationState : public WebKit::WebDataSource::ExtraData { } // The time that layout first ran after a new navigation. - const base::Time& first_paint_time() const { - return first_paint_time_; + const base::Time& first_layout_time() const { + return first_layout_time_; } - void set_first_paint_time(const base::Time& value) { - first_paint_time_ = value; + void set_first_layout_time(const base::Time& value) { + first_layout_time_ = value; } // True if we have already processed the "DidCommitLoad" event for this @@ -131,10 +123,9 @@ class NavigationState : public WebKit::WebDataSource::ExtraData { PageTransition::Type transition_type_; base::Time request_time_; base::Time start_load_time_; - base::Time commit_load_time_; base::Time finish_document_load_time_; base::Time finish_load_time_; - base::Time first_paint_time_; + base::Time first_layout_time_; bool request_committed_; bool is_content_initiated_; int32 pending_page_id_; diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 7a2e29e..a164d10 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -1063,22 +1063,6 @@ void RenderView::DidCreateDataSource(WebFrame* frame, WebDataSource* ds) { } } -void RenderView::DidPaint() { - WebFrame* main_frame = webview()->GetMainFrame(); - - if (main_frame->GetProvisionalDataSource()) { - // If we have a provisional frame we are between the start - // and commit stages of loading...ignore this paint. - return; - } - - WebDataSource* ds = main_frame->GetDataSource(); - NavigationState* navigation_state = NavigationState::FromDataSource(ds); - if (navigation_state->first_paint_time().is_null()) { - navigation_state->set_first_paint_time(Time::Now()); - } -} - void RenderView::DidStartProvisionalLoadForFrame( WebView* webview, WebFrame* frame, @@ -1245,7 +1229,6 @@ void RenderView::DidCommitLoadForFrame(WebView *webview, WebFrame* frame, NavigationState* navigation_state = NavigationState::FromDataSource(frame->GetDataSource()); - navigation_state->set_commit_load_time(Time::Now()); if (is_new_navigation) { // When we perform a new navigation, we need to update the previous session // history entry with state for the page we are leaving. @@ -1305,9 +1288,6 @@ void RenderView::DidReceiveTitle(WebView* webview, } void RenderView::DidFinishLoadForFrame(WebView* webview, WebFrame* frame) { - WebDataSource* ds = frame->GetDataSource(); - NavigationState* navigation_state = NavigationState::FromDataSource(ds); - navigation_state->set_finish_load_time(Time::Now()); if (webview->GetMainFrame() == frame) { const GURL& url = frame->GetURL(); if (url.SchemeIs("http") || url.SchemeIs("https")) @@ -1325,10 +1305,6 @@ void RenderView::DidFailLoadWithError(WebView* webview, void RenderView::DidFinishDocumentLoadForFrame(WebView* webview, WebFrame* frame) { - WebDataSource* ds = frame->GetDataSource(); - NavigationState* navigation_state = NavigationState::FromDataSource(ds); - navigation_state->set_finish_document_load_time(Time::Now()); - Send(new ViewHostMsg_DocumentLoadedInFrame(routing_id_)); // The document has now been fully loaded. Scan for password forms to be @@ -1771,6 +1747,8 @@ WebPluginDelegate* RenderView::CreatePluginDelegate( if (!proxy) return NULL; + // We hold onto the proxy so we can poke it when we are painting. See our + // DidPaint implementation below. plugin_delegates_.push_back(proxy); return proxy; @@ -2787,23 +2765,21 @@ void RenderView::OnExtensionResponse(int request_id, // Dump all load time histograms. // -// There are 8 histograms measuring various times. +// There are 7 histograms measuring various times. // The time points we keep are // request: time document was requested by user // start: time load of document started -// commit: time load of document started // finishDoc: main document loaded, before onload() // finish: after onload() and all resources are loaded // firstLayout: first layout performed // The times that we histogram are -// request->start, -// request->commit, -// request->finish, -// request->firstPaint -// start->finishDoc, -// commit->finish, -// commit->firstPaint -// finishDoc->finish, +// requestToStart, +// startToFinishDoc, +// finishDocToFinish, +// startToFinish, +// requestToFinish, +// requestToFirstLayout +// startToFirstLayout // // It's possible for the request time not to be set, if a client // redirect had been done (the user never requested the page) @@ -2816,43 +2792,39 @@ void RenderView::DumpLoadHistograms() const { Time request_time = navigation_state->request_time(); Time start_load_time = navigation_state->start_load_time(); - Time commit_load_time = navigation_state->commit_load_time(); Time finish_document_load_time = navigation_state->finish_document_load_time(); Time finish_load_time = navigation_state->finish_load_time(); - Time first_paint_time = navigation_state->first_paint_time(); + Time first_layout_time = navigation_state->first_layout_time(); TimeDelta request_to_start = start_load_time - request_time; - TimeDelta request_to_commit = commit_load_time - request_time; - TimeDelta commit_to_finish_doc = finish_document_load_time - commit_load_time; + TimeDelta start_to_finish_doc = finish_document_load_time - start_load_time; TimeDelta finish_doc_to_finish = finish_load_time - finish_document_load_time; - TimeDelta commit_to_finish = finish_load_time - commit_load_time; + TimeDelta start_to_finish = finish_load_time - start_load_time; TimeDelta request_to_finish = finish_load_time - request_time; - TimeDelta request_to_first_paint = first_paint_time - request_time; - TimeDelta commit_to_first_paint = first_paint_time - commit_load_time; + TimeDelta request_to_first_layout = first_layout_time - request_time; + TimeDelta start_to_first_layout = first_layout_time - start_load_time; // Client side redirects will have no request time if (request_time.ToInternalValue() != 0) { - UMA_HISTOGRAM_MEDIUM_TIMES("Renderer3.RequestToStart", request_to_start); - UMA_HISTOGRAM_MEDIUM_TIMES("Renderer3.RequestToCommit", request_to_commit); + UMA_HISTOGRAM_MEDIUM_TIMES("Renderer2.RequestToStart", request_to_start); UMA_HISTOGRAM_CUSTOM_TIMES( - FieldTrial::MakeName("Renderer3.RequestToFinish_2", "DnsImpact").data(), + FieldTrial::MakeName("Renderer2.RequestToFinish_2", "DnsImpact").data(), request_to_finish, TimeDelta::FromMilliseconds(10), TimeDelta::FromMinutes(10), 100); - if (request_to_first_paint.ToInternalValue() >= 0) { - UMA_HISTOGRAM_MEDIUM_TIMES("Renderer3.RequestToFirstPaint", - request_to_first_paint); + if (request_to_first_layout.ToInternalValue() >= 0) { + UMA_HISTOGRAM_MEDIUM_TIMES("Renderer2.RequestToFirstLayout", + request_to_first_layout); } } - UMA_HISTOGRAM_MEDIUM_TIMES("Renderer3.CommitToFinishDoc", - commit_to_finish_doc); - UMA_HISTOGRAM_MEDIUM_TIMES("Renderer3.FinishDocToFinish", + UMA_HISTOGRAM_MEDIUM_TIMES("Renderer2.StartToFinishDoc", start_to_finish_doc); + UMA_HISTOGRAM_MEDIUM_TIMES("Renderer2.FinishDocToFinish", finish_doc_to_finish); - UMA_HISTOGRAM_MEDIUM_TIMES("Renderer3.CommitToFinish", commit_to_finish); - if (commit_to_first_paint.ToInternalValue() >= 0) { - UMA_HISTOGRAM_MEDIUM_TIMES("Renderer3.CommitToFirstPaint", - commit_to_first_paint); + UMA_HISTOGRAM_MEDIUM_TIMES("Renderer2.StartToFinish", start_to_finish); + if (start_to_first_layout.ToInternalValue() >= 0) { + UMA_HISTOGRAM_MEDIUM_TIMES("Renderer2.StartToFirstLayout", + start_to_first_layout); } } diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 4b7311f..8a65ebb 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -373,9 +373,6 @@ class RenderView : public RenderWidget, virtual void OnResize(const gfx::Size& new_size, const gfx::Rect& resizer_rect); - // RenderWidget override - virtual void DidPaint(); - private: // For unit tests. friend class RenderViewTest; diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 2b359d4..5b9e0c3 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -247,9 +247,6 @@ void RenderWidget::OnPaintRectAck() { current_paint_buf_ = NULL; } - // Notify subclasses - DidPaint(); - // Continue painting if necessary... DoDeferredPaint(); } diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h index fe69433..440a7e2 100644 --- a/chrome/renderer/render_widget.h +++ b/chrome/renderer/render_widget.h @@ -148,10 +148,6 @@ class RenderWidget : public IPC::Channel::Listener, void OnMsgRepaint(const gfx::Size& size_to_paint); void OnSetTextDirection(int direction); - // Override point to notify that a paint has happened. This fires after the - // browser side has updated the screen for a newly painted region. - virtual void DidPaint() {} - // True if a PaintRect_ACK message is pending. bool paint_reply_pending() const { return paint_reply_pending_; |