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

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js

Issue 1959783002: DevTools: Introduce device dependent CPU throttling rates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js b/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js
index aca67d2cf0d885387277664521cf4ac2ef6a78da..0f154bb6b895ab9a75269d09a29df204c1ea3620 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js
@@ -21,6 +21,8 @@ WebInspector.EmulatedDevice = function()
this.capabilities = [WebInspector.EmulatedDevice.Capability.Touch, WebInspector.EmulatedDevice.Capability.Mobile];
/** @type {string} */
this.userAgent = "";
+ /** @type {number} */
+ this.octaneScore = 0;
/** @type {!Array.<!WebInspector.EmulatedDevice.Mode>} */
this.modes = [];
@@ -140,6 +142,7 @@ WebInspector.EmulatedDevice.fromJSONV1 = function(json)
result.title = /** @type {string} */ (parseValue(json, "title", "string"));
result.type = /** @type {string} */ (parseValue(json, "type", "string"));
result.userAgent = /** @type {string} */ (parseValue(json, "user-agent", "string"));
+ result.octaneScore = /** @type {number} */ (parseValue(json, "octane-score", "number", 0));
var capabilities = parseValue(json, "capabilities", "object", []);
if (!Array.isArray(capabilities))
@@ -250,6 +253,8 @@ WebInspector.EmulatedDevice.prototype = {
json["screen"]["vertical"] = this._orientationToJSON(this.vertical);
json["screen"]["horizontal"] = this._orientationToJSON(this.horizontal);
+ json["octane-score"] = this.octaneScore;
+
json["modes"] = [];
for (var i = 0; i < this.modes.length; ++i) {
var mode = {};

Powered by Google App Engine
This is Rietveld 408576698