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 #include "platform/v8_inspector/V8StringUtil.h" | 5 #include "platform/v8_inspector/V8StringUtil.h" |
6 | 6 |
7 #include "platform/inspector_protocol/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
8 #include "platform/v8_inspector/V8DebuggerImpl.h" | 8 #include "platform/v8_inspector/V8DebuggerImpl.h" |
| 9 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
9 #include "platform/v8_inspector/V8Regex.h" | 10 #include "platform/v8_inspector/V8Regex.h" |
10 #include "platform/v8_inspector/public/V8ContentSearchUtil.h" | 11 #include "platform/v8_inspector/public/V8ContentSearchUtil.h" |
11 #include "platform/v8_inspector/public/V8ToProtocolValue.h" | 12 #include "platform/v8_inspector/public/V8ToProtocolValue.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 String16 findMagicComment(const String16& content, const String16& name, bool mu
ltiline, bool* deprecated) | 18 String16 findMagicComment(const String16& content, const String16& name, bool mu
ltiline, bool* deprecated) |
18 { | 19 { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 String16 findSourceURL(const String16& content, bool multiline, bool* deprecated
) | 188 String16 findSourceURL(const String16& content, bool multiline, bool* deprecated
) |
188 { | 189 { |
189 return findMagicComment(content, "sourceURL", multiline, deprecated); | 190 return findMagicComment(content, "sourceURL", multiline, deprecated); |
190 } | 191 } |
191 | 192 |
192 String16 findSourceMapURL(const String16& content, bool multiline, bool* depreca
ted) | 193 String16 findSourceMapURL(const String16& content, bool multiline, bool* depreca
ted) |
193 { | 194 { |
194 return findMagicComment(content, "sourceMappingURL", multiline, deprecated); | 195 return findMagicComment(content, "sourceMappingURL", multiline, deprecated); |
195 } | 196 } |
196 | 197 |
197 PassOwnPtr<protocol::Array<protocol::Debugger::SearchMatch>> searchInTextByLines
(V8Debugger* debugger, const String16& text, const String16& query, const bool c
aseSensitive, const bool isRegex) | 198 PassOwnPtr<protocol::Array<protocol::Debugger::SearchMatch>> searchInTextByLines
(V8InspectorSession* session, const String16& text, const String16& query, const
bool caseSensitive, const bool isRegex) |
198 { | 199 { |
199 OwnPtr<protocol::Array<protocol::Debugger::SearchMatch>> result = protocol::
Array<protocol::Debugger::SearchMatch>::create(); | 200 OwnPtr<protocol::Array<protocol::Debugger::SearchMatch>> result = protocol::
Array<protocol::Debugger::SearchMatch>::create(); |
200 OwnPtr<V8Regex> regex = createSearchRegex(static_cast<V8DebuggerImpl*>(debug
ger), query, caseSensitive, isRegex); | 201 OwnPtr<V8Regex> regex = createSearchRegex(static_cast<V8InspectorSessionImpl
*>(session)->debugger(), query, caseSensitive, isRegex); |
201 protocol::Vector<std::pair<int, String16>> matches = scriptRegexpMatchesByLi
nes(*regex.get(), text); | 202 protocol::Vector<std::pair<int, String16>> matches = scriptRegexpMatchesByLi
nes(*regex.get(), text); |
202 | 203 |
203 for (const auto& match : matches) | 204 for (const auto& match : matches) |
204 result->addItem(buildObjectForSearchMatch(match.first, match.second)); | 205 result->addItem(buildObjectForSearchMatch(match.first, match.second)); |
205 | 206 |
206 return result.release(); | 207 return result.release(); |
207 } | 208 } |
208 | 209 |
209 } // namespace V8ContentSearchUtil | 210 } // namespace V8ContentSearchUtil |
210 | 211 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 return nullptr; | 271 return nullptr; |
271 jsonObject->setValue(toProtocolString(propertyName), propertyValue.r
elease()); | 272 jsonObject->setValue(toProtocolString(propertyName), propertyValue.r
elease()); |
272 } | 273 } |
273 return jsonObject.release(); | 274 return jsonObject.release(); |
274 } | 275 } |
275 ASSERT_NOT_REACHED(); | 276 ASSERT_NOT_REACHED(); |
276 return nullptr; | 277 return nullptr; |
277 } | 278 } |
278 | 279 |
279 } // namespace blink | 280 } // namespace blink |
OLD | NEW |