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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp

Issue 1738073002: DevTools: introduce protocol::Value, baseline for hierarchical data in remote debugging protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/core/inspector/InspectorBaseAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp
index 101bcf960d43e5c64ef6385df3fcdb5ca20430af..41c79aba64266b914ccbf6c6732874ce6a755266 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp
@@ -30,7 +30,7 @@
#include "core/inspector/InspectorBaseAgent.h"
-#include "platform/JSONParser.h"
+#include "platform/inspector_protocol/Parser.h"
#include "wtf/PassOwnPtr.h"
namespace blink {
@@ -55,21 +55,21 @@ void InspectorAgent::appended(InstrumentingAgents* instrumentingAgents)
init();
}
-void InspectorAgent::setState(PassRefPtr<JSONObject> state)
+void InspectorAgent::setState(PassRefPtr<protocol::DictionaryValue> state)
{
m_state = state;
}
InspectorAgentRegistry::InspectorAgentRegistry(InstrumentingAgents* instrumentingAgents)
: m_instrumentingAgents(instrumentingAgents)
- , m_state(JSONObject::create())
+ , m_state(protocol::DictionaryValue::create())
{
}
void InspectorAgentRegistry::append(PassOwnPtrWillBeRawPtr<InspectorAgent> agent)
{
ASSERT(m_state->find(agent->name()) == m_state->end());
- RefPtr<JSONObject> agentState = JSONObject::create();
+ RefPtr<protocol::DictionaryValue> agentState = protocol::DictionaryValue::create();
m_state->setObject(agent->name(), agentState);
agent->setState(agentState);
agent->appended(m_instrumentingAgents);
@@ -90,16 +90,16 @@ void InspectorAgentRegistry::clearFrontend()
void InspectorAgentRegistry::restore(const String& savedState)
{
- RefPtr<JSONValue> state = parseJSON(savedState);
+ RefPtr<protocol::Value> state = protocol::parseJSON(savedState);
if (state)
- m_state = JSONObject::cast(state);
+ m_state = protocol::DictionaryValue::cast(state);
if (!m_state)
- m_state = JSONObject::create();
+ m_state = protocol::DictionaryValue::create();
for (size_t i = 0; i < m_agents.size(); i++) {
- RefPtr<JSONObject> agentState = m_state->getObject(m_agents[i]->name());
+ RefPtr<protocol::DictionaryValue> agentState = m_state->getObject(m_agents[i]->name());
if (!agentState) {
- agentState = JSONObject::create();
+ agentState = protocol::DictionaryValue::create();
m_state->setObject(m_agents[i]->name(), agentState);
}
m_agents[i]->setState(agentState);

Powered by Google App Engine
This is Rietveld 408576698