| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/V8DebuggerAgentImpl.h" | 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
| 8 #include "platform/inspector_protocol/Values.h" | 8 #include "platform/inspector_protocol/Values.h" |
| 9 #include "platform/v8_inspector/InjectedScript.h" | 9 #include "platform/v8_inspector/InjectedScript.h" |
| 10 #include "platform/v8_inspector/InspectedContext.h" | 10 #include "platform/v8_inspector/InspectedContext.h" |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 | 833 |
| 834 void V8DebuggerAgentImpl::setBlackboxPatterns(ErrorString* errorString, std::uni
que_ptr<protocol::Array<String16>> patterns) | 834 void V8DebuggerAgentImpl::setBlackboxPatterns(ErrorString* errorString, std::uni
que_ptr<protocol::Array<String16>> patterns) |
| 835 { | 835 { |
| 836 if (!patterns->length()) { | 836 if (!patterns->length()) { |
| 837 m_blackboxPattern = nullptr; | 837 m_blackboxPattern = nullptr; |
| 838 m_state->remove(DebuggerAgentState::blackboxPattern); | 838 m_state->remove(DebuggerAgentState::blackboxPattern); |
| 839 return; | 839 return; |
| 840 } | 840 } |
| 841 | 841 |
| 842 String16Builder patternBuilder; | 842 String16Builder patternBuilder; |
| 843 patternBuilder.append("("); | 843 patternBuilder.append('('); |
| 844 for (size_t i = 0; i < patterns->length() - 1; ++i) | 844 for (size_t i = 0; i < patterns->length() - 1; ++i) { |
| 845 patternBuilder.append(patterns->get(i) + "|"); | 845 patternBuilder.append(patterns->get(i)); |
| 846 patternBuilder.append(patterns->get(patterns->length() - 1) + ")"); | 846 patternBuilder.append("|"); |
| 847 } |
| 848 patternBuilder.append(patterns->get(patterns->length() - 1)); |
| 849 patternBuilder.append(')'); |
| 847 String16 pattern = patternBuilder.toString(); | 850 String16 pattern = patternBuilder.toString(); |
| 848 if (!setBlackboxPattern(errorString, pattern)) | 851 if (!setBlackboxPattern(errorString, pattern)) |
| 849 return; | 852 return; |
| 850 m_state->setString(DebuggerAgentState::blackboxPattern, pattern); | 853 m_state->setString(DebuggerAgentState::blackboxPattern, pattern); |
| 851 } | 854 } |
| 852 | 855 |
| 853 bool V8DebuggerAgentImpl::setBlackboxPattern(ErrorString* errorString, const Str
ing16& pattern) | 856 bool V8DebuggerAgentImpl::setBlackboxPattern(ErrorString* errorString, const Str
ing16& pattern) |
| 854 { | 857 { |
| 855 std::unique_ptr<V8Regex> regex(new V8Regex(m_debugger, pattern, true /** cas
eSensitive */, false /** multiline */)); | 858 std::unique_ptr<V8Regex> regex(new V8Regex(m_debugger, pattern, true /** cas
eSensitive */, false /** multiline */)); |
| 856 if (!regex->isValid()) { | 859 if (!regex->isValid()) { |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 { | 1217 { |
| 1215 if (!enabled()) | 1218 if (!enabled()) |
| 1216 return; | 1219 return; |
| 1217 m_scheduledDebuggerStep = NoStep; | 1220 m_scheduledDebuggerStep = NoStep; |
| 1218 m_scripts.clear(); | 1221 m_scripts.clear(); |
| 1219 m_blackboxedPositions.clear(); | 1222 m_blackboxedPositions.clear(); |
| 1220 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1223 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1221 } | 1224 } |
| 1222 | 1225 |
| 1223 } // namespace blink | 1226 } // namespace blink |
| OLD | NEW |