| OLD | NEW |
| 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 Loading... |
| 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 = state->asObject(); | 95 m_state = JSONObject::cast(state); |
| 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 Loading... |
| 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 |
| OLD | NEW |