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/base/macros.h" | 8 #include "src/base/macros.h" |
9 #include "src/inspector/string-16.h" | 9 #include "src/inspector/string-16.h" |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const char*); | 50 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const char*); |
51 v8::Local<v8::String> toV8String(v8::Isolate*, const StringView&); | 51 v8::Local<v8::String> toV8String(v8::Isolate*, const StringView&); |
52 // TODO(dgozman): rename to toString16. | 52 // TODO(dgozman): rename to toString16. |
53 String16 toProtocolString(v8::Local<v8::String>); | 53 String16 toProtocolString(v8::Local<v8::String>); |
54 String16 toProtocolStringWithTypeCheck(v8::Local<v8::Value>); | 54 String16 toProtocolStringWithTypeCheck(v8::Local<v8::Value>); |
55 String16 toString16(const StringView&); | 55 String16 toString16(const StringView&); |
56 StringView toStringView(const String16&); | 56 StringView toStringView(const String16&); |
57 bool stringViewStartsWith(const StringView&, const char*); | 57 bool stringViewStartsWith(const StringView&, const char*); |
58 | 58 |
59 class StringBufferImpl : public StringBuffer { | 59 class StringBufferImpl : public StringBuffer { |
60 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); | |
61 | |
62 public: | 60 public: |
63 // Destroys string's content. | 61 // Destroys string's content. |
64 static std::unique_ptr<StringBufferImpl> adopt(String16&); | 62 static std::unique_ptr<StringBufferImpl> adopt(String16&); |
65 const StringView& string() override { return m_string; } | 63 const StringView& string() override { return m_string; } |
66 | 64 |
67 private: | 65 private: |
68 explicit StringBufferImpl(String16&); | 66 explicit StringBufferImpl(String16&); |
69 String16 m_owner; | 67 String16 m_owner; |
70 StringView m_string; | 68 StringView m_string; |
| 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); |
71 }; | 71 }; |
72 | 72 |
73 } // namespace v8_inspector | 73 } // namespace v8_inspector |
74 | 74 |
75 #endif // V8_INSPECTOR_STRINGUTIL_H_ | 75 #endif // V8_INSPECTOR_STRINGUTIL_H_ |
OLD | NEW |