OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8InspectorString_h | 5 #ifndef V8InspectorString_h |
6 #define V8InspectorString_h | 6 #define V8InspectorString_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "platform/Decimal.h" | 9 #include "platform/Decimal.h" |
10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
| 11 #include "wtf/Assertions.h" |
11 #include "wtf/text/StringBuilder.h" | 12 #include "wtf/text/StringBuilder.h" |
12 #include "wtf/text/StringHash.h" | 13 #include "wtf/text/StringHash.h" |
13 #include "wtf/text/StringView.h" | 14 #include "wtf/text/StringView.h" |
14 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
15 | 16 |
16 #include <memory> | 17 #include <memory> |
17 #include <v8-inspector.h> | 18 #include <v8-inspector.h> |
18 | 19 |
19 namespace blink { | 20 namespace blink { |
20 | 21 |
(...skipping 20 matching lines...) Expand all Loading... |
41 return s.substring(pos, len); | 42 return s.substring(pos, len); |
42 } | 43 } |
43 static String fromInteger(int number) { return String::number(number); } | 44 static String fromInteger(int number) { return String::number(number); } |
44 static String fromDouble(double number) { | 45 static String fromDouble(double number) { |
45 return Decimal::fromDouble(number).toString(); | 46 return Decimal::fromDouble(number).toString(); |
46 } | 47 } |
47 static const size_t kNotFound = WTF::kNotFound; | 48 static const size_t kNotFound = WTF::kNotFound; |
48 static void builderReserve(StringBuilder& builder, unsigned capacity) { | 49 static void builderReserve(StringBuilder& builder, unsigned capacity) { |
49 builder.reserveCapacity(capacity); | 50 builder.reserveCapacity(capacity); |
50 } | 51 } |
| 52 static std::unique_ptr<protocol::Value> parseJSON(const String&); |
51 }; | 53 }; |
52 | 54 |
53 CORE_EXPORT std::unique_ptr<protocol::Value> parseJSON(const String&); | |
54 | |
55 } // namespace protocol | 55 } // namespace protocol |
56 | 56 |
57 } // namespace blink | 57 } // namespace blink |
58 | 58 |
59 // TODO(dgozman): migrate core/inspector/protocol to wtf::HashMap. | 59 // TODO(dgozman): migrate core/inspector/protocol to wtf::HashMap. |
60 namespace std { | 60 namespace std { |
61 template <> | 61 template <> |
62 struct hash<WTF::String> { | 62 struct hash<WTF::String> { |
63 std::size_t operator()(const WTF::String& string) const { | 63 std::size_t operator()(const WTF::String& string) const { |
64 return StringHash::hash(string); | 64 return StringHash::hash(string); |
65 } | 65 } |
66 }; | 66 }; |
67 } // namespace std | 67 } // namespace std |
68 | 68 |
69 #endif // V8InspectorString_h | 69 #endif // V8InspectorString_h |
OLD | NEW |