summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webdatasource_impl.h
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-03 21:39:26 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-03 21:39:26 +0000
commitc20210e6a0c40bce1781a42abf81b44ba627f2a9 (patch)
treee658b8111109145bc450603ac69cb0de3dd47eb2 /webkit/glue/webdatasource_impl.h
parent601b54022e6232875c8b24501e425b450f071217 (diff)
downloadchromium_src-c20210e6a0c40bce1781a42abf81b44ba627f2a9.zip
chromium_src-c20210e6a0c40bce1781a42abf81b44ba627f2a9.tar.gz
chromium_src-c20210e6a0c40bce1781a42abf81b44ba627f2a9.tar.bz2
- Added support for keeping track of load times.
For each document loaded we record the time the page was requested by the user (or as close as we can get to that), the time the load process started, the time the document and it's dependent resources (scripts) have been loaded (before onload()) and the time all the document's resources have been loaded. We use this data for two things: 1) We histogram the deltas between the time marks 2) We expose the times to javascript running on the page which was loaded Review URL: http://codereview.chromium.org/42527 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webdatasource_impl.h')
-rw-r--r--webkit/glue/webdatasource_impl.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/webkit/glue/webdatasource_impl.h b/webkit/glue/webdatasource_impl.h
index 4585a65..90f8313 100644
--- a/webkit/glue/webdatasource_impl.h
+++ b/webkit/glue/webdatasource_impl.h
@@ -8,6 +8,7 @@
#include "DocumentLoader.h"
#include "base/scoped_ptr.h"
+#include "base/time.h"
#include "webkit/glue/searchable_form_data.h"
#include "webkit/glue/webdatasource.h"
#include "webkit/glue/webresponse_impl.h"
@@ -20,7 +21,7 @@ class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource {
public:
static PassRefPtr<WebDataSourceImpl> Create(const WebCore::ResourceRequest&,
const WebCore::SubstituteData&);
-
+
static WebDataSourceImpl* FromLoader(WebCore::DocumentLoader* loader) {
return static_cast<WebDataSourceImpl*>(loader);
}
@@ -37,6 +38,15 @@ class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource {
virtual const PasswordForm* GetPasswordFormData() const;
virtual bool IsFormSubmit() const;
virtual string16 GetPageTitle() const;
+ virtual base::Time GetRequestTime() const;
+ virtual void SetRequestTime(base::Time time);
+ virtual base::Time GetStartLoadTime() const;
+ virtual base::Time GetFinishDocumentLoadTime() const;
+ virtual base::Time GetFinishLoadTime() const;
+ virtual WebNavigationType GetNavigationType() const;
+
+ static WebNavigationType NavigationTypeToWebNavigationType(
+ WebCore::NavigationType type);
// Called after creating a new data source if there is request info
// available. Since we store copies of the WebRequests, the original
@@ -77,6 +87,22 @@ class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource {
return form_submit_;
}
+ void set_request_time(base::Time request_time) {
+ request_time_ = request_time;
+ }
+
+ void set_start_load_time(base::Time start_load_time) {
+ start_load_time_ = start_load_time;
+ }
+
+ void set_finish_document_load_time(base::Time finish_document_load_time) {
+ finish_document_load_time_ = finish_document_load_time;
+ }
+
+ void set_finish_load_time(base::Time finish_load_time) {
+ finish_load_time_ = finish_load_time;
+ }
+
private:
WebDataSourceImpl(const WebCore::ResourceRequest&,
const WebCore::SubstituteData&);
@@ -99,6 +125,12 @@ class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource {
bool form_submit_;
+ // See webdatasource.h for a description of these time stamps.
+ base::Time request_time_;
+ base::Time start_load_time_;
+ base::Time finish_document_load_time_;
+ base::Time finish_load_time_;
+
DISALLOW_COPY_AND_ASSIGN(WebDataSourceImpl);
};