Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: src/inspector/v8-debugger.cc

Issue 2688243004: [inspector] migrated Debugger.setBreakpointsActive to native (Closed)
Patch Set: revert bigger part :) Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/inspector/debugger_script_externs.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 ->Get(context, toV8StringInternalized(m_isolate, "clearBreakpoints")) 303 ->Get(context, toV8StringInternalized(m_isolate, "clearBreakpoints"))
304 .ToLocalChecked()); 304 .ToLocalChecked());
305 v8::debug::Call(debuggerContext(), clearBreakpoints).ToLocalChecked(); 305 v8::debug::Call(debuggerContext(), clearBreakpoints).ToLocalChecked();
306 } 306 }
307 307
308 void V8Debugger::setBreakpointsActivated(bool activated) { 308 void V8Debugger::setBreakpointsActivated(bool activated) {
309 if (!enabled()) { 309 if (!enabled()) {
310 UNREACHABLE(); 310 UNREACHABLE();
311 return; 311 return;
312 } 312 }
313 v8::HandleScope scope(m_isolate); 313 v8::debug::SetBreakPointsActive(m_isolate, activated);
314 v8::Local<v8::Context> context = debuggerContext();
315 v8::Context::Scope contextScope(context);
316
317 v8::Local<v8::Object> info = v8::Object::New(m_isolate);
318 bool success = false;
319 success = info->Set(context, toV8StringInternalized(m_isolate, "enabled"),
320 v8::Boolean::New(m_isolate, activated))
321 .FromMaybe(false);
322 DCHECK(success);
323 USE(success);
324 v8::Local<v8::Function> setBreakpointsActivated =
325 v8::Local<v8::Function>::Cast(
326 m_debuggerScript.Get(m_isolate)
327 ->Get(context, toV8StringInternalized(m_isolate,
328 "setBreakpointsActivated"))
329 .ToLocalChecked());
330 v8::debug::Call(debuggerContext(), setBreakpointsActivated, info)
331 .ToLocalChecked();
332
333 m_breakpointsActivated = activated; 314 m_breakpointsActivated = activated;
334 } 315 }
335 316
336 v8::debug::ExceptionBreakState V8Debugger::getPauseOnExceptionsState() { 317 v8::debug::ExceptionBreakState V8Debugger::getPauseOnExceptionsState() {
337 DCHECK(enabled()); 318 DCHECK(enabled());
338 return m_pauseOnExceptionsState; 319 return m_pauseOnExceptionsState;
339 } 320 }
340 321
341 void V8Debugger::setPauseOnExceptionsState( 322 void V8Debugger::setPauseOnExceptionsState(
342 v8::debug::ExceptionBreakState pauseOnExceptionsState) { 323 v8::debug::ExceptionBreakState pauseOnExceptionsState) {
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 960
980 size_t stackSize = 961 size_t stackSize =
981 fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1; 962 fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1;
982 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) 963 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId))
983 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; 964 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture;
984 965
985 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); 966 return V8StackTraceImpl::capture(this, contextGroupId, stackSize);
986 } 967 }
987 968
988 } // namespace v8_inspector 969 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/inspector/debugger_script_externs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698