| Index: third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
|
| index 5565ad04fbf58ede298e00a948a3868eb29a7dd8..62258a2b8710f2eaec185c10294079bebbc3a564 100644
|
| --- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
|
| @@ -254,9 +254,8 @@
|
|
|
| class DebuggerTask : public InspectorTaskRunner::Task {
|
| public:
|
| - DebuggerTask(int sessionId, PassOwnPtr<WebDevToolsAgent::MessageDescriptor> descriptor)
|
| - : m_sessionId(sessionId)
|
| - , m_descriptor(descriptor)
|
| + DebuggerTask(PassOwnPtr<WebDevToolsAgent::MessageDescriptor> descriptor)
|
| + : m_descriptor(descriptor)
|
| {
|
| }
|
|
|
| @@ -269,11 +268,10 @@
|
|
|
| WebDevToolsAgentImpl* agentImpl = static_cast<WebDevToolsAgentImpl*>(webagent);
|
| if (agentImpl->m_attached)
|
| - agentImpl->dispatchMessageFromFrontend(m_sessionId, m_descriptor->message());
|
| + agentImpl->dispatchMessageFromFrontend(m_descriptor->message());
|
| }
|
|
|
| private:
|
| - int m_sessionId;
|
| OwnPtr<WebDevToolsAgent::MessageDescriptor> m_descriptor;
|
| };
|
|
|
| @@ -333,7 +331,6 @@
|
| , m_pageConsoleAgent(nullptr)
|
| , m_agents(m_instrumentingAgents.get(), m_state.get())
|
| , m_deferredAgentsInitialized(false)
|
| - , m_sessionId(0)
|
| {
|
| ASSERT(isMainThread());
|
| ASSERT(m_webLocalFrameImpl->frame());
|
| @@ -500,14 +497,13 @@
|
| m_agents.append(agent);
|
| }
|
|
|
| -void WebDevToolsAgentImpl::attach(const WebString& hostId, int sessionId)
|
| +void WebDevToolsAgentImpl::attach(const WebString& hostId)
|
| {
|
| if (m_attached)
|
| return;
|
|
|
| // Set the attached bit first so that sync notifications were delivered.
|
| m_attached = true;
|
| - m_sessionId = sessionId;
|
|
|
| initializeDeferredAgents();
|
| m_resourceAgent->setHostId(hostId);
|
| @@ -526,12 +522,12 @@
|
| Platform::current()->currentThread()->addTaskObserver(this);
|
| }
|
|
|
| -void WebDevToolsAgentImpl::reattach(const WebString& hostId, int sessionId, const WebString& savedState)
|
| +void WebDevToolsAgentImpl::reattach(const WebString& hostId, const WebString& savedState)
|
| {
|
| if (m_attached)
|
| return;
|
|
|
| - attach(hostId, sessionId);
|
| + attach(hostId);
|
| m_state->loadFromCookie(savedState);
|
| m_agents.restore();
|
| }
|
| @@ -558,7 +554,6 @@
|
| InspectorInstrumentation::frontendDeleted();
|
| InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get());
|
|
|
| - m_sessionId = 0;
|
| m_attached = false;
|
| }
|
|
|
| @@ -603,21 +598,21 @@
|
| m_client->disableTracing();
|
| }
|
|
|
| -void WebDevToolsAgentImpl::dispatchOnInspectorBackend(int sessionId, const WebString& message)
|
| +void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message)
|
| {
|
| if (!m_attached)
|
| return;
|
| if (WebDevToolsAgent::shouldInterruptForMessage(message))
|
| MainThreadDebugger::instance()->taskRunner()->runPendingTasks();
|
| else
|
| - dispatchMessageFromFrontend(sessionId, message);
|
| -}
|
| -
|
| -void WebDevToolsAgentImpl::dispatchMessageFromFrontend(int sessionId, const String& message)
|
| + dispatchMessageFromFrontend(message);
|
| +}
|
| +
|
| +void WebDevToolsAgentImpl::dispatchMessageFromFrontend(const String& message)
|
| {
|
| InspectorTaskRunner::IgnoreInterruptsScope scope(MainThreadDebugger::instance()->taskRunner());
|
| if (m_inspectorBackendDispatcher)
|
| - m_inspectorBackendDispatcher->dispatch(sessionId, message);
|
| + m_inspectorBackendDispatcher->dispatch(message);
|
| }
|
|
|
| void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& pointInRootFrame)
|
| @@ -637,12 +632,12 @@
|
| m_domAgent->inspect(node);
|
| }
|
|
|
| -void WebDevToolsAgentImpl::sendProtocolResponse(int sessionId, int callId, PassRefPtr<JSONObject> message)
|
| +void WebDevToolsAgentImpl::sendProtocolResponse(int callId, PassRefPtr<JSONObject> message)
|
| {
|
| if (!m_attached)
|
| return;
|
| flushPendingProtocolNotifications();
|
| - m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), m_stateCookie);
|
| + m_client->sendProtocolMessage(callId, message->toJSONString(), m_stateCookie);
|
| m_stateCookie = String();
|
| }
|
|
|
| @@ -650,7 +645,7 @@
|
| {
|
| if (!m_attached)
|
| return;
|
| - m_notificationQueue.append(std::make_pair(m_sessionId, message));
|
| + m_notificationQueue.append(message);
|
| }
|
|
|
| void WebDevToolsAgentImpl::flush()
|
| @@ -683,11 +678,12 @@
|
|
|
| void WebDevToolsAgentImpl::flushPendingProtocolNotifications()
|
| {
|
| - if (m_attached) {
|
| - m_agents.flushPendingProtocolNotifications();
|
| - for (size_t i = 0; i < m_notificationQueue.size(); ++i)
|
| - m_client->sendProtocolMessage(m_notificationQueue[i].first, 0, m_notificationQueue[i].second->toJSONString(), WebString());
|
| - }
|
| + if (!m_attached)
|
| + return;
|
| +
|
| + m_agents.flushPendingProtocolNotifications();
|
| + for (size_t i = 0; i < m_notificationQueue.size(); ++i)
|
| + m_client->sendProtocolMessage(0, m_notificationQueue[i]->toJSONString(), WebString());
|
| m_notificationQueue.clear();
|
| }
|
|
|
| @@ -708,11 +704,11 @@
|
| flushPendingProtocolNotifications();
|
| }
|
|
|
| -void WebDevToolsAgent::interruptAndDispatch(int sessionId, MessageDescriptor* rawDescriptor)
|
| +void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* rawDescriptor)
|
| {
|
| // rawDescriptor can't be a PassOwnPtr because interruptAndDispatch is a WebKit API function.
|
| OwnPtr<MessageDescriptor> descriptor = adoptPtr(rawDescriptor);
|
| - OwnPtr<DebuggerTask> task = adoptPtr(new DebuggerTask(sessionId, descriptor.release()));
|
| + OwnPtr<DebuggerTask> task = adoptPtr(new DebuggerTask(descriptor.release()));
|
| MainThreadDebugger::interruptMainThreadAndRun(task.release());
|
| }
|
|
|
|
|