diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-21 15:24:08 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-21 15:24:08 +0000 |
commit | e7e4f3c020f42dbee2d8dc74e6124d09871e358d (patch) | |
tree | 84959419ff153d777449ea30c0c75531312aa8c2 /webkit/glue | |
parent | d04e047860d1b2141af2d4712181b047dee55e67 (diff) | |
download | chromium_src-e7e4f3c020f42dbee2d8dc74e6124d09871e358d.zip chromium_src-e7e4f3c020f42dbee2d8dc74e6124d09871e358d.tar.gz chromium_src-e7e4f3c020f42dbee2d8dc74e6124d09871e358d.tar.bz2 |
- Add a new time marker for loadtimes, the time of the first layout
- Add new histograms for request -> first layout and start load -> first layout
- Remove per navigation type histograms. They weren't being used and the logic was
getting too complex.
Review URL: http://codereview.chromium.org/88015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/webdatasource.h | 3 | ||||
-rw-r--r-- | webkit/glue/webdatasource_impl.cc | 4 | ||||
-rw-r--r-- | webkit/glue/webdatasource_impl.h | 6 | ||||
-rw-r--r-- | webkit/glue/webframeloaderclient_impl.cc | 7 |
4 files changed, 20 insertions, 0 deletions
diff --git a/webkit/glue/webdatasource.h b/webkit/glue/webdatasource.h index 8ca7b1c..b0545925 100644 --- a/webkit/glue/webdatasource.h +++ b/webkit/glue/webdatasource.h @@ -114,6 +114,9 @@ class WebDataSource { // notification. virtual base::Time GetFinishLoadTime() const = 0; + // Returns the first time a layout was performed + virtual base::Time GetFirstLayoutTime() const = 0; + // Returns the reason the document was loaded. virtual WebNavigationType GetNavigationType() const = 0; }; diff --git a/webkit/glue/webdatasource_impl.cc b/webkit/glue/webdatasource_impl.cc index 13c15cc..fb1f1c2 100644 --- a/webkit/glue/webdatasource_impl.cc +++ b/webkit/glue/webdatasource_impl.cc @@ -122,6 +122,10 @@ base::Time WebDataSourceImpl::GetFinishLoadTime() const { return finish_load_time_; } +base::Time WebDataSourceImpl::GetFirstLayoutTime() const { + return first_layout_time_; +} + WebNavigationType WebDataSourceImpl::GetNavigationType() const { return NavigationTypeToWebNavigationType(triggeringAction().type()); } diff --git a/webkit/glue/webdatasource_impl.h b/webkit/glue/webdatasource_impl.h index b18482b..d4bef9c 100644 --- a/webkit/glue/webdatasource_impl.h +++ b/webkit/glue/webdatasource_impl.h @@ -42,6 +42,7 @@ class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource { virtual base::Time GetStartLoadTime() const; virtual base::Time GetFinishDocumentLoadTime() const; virtual base::Time GetFinishLoadTime() const; + virtual base::Time GetFirstLayoutTime() const; virtual WebNavigationType GetNavigationType() const; static WebNavigationType NavigationTypeToWebNavigationType( @@ -102,6 +103,10 @@ class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource { finish_load_time_ = finish_load_time; } + void set_first_layout_time(base::Time first_layout_time) { + first_layout_time_ = first_layout_time; + } + private: WebDataSourceImpl(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); @@ -129,6 +134,7 @@ class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource { base::Time start_load_time_; base::Time finish_document_load_time_; base::Time finish_load_time_; + base::Time first_layout_time_; DISALLOW_COPY_AND_ASSIGN(WebDataSourceImpl); }; diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc index e6e2c29..e9bc9dc 100644 --- a/webkit/glue/webframeloaderclient_impl.cc +++ b/webkit/glue/webframeloaderclient_impl.cc @@ -853,6 +853,13 @@ void WebFrameLoaderClient::dispatchDidFinishLoad() { void WebFrameLoaderClient::dispatchDidFirstLayout() { // FIXME: called when webkit finished layout of page. // All resources have not necessarily finished loading. + DocumentLoader* document_loader = + webframe_->frame()->loader()->documentLoader(); + WebDataSourceImpl* ds = + WebDataSourceImpl::FromLoader(document_loader); + if (ds->GetFirstLayoutTime().ToInternalValue() == 0) { + ds->set_first_layout_time(base::Time::Now()); + } } void WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout() { |