Index: third_party/WebKit/Source/platform/v8_inspector/InspectorProtocolString.h |
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InspectorProtocolString.h b/third_party/WebKit/Source/platform/v8_inspector/InspectorProtocolString.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..318a736b700a3017e3d0354ff108ca47f56436e8 |
--- /dev/null |
+++ b/third_party/WebKit/Source/platform/v8_inspector/InspectorProtocolString.h |
@@ -0,0 +1,33 @@ |
+// 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. |
+ |
+#ifndef InspectorProtocolString_h |
+#define InspectorProtocolString_h |
+ |
+#include "platform/v8_inspector/String16.h" |
+ |
+namespace v8_inspector { |
+namespace protocol { |
+ |
+using String = v8_inspector::String16; |
+using StringBuilder = v8_inspector::String16Builder; |
+ |
+class PLATFORM_EXPORT StringUtil { |
+public: |
+ static String substring(const String& s, unsigned pos, unsigned len = UINT_MAX) { return s.substring(pos, len); } |
+ static String fromInteger(int number) { return String::fromInteger(number); } |
+ static String fromDouble(double number) { return String::fromDouble(number); } |
+ static const size_t kNotFound = String::kNotFound; |
+ static void toCharacters(const String& s, const UChar** characters, size_t* length) |
+ { |
+ *characters = s.characters16(); |
+ *length = s.length(); |
+ } |
+ static void builderReserve(StringBuilder& builder, unsigned capacity) { builder.reserveCapacity(capacity); } |
+}; |
+ |
+} // namespace protocol |
+} // namespace v8_inspector |
+ |
+#endif // !defined(InspectorProtocolString_h) |