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_V8_INSPECTOR_H_ | 5 #ifndef V8_V8_INSPECTOR_H_ |
6 #define V8_V8_INSPECTOR_H_ | 6 #define V8_V8_INSPECTOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <cctype> | 9 #include <cctype> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 namespace API { | 30 namespace API { |
31 class Domain; | 31 class Domain; |
32 } | 32 } |
33 } | 33 } |
34 } // namespace protocol | 34 } // namespace protocol |
35 | 35 |
36 class V8_EXPORT StringView { | 36 class V8_EXPORT StringView { |
37 public: | 37 public: |
38 StringView() : m_is8Bit(true), m_length(0), m_characters8(nullptr) {} | 38 StringView() : m_is8Bit(true), m_length(0), m_characters8(nullptr) {} |
39 | 39 |
40 StringView(const uint8_t* characters, unsigned length) | 40 StringView(const uint8_t* characters, size_t length) |
41 : m_is8Bit(true), m_length(length), m_characters8(characters) {} | 41 : m_is8Bit(true), m_length(length), m_characters8(characters) {} |
42 | 42 |
43 StringView(const uint16_t* characters, unsigned length) | 43 StringView(const uint16_t* characters, size_t length) |
44 : m_is8Bit(false), m_length(length), m_characters16(characters) {} | 44 : m_is8Bit(false), m_length(length), m_characters16(characters) {} |
45 | 45 |
46 bool is8Bit() const { return m_is8Bit; } | 46 bool is8Bit() const { return m_is8Bit; } |
47 unsigned length() const { return m_length; } | 47 size_t length() const { return m_length; } |
48 | 48 |
49 // TODO(dgozman): add DCHECK(m_is8Bit) to accessors once platform can be used | 49 // TODO(dgozman): add DCHECK(m_is8Bit) to accessors once platform can be used |
50 // here. | 50 // here. |
51 const uint8_t* characters8() const { return m_characters8; } | 51 const uint8_t* characters8() const { return m_characters8; } |
52 const uint16_t* characters16() const { return m_characters16; } | 52 const uint16_t* characters16() const { return m_characters16; } |
53 | 53 |
54 private: | 54 private: |
55 bool m_is8Bit; | 55 bool m_is8Bit; |
56 unsigned m_length; | 56 size_t m_length; |
57 union { | 57 union { |
58 const uint8_t* m_characters8; | 58 const uint8_t* m_characters8; |
59 const uint16_t* m_characters16; | 59 const uint16_t* m_characters16; |
60 }; | 60 }; |
61 }; | 61 }; |
62 | 62 |
63 class V8_EXPORT StringBuffer { | 63 class V8_EXPORT StringBuffer { |
64 public: | 64 public: |
65 virtual ~StringBuffer() {} | 65 virtual ~StringBuffer() {} |
66 virtual const StringView& string() = 0; | 66 virtual const StringView& string() = 0; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 // API methods. | 259 // API methods. |
260 virtual std::unique_ptr<V8StackTrace> createStackTrace( | 260 virtual std::unique_ptr<V8StackTrace> createStackTrace( |
261 v8::Local<v8::StackTrace>) = 0; | 261 v8::Local<v8::StackTrace>) = 0; |
262 virtual std::unique_ptr<V8StackTrace> captureStackTrace(bool fullStack) = 0; | 262 virtual std::unique_ptr<V8StackTrace> captureStackTrace(bool fullStack) = 0; |
263 }; | 263 }; |
264 | 264 |
265 } // namespace v8_inspector | 265 } // namespace v8_inspector |
266 | 266 |
267 #endif // V8_V8_INSPECTOR_H_ | 267 #endif // V8_V8_INSPECTOR_H_ |
OLD | NEW |