diff --git a/third_party/webkit/PerformanceTests/StyleBench/resources/benchmark-report.js b/third_party/webkit/PerformanceTests/StyleBench/resources/benchmark-report.js
index b33021d9d9ce..58b3e46982d1 100644
--- a/third_party/webkit/PerformanceTests/StyleBench/resources/benchmark-report.js
+++ b/third_party/webkit/PerformanceTests/StyleBench/resources/benchmark-report.js
@@ -1,12 +1,13 @@
 // This file can be customized to report results as needed.
 
 (function () {
-    if (!window.testRunner && location.search != '?webkit' && location.hash != '#webkit')
+    if (!window.testRunner && location.search != '?webkit' && location.hash != '#webkit' &&
+        location.search != '?gecko' && location.search != '?raptor')
         return;
 
     if (window.testRunner)
         testRunner.waitUntilDone();
 
     var scriptElement = document.createElement('script');
     scriptElement.src = '../resources/runner.js';
     document.head.appendChild(scriptElement);
@@ -31,20 +32,22 @@
                     customIterationCount: iterationCount,
                     doNotIgnoreInitialRun: true,
                     doNotMeasureMemoryUsage: true,
                     continueTesting: !isLastTest,
                     unit: unit,
                     name: name,
                     aggregator: aggregator};
             }
-            PerfTestRunner.prepareToMeasureValuesAsync(createTest(null, 'Geometric'));
+            if (window.PerfTestRunner)
+                PerfTestRunner.prepareToMeasureValuesAsync(createTest(null, 'Geometric'));
         },
         didRunSuites: function (measuredValues) {
-            PerfTestRunner.measureValueAsync(measuredValues.geomean);
+            if (window.PerfTestRunner)
+                PerfTestRunner.measureValueAsync(measuredValues.geomean);
             valuesByIteration.push(measuredValues);
         },
         didFinishLastIteration: function () {
             document.head.removeChild(document.querySelector('style'));
 
             var measuredValuesByFullName = {};
             function addToMeasuredValue(value, fullName, aggregator) {
                 var values = measuredValuesByFullName[fullName] || new Array;
@@ -63,21 +66,37 @@
                         for (var subtestName in test.tests)
                             addToMeasuredValue(test.tests[subtestName], suiteName + '/' + testName + '/' + subtestName);
                         addToMeasuredValue(test.total, suiteName + '/' + testName, 'Total');
                     }
                     addToMeasuredValue(suite.total, suiteName, 'Total');
                 }
             });
 
-            PerfTestRunner.reportValues(createTest(null, null, false, 'pt'), scores);
+            if (window.PerfTestRunner)
+                PerfTestRunner.reportValues(createTest(null, null, false, 'pt'), scores);
 
             var fullNames = new Array;
             for (var fullName in measuredValuesByFullName)
                 fullNames.push(fullName);
 
-            for (var i = 0; i < fullNames.length; i++) {
-                var values = measuredValuesByFullName[fullNames[i]];
-                PerfTestRunner.reportValues(createTest(fullNames[i], values.aggregator, i + 1 == fullNames.length), values);
+            if (location.search == '?raptor') {
+                var data = ['raptor-benchmark', 'speedometer', measuredValuesByFullName];
+                window.postMessage(data, '*');
+                window.sessionStorage.setItem('benchmark_results',  JSON.stringify(data));
+            } else if (typeof tpRecordTime !== "undefined") {
+                var values = new Array;
+                var allNames = new Array;
+                for (var i = 0; i < fullNames.length; i++) {
+                    var vals = measuredValuesByFullName[fullNames[i]];
+                    values.push(vals);
+                    for (var count = 0; count < vals.length; count ++)
+                        allNames.push(fullNames[i]);
+                }
+                tpRecordTime(values.join(','), 0, allNames.join(','));
+            } else if (window.PerfTestRunner) {
+                for (var i = 0; i < fullNames.length; i++) {
+                    var values = measuredValuesByFullName[fullNames[i]];
+                    PerfTestRunner.reportValues(createTest(fullNames[i], values.aggregator, i + 1 == fullNames.length), values);
+                }
             }
         }
     };
 })();
