diff options
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() { |