| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 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.h" | 5 #include "src/inspector/v8-debugger.h" |
| 6 | 6 |
| 7 #include "src/inspector/debugger-script.h" | 7 #include "src/inspector/debugger-script.h" |
| 8 #include "src/inspector/inspected-context.h" | 8 #include "src/inspector/inspected-context.h" |
| 9 #include "src/inspector/protocol/Protocol.h" | 9 #include "src/inspector/protocol/Protocol.h" |
| 10 #include "src/inspector/script-breakpoint.h" | 10 #include "src/inspector/script-breakpoint.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 DCHECK(success); | 145 DCHECK(success); |
| 146 success = | 146 success = |
| 147 info->Set(context, toV8StringInternalized(m_isolate, "columnNumber"), | 147 info->Set(context, toV8StringInternalized(m_isolate, "columnNumber"), |
| 148 v8::Integer::New(m_isolate, breakpoint.column_number)) | 148 v8::Integer::New(m_isolate, breakpoint.column_number)) |
| 149 .FromMaybe(false); | 149 .FromMaybe(false); |
| 150 DCHECK(success); | 150 DCHECK(success); |
| 151 success = info->Set(context, toV8StringInternalized(m_isolate, "condition"), | 151 success = info->Set(context, toV8StringInternalized(m_isolate, "condition"), |
| 152 toV8String(m_isolate, breakpoint.condition)) | 152 toV8String(m_isolate, breakpoint.condition)) |
| 153 .FromMaybe(false); | 153 .FromMaybe(false); |
| 154 DCHECK(success); | 154 DCHECK(success); |
| 155 USE(success); |
| 155 | 156 |
| 156 v8::Local<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Cast( | 157 v8::Local<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Cast( |
| 157 m_debuggerScript.Get(m_isolate) | 158 m_debuggerScript.Get(m_isolate) |
| 158 ->Get(context, toV8StringInternalized(m_isolate, "setBreakpoint")) | 159 ->Get(context, toV8StringInternalized(m_isolate, "setBreakpoint")) |
| 159 .ToLocalChecked()); | 160 .ToLocalChecked()); |
| 160 v8::Local<v8::Value> breakpointId = | 161 v8::Local<v8::Value> breakpointId = |
| 161 v8::debug::Call(debuggerContext(), setBreakpointFunction, info) | 162 v8::debug::Call(debuggerContext(), setBreakpointFunction, info) |
| 162 .ToLocalChecked(); | 163 .ToLocalChecked(); |
| 163 if (!breakpointId->IsString()) return ""; | 164 if (!breakpointId->IsString()) return ""; |
| 164 *actualLineNumber = | 165 *actualLineNumber = |
| (...skipping 14 matching lines...) Expand all Loading... |
| 179 v8::Local<v8::Context> context = debuggerContext(); | 180 v8::Local<v8::Context> context = debuggerContext(); |
| 180 v8::Context::Scope contextScope(context); | 181 v8::Context::Scope contextScope(context); |
| 181 | 182 |
| 182 v8::Local<v8::Object> info = v8::Object::New(m_isolate); | 183 v8::Local<v8::Object> info = v8::Object::New(m_isolate); |
| 183 bool success = false; | 184 bool success = false; |
| 184 success = | 185 success = |
| 185 info->Set(context, toV8StringInternalized(m_isolate, "breakpointId"), | 186 info->Set(context, toV8StringInternalized(m_isolate, "breakpointId"), |
| 186 toV8String(m_isolate, breakpointId)) | 187 toV8String(m_isolate, breakpointId)) |
| 187 .FromMaybe(false); | 188 .FromMaybe(false); |
| 188 DCHECK(success); | 189 DCHECK(success); |
| 190 USE(success); |
| 189 | 191 |
| 190 v8::Local<v8::Function> removeBreakpointFunction = | 192 v8::Local<v8::Function> removeBreakpointFunction = |
| 191 v8::Local<v8::Function>::Cast( | 193 v8::Local<v8::Function>::Cast( |
| 192 m_debuggerScript.Get(m_isolate) | 194 m_debuggerScript.Get(m_isolate) |
| 193 ->Get(context, | 195 ->Get(context, |
| 194 toV8StringInternalized(m_isolate, "removeBreakpoint")) | 196 toV8StringInternalized(m_isolate, "removeBreakpoint")) |
| 195 .ToLocalChecked()); | 197 .ToLocalChecked()); |
| 196 v8::debug::Call(debuggerContext(), removeBreakpointFunction, info) | 198 v8::debug::Call(debuggerContext(), removeBreakpointFunction, info) |
| 197 .ToLocalChecked(); | 199 .ToLocalChecked(); |
| 198 } | 200 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 217 v8::HandleScope scope(m_isolate); | 219 v8::HandleScope scope(m_isolate); |
| 218 v8::Local<v8::Context> context = debuggerContext(); | 220 v8::Local<v8::Context> context = debuggerContext(); |
| 219 v8::Context::Scope contextScope(context); | 221 v8::Context::Scope contextScope(context); |
| 220 | 222 |
| 221 v8::Local<v8::Object> info = v8::Object::New(m_isolate); | 223 v8::Local<v8::Object> info = v8::Object::New(m_isolate); |
| 222 bool success = false; | 224 bool success = false; |
| 223 success = info->Set(context, toV8StringInternalized(m_isolate, "enabled"), | 225 success = info->Set(context, toV8StringInternalized(m_isolate, "enabled"), |
| 224 v8::Boolean::New(m_isolate, activated)) | 226 v8::Boolean::New(m_isolate, activated)) |
| 225 .FromMaybe(false); | 227 .FromMaybe(false); |
| 226 DCHECK(success); | 228 DCHECK(success); |
| 229 USE(success); |
| 227 v8::Local<v8::Function> setBreakpointsActivated = | 230 v8::Local<v8::Function> setBreakpointsActivated = |
| 228 v8::Local<v8::Function>::Cast( | 231 v8::Local<v8::Function>::Cast( |
| 229 m_debuggerScript.Get(m_isolate) | 232 m_debuggerScript.Get(m_isolate) |
| 230 ->Get(context, toV8StringInternalized(m_isolate, | 233 ->Get(context, toV8StringInternalized(m_isolate, |
| 231 "setBreakpointsActivated")) | 234 "setBreakpointsActivated")) |
| 232 .ToLocalChecked()); | 235 .ToLocalChecked()); |
| 233 v8::debug::Call(debuggerContext(), setBreakpointsActivated, info) | 236 v8::debug::Call(debuggerContext(), setBreakpointsActivated, info) |
| 234 .ToLocalChecked(); | 237 .ToLocalChecked(); |
| 235 | 238 |
| 236 m_breakpointsActivated = activated; | 239 m_breakpointsActivated = activated; |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 | 998 |
| 996 size_t stackSize = | 999 size_t stackSize = |
| 997 fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1; | 1000 fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1; |
| 998 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) | 1001 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) |
| 999 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; | 1002 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; |
| 1000 | 1003 |
| 1001 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); | 1004 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); |
| 1002 } | 1005 } |
| 1003 | 1006 |
| 1004 } // namespace v8_inspector | 1007 } // namespace v8_inspector |
| OLD | NEW |