OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/inspector/v8-debugger-agent-impl.h" | 5 #include "src/inspector/v8-debugger-agent-impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/debug/debug-interface.h" | 9 #include "src/debug/debug-interface.h" |
10 #include "src/inspector/injected-script.h" | 10 #include "src/inspector/injected-script.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 return ":debug"; | 69 return ":debug"; |
70 case V8DebuggerAgentImpl::MonitorCommandBreakpointSource: | 70 case V8DebuggerAgentImpl::MonitorCommandBreakpointSource: |
71 return ":monitor"; | 71 return ":monitor"; |
72 } | 72 } |
73 return String16(); | 73 return String16(); |
74 } | 74 } |
75 | 75 |
76 static String16 generateBreakpointId( | 76 static String16 generateBreakpointId( |
77 const String16& scriptId, int lineNumber, int columnNumber, | 77 const String16& scriptId, int lineNumber, int columnNumber, |
78 V8DebuggerAgentImpl::BreakpointSource source) { | 78 V8DebuggerAgentImpl::BreakpointSource source) { |
79 return scriptId + ":" + String16::fromInteger(lineNumber) + ":" + | 79 String16Builder builder; |
dgozman
2016/11/15 15:32:25
Just curious why builder and not concat with fromI
Clemens Hammacher
2016/11/15 17:00:44
Performance ;)
| |
80 String16::fromInteger(columnNumber) + breakpointIdSuffix(source); | 80 builder.append(scriptId); |
81 builder.append(':'); | |
82 builder.appendNumber(lineNumber); | |
83 builder.append(':'); | |
84 builder.appendNumber(columnNumber); | |
85 builder.append(breakpointIdSuffix(source)); | |
86 return builder.toString(); | |
81 } | 87 } |
82 | 88 |
83 static bool positionComparator(const std::pair<int, int>& a, | 89 static bool positionComparator(const std::pair<int, int>& a, |
84 const std::pair<int, int>& b) { | 90 const std::pair<int, int>& b) { |
85 if (a.first != b.first) return a.first < b.first; | 91 if (a.first != b.first) return a.first < b.first; |
86 return a.second < b.second; | 92 return a.second < b.second; |
87 } | 93 } |
88 | 94 |
89 static std::unique_ptr<protocol::Debugger::Location> buildProtocolLocation( | 95 static std::unique_ptr<protocol::Debugger::Location> buildProtocolLocation( |
90 const String16& scriptId, int lineNumber, int columnNumber) { | 96 const String16& scriptId, int lineNumber, int columnNumber) { |
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1224 | 1230 |
1225 void V8DebuggerAgentImpl::reset() { | 1231 void V8DebuggerAgentImpl::reset() { |
1226 if (!enabled()) return; | 1232 if (!enabled()) return; |
1227 m_scheduledDebuggerStep = NoStep; | 1233 m_scheduledDebuggerStep = NoStep; |
1228 m_scripts.clear(); | 1234 m_scripts.clear(); |
1229 m_blackboxedPositions.clear(); | 1235 m_blackboxedPositions.clear(); |
1230 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1236 m_breakpointIdToDebuggerBreakpointIds.clear(); |
1231 } | 1237 } |
1232 | 1238 |
1233 } // namespace v8_inspector | 1239 } // namespace v8_inspector |
OLD | NEW |