summaryrefslogtreecommitdiffstats
path: root/tools/page_cycler
diff options
context:
space:
mode:
authorchase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-20 23:19:33 +0000
committerchase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-20 23:19:33 +0000
commit2ee2da82416e6976b8f41b9a41549bfa128a0e09 (patch)
treef85a683ae7996e44e25d8d4b5a6fb103ff5de765 /tools/page_cycler
parentd4e3ac8dcfc9d5cef0cb2e762ee3415d214844b8 (diff)
downloadchromium_src-2ee2da82416e6976b8f41b9a41549bfa128a0e09.zip
chromium_src-2ee2da82416e6976b8f41b9a41549bfa128a0e09.tar.gz
chromium_src-2ee2da82416e6976b8f41b9a41549bfa128a0e09.tar.bz2
Changed page_cycler to use sessionStorage instead of cookies for timing values.
Review URL: http://codereview.chromium.org/3145006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56932 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/page_cycler')
-rw-r--r--tools/page_cycler/common/head.js25
1 files changed, 18 insertions, 7 deletions
diff --git a/tools/page_cycler/common/head.js b/tools/page_cycler/common/head.js
index 1a4ddc84..f63a56c 100644
--- a/tools/page_cycler/common/head.js
+++ b/tools/page_cycler/common/head.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -50,10 +50,20 @@ function __pages() { // fetch lazily
return this.data;
}
function __get_timings() {
- return __get_cookie("__pc_timings");
+ if (sessionStorage == null)
+ return __get_cookie("__pc_timings");
+ else {
+ if (sessionStorage.getItem("__pc_timings") == null)
+ return "";
+ else
+ return sessionStorage["__pc_timings"];
+ }
}
function __set_timings(timings) {
- document.cookie = "__pc_timings=" + timings + "; path=/";
+ if (sessionStorage == null)
+ document.cookie = "__pc_timings=" + timings + "; path=/";
+ else
+ sessionStorage["__pc_timings"]=timings;
}
function __ontimeout() {
var doc;
@@ -74,15 +84,16 @@ function __ontimeout() {
} else {
doc = "../" + __pages()[__page] + "/index.html"
}
-
+
var timings = __tl;
var oldTimings = __get_timings();
- if (oldTimings != "") {
+ if (oldTimings != "") {
timings = oldTimings + "," + timings;
}
__set_timings(timings);
-
- var url = doc + "?n=" + __iterations + "&i=" + __cycle + "&p=" + __page + "&ts=" + ts + "&td=" + __td + "&tf=" + __tf;
+
+ var url = doc + "?n=" + __iterations + "&i=" + __cycle + "&p=" + __page +
+ "&ts=" + ts + "&td=" + __td + "&tf=" + __tf;
document.location.href = url;
}
function __onload() {