| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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)) |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 int V8DebuggerImpl::willExecuteScript(v8::Local<v8::Context> context, int script
Id) |
| 771 { |
| 772 int groupId = getGroupId(context); |
| 773 if (!groupId) |
| 774 return 0; |
| 775 V8DebuggerAgentImpl* agent = m_agentsMap.get(groupId); |
| 776 if (!agent) |
| 777 return 0; |
| 778 agent->willExecuteScript(scriptId); |
| 779 return groupId; |
| 780 } |
| 781 |
| 782 void V8DebuggerImpl::didExecuteScript(int groupId) |
| 783 { |
| 784 if (!groupId) |
| 785 return; |
| 786 V8DebuggerAgentImpl* agent = m_agentsMap.get(groupId); |
| 787 if (agent) |
| 788 agent->didExecuteScript(); |
| 789 } |
| 790 |
| 791 v8::Local<v8::Value> V8DebuggerImpl::compileAndRunInternalScript(v8::Local<v8::C
ontext> context, v8::Local<v8::String> source) |
| 792 { |
| 793 v8::Local<v8::Script> script = compileInternalScript(context, source, String
()); |
| 794 if (script.IsEmpty()) |
| 795 return v8::Local<v8::Value>(); |
| 796 v8::MicrotasksScope microtasksScope(m_isolate, v8::MicrotasksScope::kDoNotRu
nMicrotasks); |
| 797 v8::Local<v8::Value> result; |
| 798 if (!script->Run(context).ToLocal(&result)) |
| 799 return v8::Local<v8::Value>(); |
| 800 return result; |
| 801 } |
| 802 |
| 803 v8::Local<v8::Script> V8DebuggerImpl::compileInternalScript(v8::Local<v8::Contex
t> context, v8::Local<v8::String> code, const String& fileName) |
| 771 { | 804 { |
| 772 // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at | 805 // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at |
| 773 // 1, whereas v8 starts at 0. | 806 // 1, whereas v8 starts at 0. |
| 774 v8::ScriptOrigin origin( | 807 v8::ScriptOrigin origin( |
| 775 toV8String(m_isolate, fileName), | 808 toV8String(m_isolate, fileName), |
| 776 v8::Integer::New(m_isolate, 0), | 809 v8::Integer::New(m_isolate, 0), |
| 777 v8::Integer::New(m_isolate, 0), | 810 v8::Integer::New(m_isolate, 0), |
| 778 v8::False(m_isolate), // sharable | 811 v8::False(m_isolate), // sharable |
| 779 v8::Local<v8::Integer>(), | 812 v8::Local<v8::Integer>(), |
| 780 v8::True(m_isolate), // internal | 813 v8::True(m_isolate), // internal |
| 781 toV8String(m_isolate, String()), // sourceMap | 814 toV8String(m_isolate, String()), // sourceMap |
| 782 v8::True(m_isolate)); // opaqueresource | 815 v8::True(m_isolate)); // opaqueresource |
| 783 v8::ScriptCompiler::Source source(code, origin); | 816 v8::ScriptCompiler::Source source(code, origin); |
| 784 v8::Local<v8::Script> script; | 817 v8::Local<v8::Script> script; |
| 785 if (!v8::ScriptCompiler::Compile(m_isolate->GetCurrentContext(), &source, v8
::ScriptCompiler::kNoCompileOptions).ToLocal(&script)) | 818 if (!v8::ScriptCompiler::Compile(context, &source, v8::ScriptCompiler::kNoCo
mpileOptions).ToLocal(&script)) |
| 786 return v8::Local<v8::Script>(); | 819 return v8::Local<v8::Script>(); |
| 787 return script; | 820 return script; |
| 788 } | 821 } |
| 789 | 822 |
| 790 PassOwnPtr<V8StackTrace> V8DebuggerImpl::createStackTrace(v8::Local<v8::StackTra
ce> stackTrace, size_t maxStackSize) | 823 PassOwnPtr<V8StackTrace> V8DebuggerImpl::createStackTrace(v8::Local<v8::StackTra
ce> stackTrace, size_t maxStackSize) |
| 791 { | 824 { |
| 792 V8DebuggerAgentImpl* agent = getAgentForContext(m_isolate->GetCurrentContext
()); | 825 V8DebuggerAgentImpl* agent = getAgentForContext(m_isolate->GetCurrentContext
()); |
| 793 return V8StackTraceImpl::create(agent, stackTrace, maxStackSize); | 826 return V8StackTraceImpl::create(agent, stackTrace, maxStackSize); |
| 794 } | 827 } |
| 795 | 828 |
| 796 PassOwnPtr<V8StackTrace> V8DebuggerImpl::captureStackTrace(size_t maxStackSize) | 829 PassOwnPtr<V8StackTrace> V8DebuggerImpl::captureStackTrace(size_t maxStackSize) |
| 797 { | 830 { |
| 798 V8DebuggerAgentImpl* agent = getAgentForContext(m_isolate->GetCurrentContext
()); | 831 V8DebuggerAgentImpl* agent = getAgentForContext(m_isolate->GetCurrentContext
()); |
| 799 return V8StackTraceImpl::capture(agent, maxStackSize); | 832 return V8StackTraceImpl::capture(agent, maxStackSize); |
| 800 } | 833 } |
| 801 | 834 |
| 802 v8::Local<v8::Context> V8DebuggerImpl::regexContext() | 835 v8::Local<v8::Context> V8DebuggerImpl::regexContext() |
| 803 { | 836 { |
| 804 if (m_regexContext.IsEmpty()) | 837 if (m_regexContext.IsEmpty()) |
| 805 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); | 838 m_regexContext.Reset(m_isolate, v8::Context::New(m_isolate)); |
| 806 return m_regexContext.Get(m_isolate); | 839 return m_regexContext.Get(m_isolate); |
| 807 } | 840 } |
| 808 | 841 |
| 809 } // namespace blink | 842 } // namespace blink |
| OLD | NEW |