Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: benchmarks/run.html

Issue 155496: Third and hopefully last of thrre CLs to issue a warning when an older... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | benchmarks/style.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: benchmarks/run.html
===================================================================
--- benchmarks/run.html (revision 2457)
+++ benchmarks/run.html (working copy)
@@ -55,9 +55,35 @@
NotifyScore: AddScore });
}
+function ShowWarningIfObsolete() {
Lasse Reichstein 2009/07/14 14:30:46 It might not be worth it to do this check if the b
+ // If anything goes wrong we will just catch the exception and no
+ // warning is shown, i.e., no harm is done.
+ try {
+ var xmlhttp;
+ var next_version = parseInt(BenchmarkSuite.version) + 1;
+ var next_version_url = "../v" + next_version + "/run.html";
+ if (window.XMLHttpRequest) {
Lasse Reichstein 2009/07/14 14:30:46 I recommend using if (typeof XMLHttpRequest != "u
+ xmlhttp = new window.XMLHttpRequest();
Lasse Reichstein 2009/07/14 14:30:46 You can drop the "window." in front.
+ } else if (window.ActiveXObject) {
Lasse Reichstein 2009/07/14 14:30:46 Drop this test completely. If it fails, there is n
+ xmlhttp = new window.ActiveXObject("Microsoft.XMLHTTP");
+ }
+ xmlhttp.open('GET', next_version_url, true);
Lasse Reichstein 2009/07/14 14:30:46 The third parameter makes the request asynchroneou
+ xmlhttp.onreadystatechange = function() {
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
+ document.getElementById('obsolete').style.display="block";
+ }
+ };
+ xmlhttp.send(null);
+ } catch(e) {
+ // Ignore exception if check for next version fails.
+ // Hence no warning is displayed.
+ }
+}
+
function Load() {
var version = BenchmarkSuite.version;
document.getElementById("version").innerHTML = version;
+ ShowWarningIfObsolete();
setTimeout(Run, 200);
}
</script>
@@ -65,6 +91,12 @@
<body onload="Load()">
<div>
<div class="title"><h1>V8 Benchmark Suite - version <span id="version">?</span></h1></div>
+ <div class="warning" id="obsolete">
+Warning! This is not the latest version of V8 benchmark
+suite. Consider running the
+<a href="http://v8.googlecode.com/svn/data/benchmarks/current/run.html">
+latest version</a>.
+ </div>
<table>
<tr>
<td class="contents">
« no previous file with comments | « no previous file | benchmarks/style.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698