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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp

Issue 1769273004: Remove V8RecrusionScope, cleanup call sites. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments, a couple more tests Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 } 56 }
57 57
58 static bool inLiveEditScope = false; 58 static bool inLiveEditScope = false;
59 59
60 v8::MaybeLocal<v8::Value> V8DebuggerImpl::callDebuggerMethod(const char* functio nName, int argc, v8::Local<v8::Value> argv[]) 60 v8::MaybeLocal<v8::Value> V8DebuggerImpl::callDebuggerMethod(const char* functio nName, int argc, v8::Local<v8::Value> argv[])
61 { 61 {
62 v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate); 62 v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate);
63 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(debuggerScr ipt->Get(v8InternalizedString(functionName))); 63 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(debuggerScr ipt->Get(v8InternalizedString(functionName)));
64 ASSERT(m_isolate->InContext()); 64 ASSERT(m_isolate->InContext());
65 return m_client->callInternalFunction(function, debuggerScript, argc, argv); 65 return function->Call(m_isolate->GetCurrentContext(), debuggerScript, argc, argv);
66 } 66 }
67 67
68 PassOwnPtr<V8Debugger> V8Debugger::create(v8::Isolate* isolate, V8DebuggerClient * client) 68 PassOwnPtr<V8Debugger> V8Debugger::create(v8::Isolate* isolate, V8DebuggerClient * client)
69 { 69 {
70 return adoptPtr(new V8DebuggerImpl(isolate, client)); 70 return adoptPtr(new V8DebuggerImpl(isolate, client));
71 } 71 }
72 72
73 V8DebuggerImpl::V8DebuggerImpl(v8::Isolate* isolate, V8DebuggerClient* client) 73 V8DebuggerImpl::V8DebuggerImpl(v8::Isolate* isolate, V8DebuggerClient* client)
74 : m_isolate(isolate) 74 : m_isolate(isolate)
75 , m_client(client) 75 , m_client(client)
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 void V8DebuggerImpl::getCompiledScripts(int contextGroupId, protocol::Vector<V8D ebuggerParsedScript>& result) 187 void V8DebuggerImpl::getCompiledScripts(int contextGroupId, protocol::Vector<V8D ebuggerParsedScript>& result)
188 { 188 {
189 v8::HandleScope scope(m_isolate); 189 v8::HandleScope scope(m_isolate);
190 v8::Context::Scope contextScope(debuggerContext()); 190 v8::Context::Scope contextScope(debuggerContext());
191 191
192 v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate); 192 v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate);
193 ASSERT(!debuggerScript->IsUndefined()); 193 ASSERT(!debuggerScript->IsUndefined());
194 v8::Local<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(d ebuggerScript->Get(v8InternalizedString("getScripts"))); 194 v8::Local<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(d ebuggerScript->Get(v8InternalizedString("getScripts")));
195 v8::Local<v8::Value> argv[] = { v8::Integer::New(m_isolate, contextGroupId) }; 195 v8::Local<v8::Value> argv[] = { v8::Integer::New(m_isolate, contextGroupId) };
196 v8::Local<v8::Value> value; 196 v8::Local<v8::Value> value;
197 if (!m_client->callInternalFunction(getScriptsFunction, debuggerScript, WTF_ ARRAY_LENGTH(argv), argv).ToLocal(&value)) 197 if (!getScriptsFunction->Call(debuggerContext(), debuggerScript, WTF_ARRAY_L ENGTH(argv), argv).ToLocal(&value))
pfeldman 2016/03/08 20:23:21 It seems error-prone that you manipulate two conte
dgozman 2016/03/09 22:01:53 I think we don't. Removed.
198 return; 198 return;
199 ASSERT(value->IsArray()); 199 ASSERT(value->IsArray());
200 v8::Local<v8::Array> scriptsArray = v8::Local<v8::Array>::Cast(value); 200 v8::Local<v8::Array> scriptsArray = v8::Local<v8::Array>::Cast(value);
201 result.resize(scriptsArray->Length()); 201 result.resize(scriptsArray->Length());
202 for (unsigned i = 0; i < scriptsArray->Length(); ++i) 202 for (unsigned i = 0; i < scriptsArray->Length(); ++i)
203 result[i] = createParsedScript(v8::Local<v8::Object>::Cast(scriptsArray- >Get(v8::Integer::New(m_isolate, i))), true); 203 result[i] = createParsedScript(v8::Local<v8::Object>::Cast(scriptsArray- >Get(v8::Integer::New(m_isolate, i))), true);
204 } 204 }
205 205
206 String V8DebuggerImpl::setBreakpoint(const String& sourceID, const ScriptBreakpo int& scriptBreakpoint, int* actualLineNumber, int* actualColumnNumber, bool inte rstatementLocation) 206 String V8DebuggerImpl::setBreakpoint(const String& sourceID, const ScriptBreakpo int& scriptBreakpoint, int* actualLineNumber, int* actualColumnNumber, bool inte rstatementLocation)
207 { 207 {
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 if (m_executionState.IsEmpty()) { 462 if (m_executionState.IsEmpty()) {
463 v8::Local<v8::Function> currentCallFrameFunction = v8::Local<v8::Functio n>::Cast(m_debuggerScript.Get(m_isolate)->Get(v8InternalizedString("currentCallF rame"))); 463 v8::Local<v8::Function> currentCallFrameFunction = v8::Local<v8::Functio n>::Cast(m_debuggerScript.Get(m_isolate)->Get(v8InternalizedString("currentCallF rame")));
464 currentCallFrameV8 = v8::Debug::Call(debuggerContext(), currentCallFrame Function).ToLocalChecked(); 464 currentCallFrameV8 = v8::Debug::Call(debuggerContext(), currentCallFrame Function).ToLocalChecked();
465 } else { 465 } else {
466 v8::Local<v8::Value> argv[] = { m_executionState }; 466 v8::Local<v8::Value> argv[] = { m_executionState };
467 currentCallFrameV8 = callDebuggerMethod("currentCallFrame", WTF_ARRAY_LE NGTH(argv), argv).ToLocalChecked(); 467 currentCallFrameV8 = callDebuggerMethod("currentCallFrame", WTF_ARRAY_LE NGTH(argv), argv).ToLocalChecked();
468 } 468 }
469 ASSERT(!currentCallFrameV8.IsEmpty()); 469 ASSERT(!currentCallFrameV8.IsEmpty());
470 if (!currentCallFrameV8->IsObject()) 470 if (!currentCallFrameV8->IsObject())
471 return nullptr; 471 return nullptr;
472 return JavaScriptCallFrame::create(m_client, debuggerContext(), v8::Local<v8 ::Object>::Cast(currentCallFrameV8)); 472 return JavaScriptCallFrame::create(debuggerContext(), v8::Local<v8::Object>: :Cast(currentCallFrameV8));
473 } 473 }
474 474
475 v8::Local<v8::Object> V8DebuggerImpl::currentCallFrames() 475 v8::Local<v8::Object> V8DebuggerImpl::currentCallFrames()
476 { 476 {
477 if (!m_isolate->InContext()) 477 if (!m_isolate->InContext())
478 return v8::Local<v8::Object>(); 478 return v8::Local<v8::Object>();
479 479
480 // Filter out stack traces entirely consisting of V8's internal scripts. 480 // Filter out stack traces entirely consisting of V8's internal scripts.
481 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(m_i solate, 1); 481 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(m_i solate, 1);
482 if (!stackTrace->GetFrameCount()) 482 if (!stackTrace->GetFrameCount())
483 return v8::Local<v8::Object>(); 483 return v8::Local<v8::Object>();
484 484
485 OwnPtr<JavaScriptCallFrame> currentCallFrame = wrapCallFrames(); 485 OwnPtr<JavaScriptCallFrame> currentCallFrame = wrapCallFrames();
486 if (!currentCallFrame) 486 if (!currentCallFrame)
487 return v8::Local<v8::Object>(); 487 return v8::Local<v8::Object>();
488 488
489 v8::Local<v8::FunctionTemplate> wrapperTemplate = v8::Local<v8::FunctionTemp late>::New(m_isolate, m_callFrameWrapperTemplate); 489 v8::Local<v8::FunctionTemplate> wrapperTemplate = v8::Local<v8::FunctionTemp late>::New(m_isolate, m_callFrameWrapperTemplate);
490 v8::Local<v8::Context> context = m_pausedContext.IsEmpty() ? m_isolate->GetC urrentContext() : m_pausedContext; 490 v8::Local<v8::Context> context = m_pausedContext.IsEmpty() ? m_isolate->GetC urrentContext() : m_pausedContext;
491 v8::Context::Scope scope(context); 491 v8::Context::Scope scope(context);
492 v8::Local<v8::Object> wrapper = V8JavaScriptCallFrame::wrap(m_client, wrappe rTemplate, context, currentCallFrame.release()); 492 v8::Local<v8::Object> wrapper = V8JavaScriptCallFrame::wrap(wrapperTemplate, context, currentCallFrame.release());
493 return wrapper; 493 return wrapper;
494 } 494 }
495 495
496 PassOwnPtr<JavaScriptCallFrame> V8DebuggerImpl::callFrameNoScopes(int index) 496 PassOwnPtr<JavaScriptCallFrame> V8DebuggerImpl::callFrameNoScopes(int index)
497 { 497 {
498 if (!m_isolate->InContext()) 498 if (!m_isolate->InContext())
499 return nullptr; 499 return nullptr;
500 v8::HandleScope handleScope(m_isolate); 500 v8::HandleScope handleScope(m_isolate);
501 501
502 v8::Local<v8::Value> currentCallFrameV8; 502 v8::Local<v8::Value> currentCallFrameV8;
503 if (m_executionState.IsEmpty()) { 503 if (m_executionState.IsEmpty()) {
504 v8::Local<v8::Function> currentCallFrameFunction = v8::Local<v8::Functio n>::Cast(m_debuggerScript.Get(m_isolate)->Get(v8InternalizedString("currentCallF rameByIndex"))); 504 v8::Local<v8::Function> currentCallFrameFunction = v8::Local<v8::Functio n>::Cast(m_debuggerScript.Get(m_isolate)->Get(v8InternalizedString("currentCallF rameByIndex")));
505 currentCallFrameV8 = v8::Debug::Call(debuggerContext(), currentCallFrame Function, v8::Integer::New(m_isolate, index)).ToLocalChecked(); 505 currentCallFrameV8 = v8::Debug::Call(debuggerContext(), currentCallFrame Function, v8::Integer::New(m_isolate, index)).ToLocalChecked();
506 } else { 506 } else {
507 v8::Local<v8::Value> argv[] = { m_executionState, v8::Integer::New(m_iso late, index) }; 507 v8::Local<v8::Value> argv[] = { m_executionState, v8::Integer::New(m_iso late, index) };
508 currentCallFrameV8 = callDebuggerMethod("currentCallFrameByIndex", WTF_A RRAY_LENGTH(argv), argv).ToLocalChecked(); 508 currentCallFrameV8 = callDebuggerMethod("currentCallFrameByIndex", WTF_A RRAY_LENGTH(argv), argv).ToLocalChecked();
509 } 509 }
510 ASSERT(!currentCallFrameV8.IsEmpty()); 510 ASSERT(!currentCallFrameV8.IsEmpty());
511 if (!currentCallFrameV8->IsObject()) 511 if (!currentCallFrameV8->IsObject())
512 return nullptr; 512 return nullptr;
513 return JavaScriptCallFrame::create(m_client, debuggerContext(), v8::Local<v8 ::Object>::Cast(currentCallFrameV8)); 513 return JavaScriptCallFrame::create(debuggerContext(), v8::Local<v8::Object>: :Cast(currentCallFrameV8));
514 } 514 }
515 515
516 static V8DebuggerImpl* toV8DebuggerImpl(v8::Local<v8::Value> data) 516 static V8DebuggerImpl* toV8DebuggerImpl(v8::Local<v8::Value> data)
517 { 517 {
518 void* p = v8::Local<v8::External>::Cast(data)->Value(); 518 void* p = v8::Local<v8::External>::Cast(data)->Value();
519 return static_cast<V8DebuggerImpl*>(p); 519 return static_cast<V8DebuggerImpl*>(p);
520 } 520 }
521 521
522 void V8DebuggerImpl::breakProgramCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info) 522 void V8DebuggerImpl::breakProgramCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info)
523 { 523 {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 void V8DebuggerImpl::v8DebugEventCallback(const v8::Debug::EventDetails& eventDe tails) 581 void V8DebuggerImpl::v8DebugEventCallback(const v8::Debug::EventDetails& eventDe tails)
582 { 582 {
583 V8DebuggerImpl* thisPtr = toV8DebuggerImpl(eventDetails.GetCallbackData()); 583 V8DebuggerImpl* thisPtr = toV8DebuggerImpl(eventDetails.GetCallbackData());
584 thisPtr->handleV8DebugEvent(eventDetails); 584 thisPtr->handleV8DebugEvent(eventDetails);
585 } 585 }
586 586
587 v8::Local<v8::Value> V8DebuggerImpl::callInternalGetterFunction(v8::Local<v8::Ob ject> object, const char* functionName) 587 v8::Local<v8::Value> V8DebuggerImpl::callInternalGetterFunction(v8::Local<v8::Ob ject> object, const char* functionName)
588 { 588 {
589 v8::Local<v8::Value> getterValue = object->Get(v8InternalizedString(function Name)); 589 v8::Local<v8::Value> getterValue = object->Get(v8InternalizedString(function Name));
590 ASSERT(!getterValue.IsEmpty() && getterValue->IsFunction()); 590 ASSERT(!getterValue.IsEmpty() && getterValue->IsFunction());
591 return m_client->callInternalFunction(v8::Local<v8::Function>::Cast(getterVa lue), object, 0, 0).ToLocalChecked(); 591 return v8::Local<v8::Function>::Cast(getterValue)->Call(m_isolate->GetCurren tContext(), object, 0, 0).ToLocalChecked();
592 } 592 }
593 593
594 void V8DebuggerImpl::handleV8DebugEvent(const v8::Debug::EventDetails& eventDeta ils) 594 void V8DebuggerImpl::handleV8DebugEvent(const v8::Debug::EventDetails& eventDeta ils)
595 { 595 {
596 if (!enabled()) 596 if (!enabled())
597 return; 597 return;
598 v8::DebugEvent event = eventDetails.GetEvent(); 598 v8::DebugEvent event = eventDetails.GetEvent();
599 if (event != v8::AsyncTaskEvent && event != v8::Break && event != v8::Except ion && event != v8::AfterCompile && event != v8::BeforeCompile && event != v8::C ompileError && event != v8::PromiseEvent) 599 if (event != v8::AsyncTaskEvent && event != v8::Break && event != v8::Except ion && event != v8::AfterCompile && event != v8::BeforeCompile && event != v8::C ompileError && event != v8::PromiseEvent)
600 return; 600 return;
601 601
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 { 690 {
691 if (!m_debuggerScript.IsEmpty()) { 691 if (!m_debuggerScript.IsEmpty()) {
692 ASSERT_NOT_REACHED(); 692 ASSERT_NOT_REACHED();
693 return; 693 return;
694 } 694 }
695 695
696 v8::HandleScope scope(m_isolate); 696 v8::HandleScope scope(m_isolate);
697 v8::Context::Scope contextScope(debuggerContext()); 697 v8::Context::Scope contextScope(debuggerContext());
698 698
699 v8::Local<v8::String> scriptValue = v8::String::NewFromUtf8(m_isolate, Debug gerScript_js, v8::NewStringType::kInternalized, sizeof(DebuggerScript_js)).ToLoc alChecked(); 699 v8::Local<v8::String> scriptValue = v8::String::NewFromUtf8(m_isolate, Debug gerScript_js, v8::NewStringType::kInternalized, sizeof(DebuggerScript_js)).ToLoc alChecked();
700 v8::Local<v8::Value> value; 700 v8::Local<v8::Value> value = compileAndRunInternalScript(debuggerContext(), scriptValue);
701 if (!m_client->compileAndRunInternalScript(scriptValue).ToLocal(&value)) 701 if (value.IsEmpty())
702 return; 702 return;
703 ASSERT(value->IsObject()); 703 ASSERT(value->IsObject());
704 m_debuggerScript.Reset(m_isolate, value.As<v8::Object>()); 704 m_debuggerScript.Reset(m_isolate, value.As<v8::Object>());
705 } 705 }
706 706
707 v8::Local<v8::Context> V8DebuggerImpl::debuggerContext() const 707 v8::Local<v8::Context> V8DebuggerImpl::debuggerContext() const
708 { 708 {
709 ASSERT(!m_debuggerContext.IsEmpty()); 709 ASSERT(!m_debuggerContext.IsEmpty());
710 return m_debuggerContext.Get(m_isolate); 710 return m_debuggerContext.Get(m_isolate);
711 } 711 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 }; 760 };
761 return callDebuggerMethod("setFunctionVariableValue", 4, argv); 761 return callDebuggerMethod("setFunctionVariableValue", 4, argv);
762 } 762 }
763 763
764 764
765 bool V8DebuggerImpl::isPaused() 765 bool V8DebuggerImpl::isPaused()
766 { 766 {
767 return !m_pausedContext.IsEmpty(); 767 return !m_pausedContext.IsEmpty();
768 } 768 }
769 769
770 v8::Local<v8::Script> V8DebuggerImpl::compileInternalScript(v8::Local<v8::Contex t>, v8::Local<v8::String> code, const String& fileName) 770 v8::MaybeLocal<v8::Value> V8DebuggerImpl::runCompiledScript(v8::Local<v8::Contex t> context, v8::Local<v8::Script> script)
771 {
772 v8::MicrotasksScope microtasksScope(m_isolate, v8::MicrotasksScope::kRunMicr otasks);
773 int groupId = getGroupId(context);
774 V8DebuggerAgentImpl* agent = groupId ? m_agentsMap.get(groupId) : nullptr;
775 if (agent)
776 agent->willExecuteScript(script->GetUnboundScript()->GetId());
777 v8::MaybeLocal<v8::Value> result = script->Run(context);
778 // Get agent from the map again, since it could have detached during script execution.
779 agent = groupId ? m_agentsMap.get(groupId) : nullptr;
780 if (agent)
781 agent->didExecuteScript();
782 return result;
783 }
784
785 v8::MaybeLocal<v8::Value> V8DebuggerImpl::callFunction(v8::Local<v8::Function> f unction, v8::Local<v8::Context> context, v8::Local<v8::Value> receiver, int argc , v8::Local<v8::Value> info[])
786 {
787 v8::MicrotasksScope microtasksScope(m_isolate, v8::MicrotasksScope::kRunMicr otasks);
788 int groupId = getGroupId(context);
789 V8DebuggerAgentImpl* agent = groupId ? m_agentsMap.get(groupId) : nullptr;
790 if (agent)
791 agent->willExecuteScript(function->ScriptId());
792 v8::MaybeLocal<v8::Value> result = function->Call(context, receiver, argc, i nfo);
793 // Get agent from the map again, since it could have detached during script execution.
794 agent = groupId ? m_agentsMap.get(groupId) : nullptr;
795 if (agent)
796 agent->didExecuteScript();
797 return result;
798 }
799
800 v8::Local<v8::Value> V8DebuggerImpl::compileAndRunInternalScript(v8::Local<v8::C ontext> context, v8::Local<v8::String> source)
801 {
802 v8::Local<v8::Script> script = compileInternalScript(context, source, String ());
803 if (script.IsEmpty())
804 return v8::Local<v8::Value>();
805 v8::MicrotasksScope microtasksScope(m_isolate, v8::MicrotasksScope::kDoNotRu nMicrotasks);
806 v8::Local<v8::Value> result;
807 if (!script->Run(context).ToLocal(&result))
808 return v8::Local<v8::Value>();
809 return result;
810 }
811
812 v8::Local<v8::Script> V8DebuggerImpl::compileInternalScript(v8::Local<v8::Contex t> context, v8::Local<v8::String> code, const String& fileName)
771 { 813 {
772 // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at 814 // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at
773 // 1, whereas v8 starts at 0. 815 // 1, whereas v8 starts at 0.
774 v8::ScriptOrigin origin( 816 v8::ScriptOrigin origin(
775 toV8String(m_isolate, fileName), 817 toV8String(m_isolate, fileName),
776 v8::Integer::New(m_isolate, 0), 818 v8::Integer::New(m_isolate, 0),
777 v8::Integer::New(m_isolate, 0), 819 v8::Integer::New(m_isolate, 0),
778 v8::False(m_isolate), // sharable 820 v8::False(m_isolate), // sharable
779 v8::Local<v8::Integer>(), 821 v8::Local<v8::Integer>(),
780 v8::True(m_isolate), // internal 822 v8::True(m_isolate), // internal
781 toV8String(m_isolate, String()), // sourceMap 823 toV8String(m_isolate, String()), // sourceMap
782 v8::True(m_isolate)); // opaqueresource 824 v8::True(m_isolate)); // opaqueresource
783 v8::ScriptCompiler::Source source(code, origin); 825 v8::ScriptCompiler::Source source(code, origin);
784 v8::Local<v8::Script> script; 826 v8::Local<v8::Script> script;
785 if (!v8::ScriptCompiler::Compile(m_isolate->GetCurrentContext(), &source, v8 ::ScriptCompiler::kNoCompileOptions).ToLocal(&script)) 827 if (!v8::ScriptCompiler::Compile(context, &source, v8::ScriptCompiler::kNoCo mpileOptions).ToLocal(&script))
786 return v8::Local<v8::Script>(); 828 return v8::Local<v8::Script>();
787 return script; 829 return script;
788 } 830 }
789 831
790 PassOwnPtr<V8StackTrace> V8DebuggerImpl::createStackTrace(v8::Local<v8::StackTra ce> stackTrace, size_t maxStackSize) 832 PassOwnPtr<V8StackTrace> V8DebuggerImpl::createStackTrace(v8::Local<v8::StackTra ce> stackTrace, size_t maxStackSize)
791 { 833 {
792 V8DebuggerAgentImpl* agent = getAgentForContext(m_isolate->GetCurrentContext ()); 834 V8DebuggerAgentImpl* agent = getAgentForContext(m_isolate->GetCurrentContext ());
793 return V8StackTraceImpl::create(agent, stackTrace, maxStackSize); 835 return V8StackTraceImpl::create(agent, stackTrace, maxStackSize);
794 } 836 }
795 837
796 PassOwnPtr<V8StackTrace> V8DebuggerImpl::captureStackTrace(size_t maxStackSize) 838 PassOwnPtr<V8StackTrace> V8DebuggerImpl::captureStackTrace(size_t maxStackSize)
797 { 839 {
798 V8DebuggerAgentImpl* agent = getAgentForContext(m_isolate->GetCurrentContext ()); 840 V8DebuggerAgentImpl* agent = getAgentForContext(m_isolate->GetCurrentContext ());
799 return V8StackTraceImpl::capture(agent, maxStackSize); 841 return V8StackTraceImpl::capture(agent, maxStackSize);
800 } 842 }
801 843
802 v8::Local<v8::Context> V8DebuggerImpl::regexContext() 844 v8::Local<v8::Context> V8DebuggerImpl::regexContext()
803 { 845 {
804 if (m_regexContext.IsEmpty()) 846 if (m_regexContext.IsEmpty())
805 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); 847 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate));
806 return m_regexContext.Get(m_isolate); 848 return m_regexContext.Get(m_isolate);
807 } 849 }
808 850
809 } // namespace blink 851 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698