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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorBaseAgent.cpp

Issue 1734693003: Revert of DevTools: simplify JSONValues API, prepare to the OwnPtr migration. (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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 void InspectorAgentRegistry::clearFrontend() 85 void InspectorAgentRegistry::clearFrontend()
86 { 86 {
87 for (size_t i = 0; i < m_agents.size(); i++) 87 for (size_t i = 0; i < m_agents.size(); i++)
88 m_agents[i]->clearFrontend(); 88 m_agents[i]->clearFrontend();
89 } 89 }
90 90
91 void InspectorAgentRegistry::restore(const String& savedState) 91 void InspectorAgentRegistry::restore(const String& savedState)
92 { 92 {
93 RefPtr<JSONValue> state = parseJSON(savedState); 93 RefPtr<JSONValue> state = parseJSON(savedState);
94 if (state) 94 if (state)
95 m_state = JSONObject::cast(state); 95 m_state = state->asObject();
96 if (!m_state) 96 if (!m_state)
97 m_state = JSONObject::create(); 97 m_state = JSONObject::create();
98 98
99 for (size_t i = 0; i < m_agents.size(); i++) { 99 for (size_t i = 0; i < m_agents.size(); i++) {
100 RefPtr<JSONObject> agentState = m_state->getObject(m_agents[i]->name()); 100 RefPtr<JSONObject> agentState = m_state->getObject(m_agents[i]->name());
101 if (!agentState) { 101 if (!agentState) {
102 agentState = JSONObject::create(); 102 agentState = JSONObject::create();
103 m_state->setObject(m_agents[i]->name(), agentState); 103 m_state->setObject(m_agents[i]->name(), agentState);
104 } 104 }
105 m_agents[i]->setState(agentState); 105 m_agents[i]->setState(agentState);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 void InspectorAgentRegistry::didCommitLoadForLocalFrame(LocalFrame* frame) 143 void InspectorAgentRegistry::didCommitLoadForLocalFrame(LocalFrame* frame)
144 { 144 {
145 for (size_t i = 0; i < m_agents.size(); i++) 145 for (size_t i = 0; i < m_agents.size(); i++)
146 m_agents[i]->didCommitLoadForLocalFrame(frame); 146 m_agents[i]->didCommitLoadForLocalFrame(frame);
147 } 147 }
148 148
149 } // namespace blink 149 } // namespace blink
150 150
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698