void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* frame, SecurityOrigin* origin)
{
    ASSERT(isMainThread());
    v8::HandleScope handles(scriptState->isolate());
    DOMWrapperWorld& world = scriptState->world();
    debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGroupId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory::frameId(frame), scriptState->getExecutionContext()->isDocument()));
}
Esempio n. 2
0
V8Inspector::V8Inspector(v8::Isolate* isolate, v8::Local<v8::Context> context)
{
    m_debugger = V8Debugger::create(isolate, this);
    m_session = m_debugger->connect(1);
    m_session->setClient(this);
    m_state = protocol::DictionaryValue::create();
    m_state->setValue("runtime", protocol::DictionaryValue::create());
    m_state->setValue("debugger", protocol::DictionaryValue::create());
    m_state->setValue("profiler", protocol::DictionaryValue::create());
    m_state->setValue("heapProfiler", protocol::DictionaryValue::create());

    m_session->runtimeAgent()->setInspectorState(m_state->getObject("runtime"));
    m_session->debuggerAgent()->setInspectorState(m_state->getObject("debugger"));
    m_session->profilerAgent()->setInspectorState(m_state->getObject("profiler"));
    m_session->heapProfilerAgent()->setInspectorState(m_state->getObject("heapProfiler"));

    m_debugger->contextCreated(V8ContextInfo(context, 1, true, "",
        "NodeJS Main Context", "", false));
}