Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp

Issue 1621923002: [DevTools] Remove InspectorState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: to JSONObject Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 cb315a6535549c4a8d639364df80f4d26614b73c..c42961915a822cbe81384f9b8cb36a970eef1b7a 100644
--- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
+++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
@@ -58,7 +58,6 @@
#include "core/inspector/InspectorProfilerAgent.h"
#include "core/inspector/InspectorResourceAgent.h"
#include "core/inspector/InspectorResourceContentLoader.h"
-#include "core/inspector/InspectorState.h"
#include "core/inspector/InspectorTaskRunner.h"
#include "core/inspector/InspectorTimelineAgent.h"
#include "core/inspector/InspectorTracingAgent.h"
@@ -319,7 +318,6 @@ WebDevToolsAgentImpl::WebDevToolsAgentImpl(
, m_instrumentingAgents(m_webLocalFrameImpl->frame()->instrumentingAgents())
, m_injectedScriptManager(InjectedScriptManager::createForPage())
, m_resourceContentLoader(InspectorResourceContentLoader::create(m_webLocalFrameImpl->frame()))
- , m_state(adoptPtr(new InspectorCompositeState(this)))
, m_overlay(overlay)
, m_inspectedFrames(InspectedFrames::create(m_webLocalFrameImpl->frame()))
, m_inspectorAgent(nullptr)
@@ -330,9 +328,10 @@ WebDevToolsAgentImpl::WebDevToolsAgentImpl(
, m_tracingAgent(nullptr)
, m_pageRuntimeAgent(nullptr)
, m_pageConsoleAgent(nullptr)
- , m_agents(m_instrumentingAgents.get(), m_state.get())
+ , m_agents(m_instrumentingAgents.get())
, m_deferredAgentsInitialized(false)
, m_sessionId(0)
+ , m_stateMuted(false)
{
ASSERT(isMainThread());
ASSERT(m_webLocalFrameImpl->frame());
@@ -512,7 +511,7 @@ void WebDevToolsAgentImpl::attach(const WebString& hostId, int sessionId)
m_inspectorFrontend = adoptPtr(new InspectorFrontend(this));
// We can reconnect to existing front-end -> unmute state.
- m_state->unmute();
+ m_stateMuted = false;
m_agents.setFrontend(m_inspectorFrontend.get());
InspectorInstrumentation::registerInstrumentingAgents(m_instrumentingAgents.get());
@@ -530,8 +529,7 @@ void WebDevToolsAgentImpl::reattach(const WebString& hostId, int sessionId, cons
return;
attach(hostId, sessionId);
- m_state->loadFromCookie(savedState);
- m_agents.restore();
+ m_agents.restore(savedState);
}
void WebDevToolsAgentImpl::detach()
@@ -546,7 +544,7 @@ void WebDevToolsAgentImpl::detach()
// Destroying agents would change the state, but we don't want that.
// Pre-disconnect state will be used to restore inspector agents.
- m_state->mute();
+ m_stateMuted = true;
m_agents.clearFrontend();
m_inspectorFrontend.clear();
@@ -645,8 +643,15 @@ void WebDevToolsAgentImpl::sendProtocolResponse(int sessionId, int callId, PassR
if (!m_attached)
return;
flushPendingProtocolNotifications();
- m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), m_stateCookie);
- m_stateCookie = String();
+ String stateToSend;
+ if (!m_stateMuted) {
+ stateToSend = m_agents.state();
+ if (stateToSend == m_stateCookie)
+ stateToSend = String();
+ else
+ m_stateCookie = stateToSend;
+ }
+ m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), stateToSend);
}
void WebDevToolsAgentImpl::sendProtocolNotification(PassRefPtr<JSONObject> message)
@@ -661,11 +666,6 @@ void WebDevToolsAgentImpl::flush()
flushPendingProtocolNotifications();
}
-void WebDevToolsAgentImpl::updateInspectorStateCookie(const String& state)
-{
- m_stateCookie = state;
-}
-
void WebDevToolsAgentImpl::resumeStartup()
{
m_client->resumeStartup();

Powered by Google App Engine
This is Rietveld 408576698