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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/String16_h.template

Issue 2260233002: [DevTools] Migrate v8_inspector/public from String16 to String{View,Buffer}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: styling Created 4 years, 4 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/platform/inspector_protocol/String16_h.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/String16_h.template b/third_party/WebKit/Source/platform/inspector_protocol/String16_h.template
index e6f8f0c78465ae686ac3e2bf089f633eb56862ee..9bef5d0f1122ff40f0272caed16ade780b08f9da 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/String16_h.template
+++ b/third_party/WebKit/Source/platform/inspector_protocol/String16_h.template
@@ -19,7 +19,6 @@ namespace internal {
{{config.class_export.macro}} void doubleToStr(double, char*, size_t);
{{config.class_export.macro}} void doubleToStr3(double, char*, size_t);
{{config.class_export.macro}} void doubleToStr6(double, char*, size_t);
-{{config.class_export.macro}} double strToDouble(const char*, bool*);
{{config.class_export.macro}} int strToInt(const char*, bool*);
} // namespace internal
@@ -64,22 +63,6 @@ public:
return T(buffer);
}
- static double charactersToDouble(const C* characters, size_t length, bool* ok = nullptr)
- {
- std::vector<char> buffer;
- buffer.reserve(length + 1);
- for (size_t i = 0; i < length; ++i) {
- if (!isASCII(characters[i])) {
- if (ok)
- *ok = false;
- return 0;
- }
- buffer.push_back(static_cast<char>(characters[i]));
- }
- buffer.push_back('\0');
- return internal::strToDouble(buffer.data(), ok);
- }
-
static int charactersToInteger(const C* characters, size_t length, bool* ok = nullptr)
{
std::vector<char> buffer;
@@ -96,13 +79,6 @@ public:
return internal::strToInt(buffer.data(), ok);
}
- double toDouble(bool* ok = nullptr) const
- {
- const C* characters = static_cast<const T&>(*this).characters16();
- size_t length = static_cast<const T&>(*this).length();
- return charactersToDouble(characters, length, ok);
- }
-
int toInteger(bool* ok = nullptr) const
{
const C* characters = static_cast<const T&>(*this).characters16();
@@ -136,17 +112,6 @@ public:
return T(static_cast<const T&>(*this));
return T(characters + start, end + 1 - start);
}
-
- bool startsWith(const char* prefix) const
- {
- const C* characters = static_cast<const T&>(*this).characters16();
- size_t length = static_cast<const T&>(*this).length();
- for (size_t i = 0, j = 0; prefix[j] && i < length; ++i, ++j) {
- if (characters[i] != prefix[j])
- return false;
- }
- return true;
- }
};
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698