Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / devtools / front_end / sdk / PowerProfiler.js
index 63ff51e..f4deb62 100644 (file)
@@ -10,6 +10,7 @@ WebInspector.PowerProfiler = function()
 {
     WebInspector.Object.call(this);
     this._dispatcher = new WebInspector.PowerDispatcher(this);
+    PowerAgent.getAccuracyLevel(this._onAccuracyLevel.bind(this));
 }
 
 WebInspector.PowerProfiler.EventTypes = {
@@ -28,6 +29,23 @@ WebInspector.PowerProfiler.prototype = {
         PowerAgent.end();
     },
 
+    /**
+     * @return {string}
+     */
+    getAccuracyLevel: function()
+    {
+        return this._accuracyLevel;
+    },
+
+    _onAccuracyLevel: function(error, result) {
+        this._accuracyLevel = "";
+        if (error) {
+            console.log("Unable to retrieve PowerProfiler accuracy level: " + error);
+            return;
+        }
+        this._accuracyLevel = result;
+    },
+
     __proto__: WebInspector.Object.prototype
 }