diff options
author | chase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 00:38:06 +0000 |
---|---|---|
committer | chase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 00:38:06 +0000 |
commit | 8aa8d639884f8dd3b10454df6d44d97575b1cd34 (patch) | |
tree | 5d8548bc36bed84d3eec4e534d8e2ef83b176f29 /tools/page_cycler | |
parent | 43a3e74e0cb975dd629df2a14a21c393fd6ade65 (diff) | |
download | chromium_src-8aa8d639884f8dd3b10454df6d44d97575b1cd34.zip chromium_src-8aa8d639884f8dd3b10454df6d44d97575b1cd34.tar.gz chromium_src-8aa8d639884f8dd3b10454df6d44d97575b1cd34.tar.bz2 |
Update database head.js to use sessionStorage.
BUG=68660
TEST=database page cycler goes green
Review URL: http://codereview.chromium.org/6057009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/page_cycler')
-rw-r--r-- | tools/page_cycler/database/head.js | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/tools/page_cycler/database/head.js b/tools/page_cycler/database/head.js index fedacec..4694a9c 100644 --- a/tools/page_cycler/database/head.js +++ b/tools/page_cycler/database/head.js @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// 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. @@ -27,20 +27,21 @@ function getPropertyValue(name) { return ''; } -/** - * Returns the value of the '__pc_timings' property. - * @return {string} The list of all timings we got so far. - */ -function getTimings() { - return getPropertyValue('__pc_timings'); +function __get_timings() { + if (sessionStorage == null) + return __get_cookie("__pc_timings"); + else { + if (sessionStorage.getItem("__pc_timings") == null) + return ""; + else + return sessionStorage["__pc_timings"]; + } } - -/** - * Sets the value of the '__pc_timings' property in the cookie. - * @param {string} timings A comma-separated list of timings. - */ -function setTimings(timings) { - document.cookie = '__pc_timings=' + timings + '; path=/'; +function __set_timings(timings) { + if (sessionStorage == null) + document.cookie = "__pc_timings=" + timings + "; path=/"; + else + sessionStorage["__pc_timings"]=timings; } /** @@ -66,10 +67,10 @@ function nextCycleOrResults() { } var timings = elapsedTime; - var oldTimings = getTimings(); + var oldTimings = __get_timings(); if (oldTimings != '') timings = oldTimings + ',' + timings; - setTimings(timings); + __set_timings(timings); var url = doc + '?n=' + iterations + '&i=' + cycle + '&td=' + totalTime + '&tf=' + fudgeTime; |