summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prerender/prerender_manager.h
diff options
context:
space:
mode:
authortburkard@chromium.org <tburkard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-07 21:58:39 +0000
committertburkard@chromium.org <tburkard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-07 21:58:39 +0000
commite253ab0e0b22dbf13ba6388945c0ccc2a1e94091 (patch)
tree06b6bdd404fb406baf255d873714f4d939d3e74e /chrome/browser/prerender/prerender_manager.h
parent49c4757170b6044fb1c8ce04486ec8aef6f886ce (diff)
downloadchromium_src-e253ab0e0b22dbf13ba6388945c0ccc2a1e94091.zip
chromium_src-e253ab0e0b22dbf13ba6388945c0ccc2a1e94091.tar.gz
chromium_src-e253ab0e0b22dbf13ba6388945c0ccc2a1e94091.tar.bz2
Updating histograms to allow for experiments & log origin-based histograms.
R=cbentzel@chromium.org, dominich@chromium.org Review URL: http://codereview.chromium.org/7289020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91765 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prerender/prerender_manager.h')
-rw-r--r--chrome/browser/prerender/prerender_manager.h45
1 files changed, 38 insertions, 7 deletions
diff --git a/chrome/browser/prerender/prerender_manager.h b/chrome/browser/prerender/prerender_manager.h
index 941b5c7..4831a40 100644
--- a/chrome/browser/prerender/prerender_manager.h
+++ b/chrome/browser/prerender/prerender_manager.h
@@ -68,6 +68,9 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
CLEAR_MAX = 0x1 << 2
};
+ // ID indicating that no experiment is active.
+ static const uint8 kNoExperiment = 0;
+
// Owned by a Profile object for the lifetime of the profile.
PrerenderManager(Profile* profile, PrerenderTracker* prerender_tracker);
@@ -181,6 +184,11 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
// Intended to be used when clearing the cache or history.
void ClearData(int clear_flags);
+ // Record a final status of a prerendered page in a histogram.
+ void RecordFinalStatus(Origin origin,
+ uint8 experiment_id,
+ FinalStatus final_status) const;
+
const Config& config() const { return config_; }
Config& mutable_config() { return config_; }
@@ -196,12 +204,6 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
PendingContentsData* FindPendingEntry(const GURL& url);
- // Extracts a urlencoded URL stored in a url= query parameter from a URL
- // supplied, if available, and stores it in alias_url. Returns whether or not
- // the operation succeeded (i.e. a valid URL was found).
- static bool MaybeGetQueryStringBasedAliasURL(const GURL& url,
- GURL* alias_url);
-
private:
// Test that needs needs access to internal functions.
friend class PrerenderBrowserTest;
@@ -252,7 +254,8 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
virtual base::TimeTicks GetCurrentTimeTicks() const;
virtual PrerenderContents* CreatePrerenderContents(const GURL& url,
const GURL& referrer,
- Origin origin);
+ Origin origin,
+ uint8 experiment_id);
// Checks if the PrerenderContents has been added to the pending delete list.
bool IsPendingDelete(PrerenderContents* entry) const;
@@ -316,6 +319,22 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
// navigates to it. This must be called on the UI thread.
void RecordTimeUntilUsed(base::TimeDelta time_until_used);
+ // Composes a histogram name based on a histogram type.
+ std::string ComposeHistogramName(const std::string& prefix_type,
+ const std::string& name) const;
+
+ // Returns the histogram name for a given origin and experiment.
+ std::string GetHistogramName(Origin origin, uint8 experiment_id,
+ const std::string& name) const;
+ // Returns the histogram name for the current window.
+ std::string GetDefaultHistogramName(const std::string& name) const;
+ // Returns the current experiment.
+ uint8 GetCurrentExperimentId() const;
+ // Returns the current origin.
+ Origin GetCurrentOrigin() const;
+ // Returns whether or not there is currently an origin/experiment wash.
+ bool IsOriginExperimentWash() const;
+
// The configuration.
Config config_;
@@ -355,6 +374,18 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
static PrerenderManagerMode mode_;
+ // An integer indicating a Prerendering Experiment being currently conducted.
+ // (The last experiment ID seen).
+ uint8 last_experiment_id_;
+
+ // Origin of the last prerender seen.
+ Origin last_origin_;
+
+ // A boolean indicating that we have recently encountered a combination of
+ // different experiments and origins, making an attribution of PPLT's to
+ // experiments / origins impossible.
+ bool origin_experiment_wash_;
+
// The time when we last saw a prerender request coming from a renderer.
// This is used to record perceived PLT's for a certain amount of time
// from the point that we last saw a <link rel=prerender> tag.