| Index: third_party/WebKit/Source/platform/v8_inspector/public/V8Inspector.cpp
|
| diff --git a/third_party/WebKit/Source/platform/v8_inspector/public/V8Inspector.cpp b/third_party/WebKit/Source/platform/v8_inspector/public/V8Inspector.cpp
|
| index fa4c62527626d0aa9141b88f4350db9b57ab9f73..fadab16d7ebd1edaa87cad73507c0e67e5b21d13 100644
|
| --- a/third_party/WebKit/Source/platform/v8_inspector/public/V8Inspector.cpp
|
| +++ b/third_party/WebKit/Source/platform/v8_inspector/public/V8Inspector.cpp
|
| @@ -8,30 +8,13 @@
|
| #include "platform/inspector_protocol/DispatcherBase.h"
|
| #include "platform/v8_inspector/V8StringUtil.h"
|
| #include "platform/v8_inspector/public/V8Debugger.h"
|
| -#include "platform/v8_inspector/public/V8DebuggerAgent.h"
|
| #include "platform/v8_inspector/public/V8DebuggerClient.h"
|
| -#include "platform/v8_inspector/public/V8HeapProfilerAgent.h"
|
| -#include "platform/v8_inspector/public/V8ProfilerAgent.h"
|
| -#include "platform/v8_inspector/public/V8RuntimeAgent.h"
|
|
|
| namespace blink {
|
|
|
| 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));
|
| }
|
| @@ -41,10 +24,6 @@ V8Inspector::~V8Inspector()
|
| disconnectFrontend();
|
| }
|
|
|
| -void V8Inspector::eventListeners(v8::Local<v8::Value> value, V8EventListenerInfoList& result)
|
| -{
|
| -}
|
| -
|
| bool V8Inspector::callingContextCanAccessContext(v8::Local<v8::Context> calling, v8::Local<v8::Context> target)
|
| {
|
| return true;
|
| @@ -62,44 +41,18 @@ bool V8Inspector::formatAccessorsAsProperties(v8::Local<v8::Value> value)
|
|
|
| void V8Inspector::connectFrontend(protocol::FrontendChannel* channel)
|
| {
|
| - DCHECK(!m_frontend);
|
| - m_frontend = wrapUnique(new protocol::Frontend(channel));
|
| - m_dispatcher = protocol::Dispatcher::create(channel);
|
| -
|
| - m_dispatcher->registerAgent(m_session->runtimeAgent());
|
| - m_dispatcher->registerAgent(m_session->debuggerAgent());
|
| - m_dispatcher->registerAgent(m_session->profilerAgent());
|
| - m_dispatcher->registerAgent(m_session->heapProfilerAgent());
|
| -
|
| - m_session->runtimeAgent()->setFrontend(
|
| - protocol::Runtime::Frontend::from(m_frontend.get()));
|
| - m_session->debuggerAgent()->setFrontend(
|
| - protocol::Debugger::Frontend::from(m_frontend.get()));
|
| - m_session->profilerAgent()->setFrontend(
|
| - protocol::Profiler::Frontend::from(m_frontend.get()));
|
| - m_session->heapProfilerAgent()->setFrontend(
|
| - protocol::HeapProfiler::Frontend::from(m_frontend.get()));
|
| + m_session = m_debugger->connect(1, channel, this, &m_state);
|
| }
|
|
|
| void V8Inspector::disconnectFrontend()
|
| {
|
| - if (!m_frontend)
|
| - return;
|
| - m_dispatcher->clearFrontend();
|
| - m_dispatcher.clear();
|
| -
|
| - m_session->runtimeAgent()->clearFrontend();
|
| - m_session->debuggerAgent()->clearFrontend();
|
| - m_session->profilerAgent()->clearFrontend();
|
| - m_session->heapProfilerAgent()->clearFrontend();
|
| -
|
| - m_frontend.clear();
|
| + m_session.reset();
|
| }
|
|
|
| void V8Inspector::dispatchMessageFromFrontend(const String16& message)
|
| {
|
| - if (m_dispatcher)
|
| - m_dispatcher->dispatch(1, message);
|
| + if (m_session)
|
| + m_session->dispatchProtocolMessage(message);
|
| }
|
|
|
| int V8Inspector::ensureDefaultContextInGroup(int contextGroupId)
|
| @@ -109,7 +62,6 @@ int V8Inspector::ensureDefaultContextInGroup(int contextGroupId)
|
|
|
| void V8Inspector::muteConsole()
|
| {
|
| -
|
| }
|
|
|
| void V8Inspector::unmuteConsole()
|
|
|