OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 V8_INSPECTOR_STRINGUTIL_H_ | 5 #ifndef V8_INSPECTOR_STRINGUTIL_H_ |
6 #define V8_INSPECTOR_STRINGUTIL_H_ | 6 #define V8_INSPECTOR_STRINGUTIL_H_ |
7 | 7 |
8 #include "src/inspector/Allocator.h" | 8 #include "src/base/macros.h" |
9 #include "src/inspector/String16.h" | 9 #include "src/inspector/String16.h" |
10 | 10 |
11 #include "include/v8-inspector.h" | 11 #include "include/v8-inspector.h" |
12 | 12 |
13 namespace v8_inspector { | 13 namespace v8_inspector { |
14 | 14 |
15 namespace protocol { | 15 namespace protocol { |
16 | 16 |
17 class Value; | 17 class Value; |
18 | 18 |
(...skipping 27 matching lines...) Expand all Loading... |
46 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const char*); | 46 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const char*); |
47 v8::Local<v8::String> toV8String(v8::Isolate*, const StringView&); | 47 v8::Local<v8::String> toV8String(v8::Isolate*, const StringView&); |
48 // TODO(dgozman): rename to toString16. | 48 // TODO(dgozman): rename to toString16. |
49 String16 toProtocolString(v8::Local<v8::String>); | 49 String16 toProtocolString(v8::Local<v8::String>); |
50 String16 toProtocolStringWithTypeCheck(v8::Local<v8::Value>); | 50 String16 toProtocolStringWithTypeCheck(v8::Local<v8::Value>); |
51 String16 toString16(const StringView&); | 51 String16 toString16(const StringView&); |
52 StringView toStringView(const String16&); | 52 StringView toStringView(const String16&); |
53 bool stringViewStartsWith(const StringView&, const char*); | 53 bool stringViewStartsWith(const StringView&, const char*); |
54 | 54 |
55 class StringBufferImpl : public StringBuffer { | 55 class StringBufferImpl : public StringBuffer { |
56 V8_INSPECTOR_DISALLOW_COPY(StringBufferImpl); | 56 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); |
57 | 57 |
58 public: | 58 public: |
59 // Destroys string's content. | 59 // Destroys string's content. |
60 static std::unique_ptr<StringBufferImpl> adopt(String16&); | 60 static std::unique_ptr<StringBufferImpl> adopt(String16&); |
61 const StringView& string() override { return m_string; } | 61 const StringView& string() override { return m_string; } |
62 | 62 |
63 private: | 63 private: |
64 explicit StringBufferImpl(String16&); | 64 explicit StringBufferImpl(String16&); |
65 String16 m_owner; | 65 String16 m_owner; |
66 StringView m_string; | 66 StringView m_string; |
67 }; | 67 }; |
68 | 68 |
69 } // namespace v8_inspector | 69 } // namespace v8_inspector |
70 | 70 |
71 #endif // V8_INSPECTOR_STRINGUTIL_H_ | 71 #endif // V8_INSPECTOR_STRINGUTIL_H_ |
OLD | NEW |