| Index: Source/bindings/v8/ScriptDebugServer.cpp
|
| diff --git a/Source/bindings/v8/ScriptDebugServer.cpp b/Source/bindings/v8/ScriptDebugServer.cpp
|
| index 6a89c771baffb950fb1964175662fdcdabea9adc..dfb387dd6520154b7ec02e096bc45b323bc84c99 100644
|
| --- a/Source/bindings/v8/ScriptDebugServer.cpp
|
| +++ b/Source/bindings/v8/ScriptDebugServer.cpp
|
| @@ -39,6 +39,7 @@
|
| #include "ScriptObject.h"
|
| #include "V8Binding.h"
|
| #include "V8JavaScriptCallFrame.h"
|
| +#include "V8PerContextDebugData.h"
|
| #include "V8RecursionScope.h"
|
| #include <wtf/StdLibExtras.h>
|
| #include <wtf/Vector.h>
|
| @@ -92,7 +93,9 @@ public:
|
| m_utilityContext.set(v8::Context::New());
|
| if (m_utilityContext.isEmpty())
|
| return;
|
| -
|
| +
|
| + V8PerContextDebugData::setDebugDataForSystemUtility(m_utilityContext.get());
|
| +
|
| v8::Context::Scope contextScope(m_utilityContext.get());
|
|
|
| v8::TryCatch tryCatch;
|
| @@ -476,13 +479,7 @@ void ScriptDebugServer::handleV8DebugEvent(const v8::Debug::EventDetails& eventD
|
| setScriptSourceFunction->Call(m_debuggerScript.get(), 2, argv2);
|
| m_scriptPreprocessor = preprocessor.release();
|
| } else if (event == v8::AfterCompile) {
|
| - v8::Context::Scope contextScope(v8::Debug::GetDebugContext());
|
| - v8::Handle<v8::Function> onAfterCompileFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::NewSymbol("getAfterCompileScript")));
|
| - v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() };
|
| - v8::Handle<v8::Value> value = onAfterCompileFunction->Call(m_debuggerScript.get(), 1, argv);
|
| - ASSERT(value->IsObject());
|
| - v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value);
|
| - dispatchDidParseSource(listener, object);
|
| + onAfterCompile(listener, eventDetails);
|
| } else if (event == v8::Break || event == v8::Exception) {
|
| v8::Handle<v8::Value> exception;
|
| if (event == v8::Exception) {
|
| @@ -505,8 +502,21 @@ void ScriptDebugServer::handleV8DebugEvent(const v8::Debug::EventDetails& eventD
|
| }
|
| }
|
|
|
| +void ScriptDebugServer::onAfterCompile(ScriptDebugListener* listener, const v8::Debug::EventDetails& eventDetails)
|
| +{
|
| + v8::HandleScope scope;
|
| + v8::Context::Scope contextScope(v8::Debug::GetDebugContext());
|
| + v8::Handle<v8::Function> onAfterCompileFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::NewSymbol("getAfterCompileScript")));
|
| + v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() };
|
| + v8::Handle<v8::Value> value = onAfterCompileFunction->Call(m_debuggerScript.get(), 1, argv);
|
| + ASSERT(value->IsObject());
|
| + v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value);
|
| + dispatchDidParseSource(listener, object);
|
| +}
|
| +
|
| void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Object> object)
|
| {
|
| +
|
| String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("id")));
|
|
|
| ScriptDebugListener::Script script;
|
|
|