Title: [139348] trunk/Tools
Revision
139348
Author
jpar...@chromium.org
Date
2013-01-10 11:52:33 -0800 (Thu, 10 Jan 2013)

Log Message

Dashboard Cleanup: Do not generate the page if we are about to reload.
https://bugs.webkit.org/show_bug.cgi?id=106584

Reviewed by Dirk Pranke.

Move the logic to determine if we should generate the page into
parseParameters() since that is where we have the knowledge to
determine it, and return that value to handleLocationChange,
rather than passing the changed parameters back to handleLocationChange
and having it make the decision.

This is logically equivalent, save one case: when we are about to do
a reload, we know that there is no reason to generate the page.  Old
code was causing an extra page generation in this case.

* TestResultServer/static-dashboards/dashboard_base.js:
(parseParameters):
(handleLocationChange):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (139347 => 139348)


--- trunk/Tools/ChangeLog	2013-01-10 19:47:23 UTC (rev 139347)
+++ trunk/Tools/ChangeLog	2013-01-10 19:52:33 UTC (rev 139348)
@@ -1,3 +1,24 @@
+2013-01-10  Julie Parent  <jpar...@chromium.org>
+
+        Dashboard Cleanup: Do not generate the page if we are about to reload.
+        https://bugs.webkit.org/show_bug.cgi?id=106584
+
+        Reviewed by Dirk Pranke.
+
+        Move the logic to determine if we should generate the page into
+        parseParameters() since that is where we have the knowledge to
+        determine it, and return that value to handleLocationChange, 
+        rather than passing the changed parameters back to handleLocationChange
+        and having it make the decision.
+        
+        This is logically equivalent, save one case: when we are about to do
+        a reload, we know that there is no reason to generate the page.  Old
+        code was causing an extra page generation in this case.
+        
+        * TestResultServer/static-dashboards/dashboard_base.js:
+        (parseParameters):
+        (handleLocationChange):
+
 2013-01-10  Raphael Kubo da Costa  <raphael.kubo.da.co...@intel.com>
 
         [jhbuild] Use the "configure" script to build glib

Modified: trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js (139347 => 139348)


--- trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js	2013-01-10 19:47:23 UTC (rev 139347)
+++ trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js	2013-01-10 19:52:33 UTC (rev 139348)
@@ -315,6 +315,7 @@
         parseParameter(parameters, parameterName);
 }
 
+// @return {boolean} Whether to generate the page.
 function parseParameters()
 {
     var oldCrossDashboardState = g_crossDashboardState;
@@ -327,7 +328,7 @@
         for (var key in g_crossDashboardState) {
             if (oldCrossDashboardState[key] != g_crossDashboardState[key] && RELOAD_REQUIRING_PARAMETERS.indexOf(key) != -1) {
                 window.location.reload();
-                return {};
+                return false;
             }
         }
     }
@@ -348,7 +349,10 @@
     if (g_currentState.tests)
         delete g_currentState.builder;
 
-    return dashboardSpecificDiffState;
+    var shouldGeneratePage = true;
+    if (Object.keys(dashboardSpecificDiffState).length)
+        shouldGeneratePage = handleQueryParameterChange(dashboardSpecificDiffState);
+    return shouldGeneratePage;
 }
 
 function diffStates(oldState, newState)
@@ -509,12 +513,7 @@
     if (g_resourceLoader)
         return;
 
-    var params = parseParameters();
-    var shouldGeneratePage = true;
-    if (Object.keys(params).length)
-        shouldGeneratePage = handleQueryParameterChange(params);
-
-    if (shouldGeneratePage)
+    if (parseParameters())
         generatePage();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to