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 V8Regex_h | 5 #ifndef V8Regex_h |
6 #define V8Regex_h | 6 #define V8Regex_h |
7 | 7 |
8 #include "platform/inspector_protocol/Allocator.h" | 8 #include "platform/inspector_protocol/Allocator.h" |
9 #include "wtf/text/WTFString.h" | 9 #include "platform/inspector_protocol/String16.h" |
10 #include <v8.h> | 10 #include <v8.h> |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class V8DebuggerImpl; | 14 class V8DebuggerImpl; |
15 | 15 |
16 enum MultilineMode { | 16 enum MultilineMode { |
17 MultilineDisabled, | 17 MultilineDisabled, |
18 MultilineEnabled | 18 MultilineEnabled |
19 }; | 19 }; |
20 | 20 |
21 class V8Regex { | 21 class V8Regex { |
22 PROTOCOL_DISALLOW_COPY(V8Regex); | 22 PROTOCOL_DISALLOW_COPY(V8Regex); |
23 public: | 23 public: |
24 V8Regex(V8DebuggerImpl*, const String&, TextCaseSensitivity, MultilineMode =
MultilineDisabled); | 24 V8Regex(V8DebuggerImpl*, const String16&, bool caseSensitive, bool multiline
= false); |
25 int match(const String&, int startFrom = 0, int* matchLength = 0) const; | 25 int match(const String16&, int startFrom = 0, int* matchLength = 0) const; |
26 bool isValid() const { return !m_regex.IsEmpty(); } | 26 bool isValid() const { return !m_regex.IsEmpty(); } |
27 | 27 |
28 private: | 28 private: |
29 V8DebuggerImpl* m_debugger; | 29 V8DebuggerImpl* m_debugger; |
30 v8::Global<v8::RegExp> m_regex; | 30 v8::Global<v8::RegExp> m_regex; |
31 }; | 31 }; |
32 | 32 |
33 } // namespace blink | 33 } // namespace blink |
34 | 34 |
35 #endif // V8Regex_h | 35 #endif // V8Regex_h |
OLD | NEW |