Index: content/browser/devtools/protocol_string.h |
diff --git a/content/browser/devtools/protocol_string.h b/content/browser/devtools/protocol_string.h |
index 90dbd4abf7cfb546e8cc008f9632ef5239c1a6f9..2c224290cb188ba7e99000d94b1bf234d4b9d321 100644 |
--- a/content/browser/devtools/protocol_string.h |
+++ b/content/browser/devtools/protocol_string.h |
@@ -52,6 +52,13 @@ class CONTENT_EXPORT StringUtil { |
s = "0" + s; |
return s; |
} |
+ static double toDouble(const char* s, size_t len, bool* ok) { |
+ double v = 0.0; |
+ *ok = base::StringToDouble(std::string(s, len), &v); |
+ if (!*ok) |
+ v = 0.0; |
+ return v; |
+ } |
static size_t find(const String& s, const char* needle) { |
return s.find(needle); |
} |