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/core/inspector/V8InspectorString.h

Issue 2251343003: [DevTools] Generate separate copies of inspector_protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win compile 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/core/inspector/V8InspectorString.h
diff --git a/third_party/WebKit/Source/core/inspector/V8InspectorString.h b/third_party/WebKit/Source/core/inspector/V8InspectorString.h
index c7ef67bae13fc382065b2a268a9dd69330d64b04..e224363e7604d7ad97dbc21416f046fac12cd1f6 100644
--- a/third_party/WebKit/Source/core/inspector/V8InspectorString.h
+++ b/third_party/WebKit/Source/core/inspector/V8InspectorString.h
@@ -6,8 +6,12 @@
#define V8InspectorString_h
#include "core/CoreExport.h"
+#include "platform/Decimal.h"
#include "platform/v8_inspector/public/StringBuffer.h"
#include "platform/v8_inspector/public/StringView.h"
+#include "wtf/Allocator.h"
+#include "wtf/text/StringBuilder.h"
+#include "wtf/text/StringHash.h"
#include "wtf/text/StringView.h"
#include "wtf/text/WTFString.h"
@@ -21,6 +25,37 @@ CORE_EXPORT std::unique_ptr<v8_inspector::StringBuffer> toV8InspectorStringBuffe
CORE_EXPORT String toCoreString(const v8_inspector::StringView&);
CORE_EXPORT String toCoreString(std::unique_ptr<v8_inspector::StringBuffer>);
+namespace protocol {
+
+class Value;
+
+using String = WTF::String;
+using StringBuilder = WTF::StringBuilder;
+
+class CORE_EXPORT StringUtil {
+ STATIC_ONLY(StringUtil);
+public:
+ static String substring(const String& s, unsigned pos, unsigned len) { return s.substring(pos, len); }
+ static String fromInteger(int number) { return String::number(number); }
+ static String fromDouble(double number) { return Decimal::fromDouble(number).toString(); }
+ static const size_t kNotFound = WTF::kNotFound;
+ static void builderReserve(StringBuilder& builder, unsigned capacity) { builder.reserveCapacity(capacity); }
+};
+
+CORE_EXPORT std::unique_ptr<protocol::Value> parseJSON(const String&);
+
+} // namespace protocol
+
} // namespace blink
+// TODO(dgozman): migrate core/inspector/protocol to wtf::HashMap.
+namespace std {
+template<> struct hash<WTF::String> {
+ std::size_t operator()(const WTF::String& string) const
+ {
+ return StringHash::hash(string);
+ }
+};
+} // namespace std
+
#endif // V8InspectorString_h

Powered by Google App Engine
This is Rietveld 408576698