Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Side by Side Diff: src/inspector/public/StringView.h

Issue 2300823002: Revert of [inspector] Initial import of v8_inspector. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/inspector/public/StringBuffer.h ('k') | src/inspector/public/V8ContextInfo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef V8_INSPECTOR_PUBLIC_STRINGVIEW_H_
6 #define V8_INSPECTOR_PUBLIC_STRINGVIEW_H_
7
8 #include <cctype>
9 #include <stdint.h>
10
11 namespace v8_inspector {
12
13 class PLATFORM_EXPORT StringView {
14 public:
15 StringView()
16 : m_is8Bit(true)
17 , m_length(0)
18 , m_characters8(nullptr) {}
19
20 StringView(const uint8_t* characters, unsigned length)
21 : m_is8Bit(true)
22 , m_length(length)
23 , m_characters8(characters) {}
24
25 StringView(const uint16_t* characters, unsigned length)
26 : m_is8Bit(false)
27 , m_length(length)
28 , m_characters16(characters) {}
29
30 bool is8Bit() const { return m_is8Bit; }
31 unsigned length() const { return m_length; }
32
33 // TODO(dgozman): add DCHECK(m_is8Bit) to accessors once platform can be use d here.
34 const uint8_t* characters8() const { return m_characters8; }
35 const uint16_t* characters16() const { return m_characters16; }
36
37 private:
38 bool m_is8Bit;
39 unsigned m_length;
40 union {
41 const uint8_t* m_characters8;
42 const uint16_t* m_characters16;
43 };
44 };
45
46 } // namespace v8_inspector
47
48 #endif // V8_INSPECTOR_PUBLIC_STRINGVIEW_H_
OLDNEW
« no previous file with comments | « src/inspector/public/StringBuffer.h ('k') | src/inspector/public/V8ContextInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698