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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/InspectorProtocolString.h

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/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)

Powered by Google App Engine
This is Rietveld 408576698