summaryrefslogtreecommitdiffstats
path: root/content/public
diff options
context:
space:
mode:
authorsimonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-17 00:34:07 +0000
committersimonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-17 00:34:07 +0000
commit007733c6493e7e3b1494c90f86a54091b05da918 (patch)
tree56cf1bb7339667b9ebafd37b37a0448bfe98021b /content/public
parent7cbd7b03328992736846cef48c049563827dcbb3 (diff)
downloadchromium_src-007733c6493e7e3b1494c90f86a54091b05da918.zip
chromium_src-007733c6493e7e3b1494c90f86a54091b05da918.tar.gz
chromium_src-007733c6493e7e3b1494c90f86a54091b05da918.tar.bz2
chrome.loadTimes() shouldn't be affected by in-document navigation.
Data that's only pertinent to initially loading the document is stored in LoadTimes. These are carried over when the NavigationState changes due to in-document navigation. I'd be interested in feedback on the position of LoadTimes. I'm not happy with it. I'd prefer to have it on WebDataSource, but I expect NavigationState was hidden in ExtraData for a reason. This also impacts PLT histograms. In-document navigation is the cause of some of the missing start types. So, by fixing this, we should get more complete page load data. There are probably whole classes of sites where we have no PLT data, such as Google Docs. BUG=79078 TEST=ui_tests Review URL: http://codereview.chromium.org/8404018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public')
-rw-r--r--content/public/renderer/document_state.cc44
-rw-r--r--content/public/renderer/document_state.h262
-rw-r--r--content/public/renderer/navigation_state.cc34
-rw-r--r--content/public/renderer/navigation_state.h252
4 files changed, 316 insertions, 276 deletions
diff --git a/content/public/renderer/document_state.cc b/content/public/renderer/document_state.cc
new file mode 100644
index 0000000..a4c22b5
--- /dev/null
+++ b/content/public/renderer/document_state.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/renderer/document_state.h"
+
+#include "content/public/renderer/navigation_state.h"
+#include "webkit/glue/alt_error_page_resource_fetcher.h"
+#include "webkit/glue/password_form.h"
+
+namespace content {
+
+DocumentState::DocumentState()
+ : load_histograms_recorded_(false),
+ web_timing_histograms_recorded_(false),
+ http_status_code_(0),
+ was_fetched_via_spdy_(false),
+ was_npn_negotiated_(false),
+ was_alternate_protocol_available_(false),
+ was_fetched_via_proxy_(false),
+ use_error_page_(false),
+ was_prefetcher_(false),
+ was_referred_by_prefetcher_(false),
+ load_type_(UNDEFINED_LOAD),
+ cache_policy_override_set_(false),
+ cache_policy_override_(WebKit::WebURLRequest::UseProtocolCachePolicy) {
+}
+
+DocumentState::~DocumentState() {}
+
+void DocumentState::set_password_form_data(webkit_glue::PasswordForm* data) {
+ password_form_data_.reset(data);
+}
+
+void DocumentState::set_alt_error_page_fetcher(
+ webkit_glue::AltErrorPageResourceFetcher* f) {
+ alt_error_page_fetcher_.reset(f);
+}
+
+void DocumentState::set_navigation_state(NavigationState* navigation_state) {
+ navigation_state_.reset(navigation_state);
+}
+
+} // namespace content
diff --git a/content/public/renderer/document_state.h b/content/public/renderer/document_state.h
new file mode 100644
index 0000000..ee6fa58
--- /dev/null
+++ b/content/public/renderer/document_state.h
@@ -0,0 +1,262 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_
+#define CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_
+#pragma once
+
+#include <string>
+
+#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/time.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h"
+
+namespace webkit_glue {
+struct PasswordForm;
+class AltErrorPageResourceFetcher;
+}
+
+namespace content {
+
+class NavigationState;
+
+// The RenderView stores an instance of this class in the "extra data" of each
+// WebDataSource (see RenderView::DidCreateDataSource).
+class DocumentState : public WebKit::WebDataSource::ExtraData {
+ public:
+ // The exact values of this enum are used in histograms, so new values must be
+ // added to the end.
+ enum LoadType {
+ UNDEFINED_LOAD, // Not yet initialized.
+ RELOAD, // User pressed reload.
+ HISTORY_LOAD, // Back or forward.
+ NORMAL_LOAD, // User entered URL, or omnibox search.
+ LINK_LOAD, // (deprecated) Included next 4 categories.
+ LINK_LOAD_NORMAL, // Commonly following of link.
+ LINK_LOAD_RELOAD, // JS/link directed reload.
+ LINK_LOAD_CACHE_STALE_OK, // back/forward or encoding change.
+ LINK_LOAD_CACHE_ONLY, // Allow stale data (avoid doing a re-post)
+ kLoadTypeMax // Bounding value for this enum.
+ };
+
+ DocumentState();
+ virtual ~DocumentState();
+
+ static DocumentState* FromDataSource(WebKit::WebDataSource* ds) {
+ return static_cast<DocumentState*>(ds->extraData());
+ }
+
+ // The time that this navigation was requested.
+ const base::Time& request_time() const {
+ return request_time_;
+ }
+ void set_request_time(const base::Time& value) {
+ DCHECK(start_load_time_.is_null());
+ request_time_ = value;
+ }
+
+ // The time that the document load started.
+ const base::Time& start_load_time() const {
+ return start_load_time_;
+ }
+ void set_start_load_time(const base::Time& value) {
+ // TODO(jar): This should not be set twice.
+ // DCHECK(!start_load_time_.is_null());
+ DCHECK(finish_document_load_time_.is_null());
+ 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_;
+ }
+ void set_finish_document_load_time(const base::Time& value) {
+ // TODO(jar): Some unittests break the following DCHECK, and don't have
+ // DCHECK(!start_load_time_.is_null());
+ DCHECK(!value.is_null());
+ // TODO(jar): Double setting does happen, but probably shouldn't.
+ // DCHECK(finish_document_load_time_.is_null());
+ // TODO(jar): We should guarantee this order :-(.
+ // DCHECK(finish_load_time_.is_null());
+ finish_document_load_time_ = value;
+ }
+
+ // The time that the document and all subresources finished loading.
+ const base::Time& finish_load_time() const { return finish_load_time_; }
+ void set_finish_load_time(const base::Time& value) {
+ DCHECK(!value.is_null());
+ DCHECK(finish_load_time_.is_null());
+ // The following is not already set in all cases :-(
+ // DCHECK(!finish_document_load_time_.is_null());
+ finish_load_time_ = value;
+ }
+
+ // The time that painting first happened after a new navigation.
+ const base::Time& first_paint_time() const { return first_paint_time_; }
+ void set_first_paint_time(const base::Time& value) {
+ first_paint_time_ = value;
+ }
+
+ // The time that painting first happened after the document loaded.
+ const base::Time& first_paint_after_load_time() const {
+ return first_paint_after_load_time_;
+ }
+ void set_first_paint_after_load_time(const base::Time& value) {
+ first_paint_after_load_time_ = value;
+ }
+
+ // True iff the histograms for the associated frame have been dumped.
+ bool load_histograms_recorded() const { return load_histograms_recorded_; }
+ void set_load_histograms_recorded(bool value) {
+ load_histograms_recorded_ = value;
+ }
+
+ bool web_timing_histograms_recorded() const {
+ return web_timing_histograms_recorded_;
+ }
+ void set_web_timing_histograms_recorded(bool value) {
+ web_timing_histograms_recorded_ = value;
+ }
+
+ int http_status_code() const { return http_status_code_; }
+ void set_http_status_code(int http_status_code) {
+ http_status_code_ = http_status_code;
+ }
+
+ // Indicator if SPDY was used as part of this page load.
+ void set_was_fetched_via_spdy(bool value) { was_fetched_via_spdy_ = value; }
+ bool was_fetched_via_spdy() const { return was_fetched_via_spdy_; }
+
+ void set_was_npn_negotiated(bool value) { was_npn_negotiated_ = value; }
+ bool was_npn_negotiated() const { return was_npn_negotiated_; }
+
+ void set_was_alternate_protocol_available(bool value) {
+ was_alternate_protocol_available_ = value;
+ }
+ bool was_alternate_protocol_available() const {
+ return was_alternate_protocol_available_;
+ }
+
+ void set_was_fetched_via_proxy(bool value) {
+ was_fetched_via_proxy_ = value;
+ }
+ bool was_fetched_via_proxy() const { return was_fetched_via_proxy_; }
+
+ const GURL& searchable_form_url() const { return searchable_form_url_; }
+ void set_searchable_form_url(const GURL& url) { searchable_form_url_ = url; }
+ const std::string& searchable_form_encoding() const {
+ return searchable_form_encoding_;
+ }
+ void set_searchable_form_encoding(const std::string& encoding) {
+ searchable_form_encoding_ = encoding;
+ }
+
+ webkit_glue::PasswordForm* password_form_data() const {
+ return password_form_data_.get();
+ }
+ void set_password_form_data(webkit_glue::PasswordForm* data);
+
+ const std::string& security_info() const { return security_info_; }
+ void set_security_info(const std::string& security_info) {
+ security_info_ = security_info;
+ }
+
+ // True if an error page should be used, if the http status code also
+ // indicates an error.
+ bool use_error_page() const { return use_error_page_; }
+ void set_use_error_page(bool use_error_page) {
+ use_error_page_ = use_error_page;
+ }
+
+ void set_was_prefetcher(bool value) { was_prefetcher_ = value; }
+ bool was_prefetcher() const { return was_prefetcher_; }
+
+ void set_was_referred_by_prefetcher(bool value) {
+ was_referred_by_prefetcher_ = value;
+ }
+ bool was_referred_by_prefetcher() const {
+ return was_referred_by_prefetcher_;
+ }
+
+ // Record the nature of this load, for use when histogramming page load times.
+ LoadType load_type() const { return load_type_; }
+ void set_load_type(LoadType load_type) { load_type_ = load_type; }
+
+ // Sets the cache policy. The cache policy is only used if explicitly set and
+ // by default is not set. You can mark a NavigationState as not having a cache
+ // state by way of clear_cache_policy_override.
+ void set_cache_policy_override(
+ WebKit::WebURLRequest::CachePolicy cache_policy) {
+ cache_policy_override_ = cache_policy;
+ cache_policy_override_set_ = true;
+ }
+ WebKit::WebURLRequest::CachePolicy cache_policy_override() const {
+ return cache_policy_override_;
+ }
+ void clear_cache_policy_override() {
+ cache_policy_override_set_ = false;
+ cache_policy_override_ = WebKit::WebURLRequest::UseProtocolCachePolicy;
+ }
+ bool is_cache_policy_override_set() const {
+ return cache_policy_override_set_;
+ }
+
+ webkit_glue::AltErrorPageResourceFetcher* alt_error_page_fetcher() const {
+ return alt_error_page_fetcher_.get();
+ }
+ void set_alt_error_page_fetcher(webkit_glue::AltErrorPageResourceFetcher* f);
+
+ NavigationState* navigation_state() { return navigation_state_.get(); }
+ void set_navigation_state(NavigationState* navigation_state);
+
+ private:
+ 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_paint_after_load_time_;
+ bool load_histograms_recorded_;
+ bool web_timing_histograms_recorded_;
+ int http_status_code_;
+ bool was_fetched_via_spdy_;
+ bool was_npn_negotiated_;
+ bool was_alternate_protocol_available_;
+ bool was_fetched_via_proxy_;
+
+ GURL searchable_form_url_;
+ std::string searchable_form_encoding_;
+ scoped_ptr<webkit_glue::PasswordForm> password_form_data_;
+ std::string security_info_;
+
+ bool use_error_page_;
+
+ // A prefetcher is a page that contains link rel=prefetch elements.
+ bool was_prefetcher_;
+ bool was_referred_by_prefetcher_;
+
+ LoadType load_type_;
+
+ bool cache_policy_override_set_;
+ WebKit::WebURLRequest::CachePolicy cache_policy_override_;
+
+ scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_;
+
+ scoped_ptr<NavigationState> navigation_state_;
+};
+
+#endif // CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_
+
+} // namespace content
diff --git a/content/public/renderer/navigation_state.cc b/content/public/renderer/navigation_state.cc
index c461835..b69518f 100644
--- a/content/public/renderer/navigation_state.cc
+++ b/content/public/renderer/navigation_state.cc
@@ -4,48 +4,20 @@
#include "content/public/renderer/navigation_state.h"
-#include "webkit/glue/alt_error_page_resource_fetcher.h"
-#include "webkit/glue/password_form.h"
-
namespace content {
-NavigationState::~NavigationState() {}
-
-void NavigationState::set_password_form_data(webkit_glue::PasswordForm* data) {
- password_form_data_.reset(data);
-}
-
-void NavigationState::set_alt_error_page_fetcher(
- webkit_glue::AltErrorPageResourceFetcher* f) {
- alt_error_page_fetcher_.reset(f);
-}
-
NavigationState::NavigationState(content::PageTransition transition_type,
- const base::Time& request_time,
bool is_content_initiated,
int32 pending_page_id,
int pending_history_list_offset)
: transition_type_(transition_type),
- load_type_(UNDEFINED_LOAD),
- request_time_(request_time),
- load_histograms_recorded_(false),
- web_timing_histograms_recorded_(false),
request_committed_(false),
is_content_initiated_(is_content_initiated),
pending_page_id_(pending_page_id),
pending_history_list_offset_(pending_history_list_offset),
- use_error_page_(false),
- cache_policy_override_set_(false),
- cache_policy_override_(WebKit::WebURLRequest::UseProtocolCachePolicy),
- http_status_code_(0),
- was_fetched_via_spdy_(false),
- was_npn_negotiated_(false),
- was_alternate_protocol_available_(false),
- was_fetched_via_proxy_(false),
- was_translated_(false),
- was_within_same_page_(false),
- was_prefetcher_(false),
- was_referred_by_prefetcher_(false) {
+ was_within_same_page_(false) {
}
+NavigationState::~NavigationState() {}
+
} // namespace content
diff --git a/content/public/renderer/navigation_state.h b/content/public/renderer/navigation_state.h
index 30ccd01..efdcac1 100644
--- a/content/public/renderer/navigation_state.h
+++ b/content/public/renderer/navigation_state.h
@@ -6,61 +6,27 @@
#define CONTENT_PUBLIC_RENDERER_NAVIGATION_STATE_H_
#pragma once
-#include <string>
-
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/time.h"
#include "content/public/common/page_transition_types.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h"
-
-namespace webkit_glue {
-struct PasswordForm;
-class AltErrorPageResourceFetcher;
-}
namespace content {
-// The RenderView stores an instance of this class in the "extra data" of each
-// WebDataSource (see RenderView::DidCreateDataSource).
-class NavigationState : public WebKit::WebDataSource::ExtraData {
+// NavigationState is the portion of DocumentState that is affected by
+// in-document navigation.
+// TODO(simonjam): Move this to HistoryItem's ExtraData.
+class NavigationState {
public:
- // The exact values of this enum are used in histograms, so new values must be
- // added to the end.
- enum LoadType {
- UNDEFINED_LOAD, // Not yet initialized.
- RELOAD, // User pressed reload.
- HISTORY_LOAD, // Back or forward.
- NORMAL_LOAD, // User entered URL, or omnibox search.
- LINK_LOAD, // (deprecated) Included next 4 categories.
- LINK_LOAD_NORMAL, // Commonly following of link.
- LINK_LOAD_RELOAD, // JS/link directed reload.
- LINK_LOAD_CACHE_STALE_OK, // back/forward or encoding change.
- LINK_LOAD_CACHE_ONLY, // Allow stale data (avoid doing a re-post)
- kLoadTypeMax // Bounding value for this enum.
- };
-
virtual ~NavigationState();
static NavigationState* CreateBrowserInitiated(
int32 pending_page_id,
int pending_history_list_offset,
- content::PageTransition transition_type,
- base::Time request_time) {
- return new NavigationState(transition_type, request_time, false,
- pending_page_id,
+ content::PageTransition transition_type) {
+ return new NavigationState(transition_type, false, pending_page_id,
pending_history_list_offset);
}
static NavigationState* CreateContentInitiated() {
- // We assume navigations initiated by content are link clicks.
- return new NavigationState(
- content::PAGE_TRANSITION_LINK, base::Time(), true, -1, -1);
- }
-
- static NavigationState* FromDataSource(WebKit::WebDataSource* ds) {
- return static_cast<NavigationState*>(ds->extraData());
+ return new NavigationState(content::PAGE_TRANSITION_LINK, true, -1, -1);
}
// Contains the page_id for this navigation or -1 if there is none yet.
@@ -79,90 +45,6 @@ class NavigationState : public WebKit::WebDataSource::ExtraData {
transition_type_ = type;
}
- // Record the nature of this load, for use when histogramming page load times.
- LoadType load_type() const { return load_type_; }
- void set_load_type(LoadType load_type) { load_type_ = load_type; }
-
- // The time that this navigation was requested.
- const base::Time& request_time() const {
- return request_time_;
- }
- void set_request_time(const base::Time& value) {
- DCHECK(start_load_time_.is_null());
- request_time_ = value;
- }
-
- // The time that the document load started.
- const base::Time& start_load_time() const {
- return start_load_time_;
- }
- void set_start_load_time(const base::Time& value) {
- // TODO(jar): This should not be set twice.
- // DCHECK(!start_load_time_.is_null());
- DCHECK(finish_document_load_time_.is_null());
- 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_;
- }
- void set_finish_document_load_time(const base::Time& value) {
- // TODO(jar): Some unittests break the following DCHECK, and don't have
- // DCHECK(!start_load_time_.is_null());
- DCHECK(!value.is_null());
- // TODO(jar): Double setting does happen, but probably shouldn't.
- // DCHECK(finish_document_load_time_.is_null());
- // TODO(jar): We should guarantee this order :-(.
- // DCHECK(finish_load_time_.is_null());
- finish_document_load_time_ = value;
- }
-
- // The time that the document and all subresources finished loading.
- const base::Time& finish_load_time() const { return finish_load_time_; }
- void set_finish_load_time(const base::Time& value) {
- DCHECK(!value.is_null());
- DCHECK(finish_load_time_.is_null());
- // The following is not already set in all cases :-(
- // DCHECK(!finish_document_load_time_.is_null());
- finish_load_time_ = value;
- }
-
- // The time that painting first happened after a new navigation.
- const base::Time& first_paint_time() const { return first_paint_time_; }
- void set_first_paint_time(const base::Time& value) {
- first_paint_time_ = value;
- }
-
- // The time that painting first happened after the document finished loading.
- const base::Time& first_paint_after_load_time() const {
- return first_paint_after_load_time_;
- }
- void set_first_paint_after_load_time(const base::Time& value) {
- first_paint_after_load_time_ = value;
- }
-
- // True iff the histograms for the associated frame have been dumped.
- bool load_histograms_recorded() const { return load_histograms_recorded_; }
- void set_load_histograms_recorded(bool value) {
- load_histograms_recorded_ = value;
- }
-
- bool web_timing_histograms_recorded() const {
- return web_timing_histograms_recorded_;
- }
- void set_web_timing_histograms_recorded(bool value) {
- web_timing_histograms_recorded_ = value;
- }
-
// True if we have already processed the "DidCommitLoad" event for this
// request. Used by session history.
bool request_committed() const { return request_committed_; }
@@ -171,144 +53,24 @@ class NavigationState : public WebKit::WebDataSource::ExtraData {
// True if this navigation was not initiated via WebFrame::LoadRequest.
bool is_content_initiated() const { return is_content_initiated_; }
- const GURL& searchable_form_url() const { return searchable_form_url_; }
- void set_searchable_form_url(const GURL& url) { searchable_form_url_ = url; }
- const std::string& searchable_form_encoding() const {
- return searchable_form_encoding_;
- }
- void set_searchable_form_encoding(const std::string& encoding) {
- searchable_form_encoding_ = encoding;
- }
-
- webkit_glue::PasswordForm* password_form_data() const {
- return password_form_data_.get();
- }
- void set_password_form_data(webkit_glue::PasswordForm* data);
-
- webkit_glue::AltErrorPageResourceFetcher* alt_error_page_fetcher() const {
- return alt_error_page_fetcher_.get();
- }
- void set_alt_error_page_fetcher(webkit_glue::AltErrorPageResourceFetcher* f);
-
- const std::string& security_info() const { return security_info_; }
- void set_security_info(const std::string& security_info) {
- security_info_ = security_info;
- }
-
- // True if an error page should be used, if the http status code also
- // indicates an error.
- bool use_error_page() const { return use_error_page_; }
- void set_use_error_page(bool use_error_page) {
- use_error_page_ = use_error_page;
- }
-
- int http_status_code() const { return http_status_code_; }
- void set_http_status_code(int http_status_code) {
- http_status_code_ = http_status_code;
- }
-
- // Sets the cache policy. The cache policy is only used if explicitly set and
- // by default is not set. You can mark a NavigationState as not having a cache
- // state by way of clear_cache_policy_override.
- void set_cache_policy_override(
- WebKit::WebURLRequest::CachePolicy cache_policy) {
- cache_policy_override_ = cache_policy;
- cache_policy_override_set_ = true;
- }
- WebKit::WebURLRequest::CachePolicy cache_policy_override() const {
- return cache_policy_override_;
- }
- void clear_cache_policy_override() {
- cache_policy_override_set_ = false;
- cache_policy_override_ = WebKit::WebURLRequest::UseProtocolCachePolicy;
- }
- bool is_cache_policy_override_set() const {
- return cache_policy_override_set_;
- }
-
- // Indicator if SPDY was used as part of this page load.
- void set_was_fetched_via_spdy(bool value) { was_fetched_via_spdy_ = value; }
- bool was_fetched_via_spdy() const { return was_fetched_via_spdy_; }
-
- void set_was_npn_negotiated(bool value) { was_npn_negotiated_ = value; }
- bool was_npn_negotiated() const { return was_npn_negotiated_; }
-
- void set_was_alternate_protocol_available(bool value) {
- was_alternate_protocol_available_ = value;
- }
- bool was_alternate_protocol_available() const {
- return was_alternate_protocol_available_;
- }
-
- void set_was_fetched_via_proxy(bool value) {
- was_fetched_via_proxy_ = value;
- }
- bool was_fetched_via_proxy() const { return was_fetched_via_proxy_; }
-
- // Whether the frame text contents was translated to a different language.
- void set_was_translated(bool value) { was_translated_ = value; }
- bool was_translated() const { return was_translated_; }
-
// True iff the frame's navigation was within the same page.
void set_was_within_same_page(bool value) { was_within_same_page_ = value; }
bool was_within_same_page() const { return was_within_same_page_; }
- void set_was_prefetcher(bool value) { was_prefetcher_ = value; }
- bool was_prefetcher() const { return was_prefetcher_; }
-
- void set_was_referred_by_prefetcher(bool value) {
- was_referred_by_prefetcher_ = value;
- }
- bool was_referred_by_prefetcher() const {
- return was_referred_by_prefetcher_;
- }
-
private:
NavigationState(content::PageTransition transition_type,
- const base::Time& request_time,
bool is_content_initiated,
int32 pending_page_id,
int pending_history_list_offset);
content::PageTransition transition_type_;
- LoadType load_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_paint_after_load_time_;
- bool load_histograms_recorded_;
- bool web_timing_histograms_recorded_;
bool request_committed_;
bool is_content_initiated_;
int32 pending_page_id_;
int pending_history_list_offset_;
- GURL searchable_form_url_;
- std::string searchable_form_encoding_;
- scoped_ptr<webkit_glue::PasswordForm> password_form_data_;
- scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_;
- std::string security_info_;
- bool use_error_page_;
-
- bool cache_policy_override_set_;
- WebKit::WebURLRequest::CachePolicy cache_policy_override_;
-
- int http_status_code_;
-
- bool was_fetched_via_spdy_;
- bool was_npn_negotiated_;
- bool was_alternate_protocol_available_;
- bool was_fetched_via_proxy_;
- bool was_translated_;
bool was_within_same_page_;
- // A prefetcher is a page that contains link rel=prefetch elements.
- bool was_prefetcher_;
- bool was_referred_by_prefetcher_;
-
DISALLOW_COPY_AND_ASSIGN(NavigationState);
};