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

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

Issue 2251343003: [DevTools] Generate separate copies of inspector_protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_cpp.template
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/String16_cpp.template b/third_party/WebKit/Source/platform/inspector_protocol/String16_cpp.template
deleted file mode 100644
index d795aefa0c2f2549eb44bc2ac12e1dd38f4527ef..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/platform/inspector_protocol/String16_cpp.template
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <cstdlib>
-#include <cstring>
-#include <string>
-
-namespace blink {
-namespace protocol {
-
-namespace internal {
-
-void intToStr(int number, char* buffer, size_t length)
-{
- std::snprintf(buffer, length, "%d", number);
-}
-
-void doubleToStr(double number, char* buffer, size_t length)
-{
- std::snprintf(buffer, length, "%f", number);
-}
-
-void doubleToStr3(double number, char* buffer, size_t length)
-{
- std::snprintf(buffer, length, "%.3g", number);
-}
-
-void doubleToStr6(double number, char* buffer, size_t length)
-{
- std::snprintf(buffer, length, "%.6g", number);
-}
-
-double strToDouble(const char* buffer, bool* ok)
-{
- char* endptr;
- double result = std::strtod(buffer, &endptr);
- if (ok)
- *ok = !(*endptr);
- return result;
-}
-
-int strToInt(const char* buffer, bool* ok)
-{
- char* endptr;
- int result = std::strtol(buffer, &endptr, 10);
- if (ok)
- *ok = !(*endptr);
- return result;
-}
-
-} // namespace internal
-
-String16Builder::String16Builder()
-{
-}
-
-void String16Builder::append(const String16& s)
-{
- m_buffer.insert(m_buffer.end(), s.characters16(), s.characters16() + s.length());
-}
-
-void String16Builder::append(UChar c)
-{
- m_buffer.push_back(c);
-}
-
-void String16Builder::append(char c)
-{
- UChar u = c;
- m_buffer.push_back(u);
-}
-
-void String16Builder::append(const UChar* characters, size_t length)
-{
- m_buffer.insert(m_buffer.end(), characters, characters + length);
-}
-
-void String16Builder::append(const char* characters, size_t length)
-{
- m_buffer.reserve(m_buffer.size() + length);
- for (size_t i = 0; i < length; ++i, ++characters) {
- UChar u = *characters;
- m_buffer.push_back(u);
- }
-}
-
-String16 String16Builder::toString()
-{
- return String16(m_buffer.data(), m_buffer.size());
-}
-
-void String16Builder::reserveCapacity(size_t capacity)
-{
- m_buffer.reserve(capacity);
-}
-
-} // namespace protocol
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698