| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 PassRefPtr<JSONObject> InspectorState::getObject(const String& propertyName) | 114 PassRefPtr<JSONObject> InspectorState::getObject(const String& propertyName) |
| 115 { | 115 { |
| 116 JSONObject::iterator it = m_properties->find(propertyName); | 116 JSONObject::iterator it = m_properties->find(propertyName); |
| 117 if (it == m_properties->end()) { | 117 if (it == m_properties->end()) { |
| 118 m_properties->setObject(propertyName, JSONObject::create()); | 118 m_properties->setObject(propertyName, JSONObject::create()); |
| 119 it = m_properties->find(propertyName); | 119 it = m_properties->find(propertyName); |
| 120 } | 120 } |
| 121 return it->value->asObject(); | 121 return it->value->asObject(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void InspectorState::trace(Visitor* visitor) |
| 125 { |
| 126 visitor->trace(m_listener); |
| 127 } |
| 128 |
| 124 InspectorState* InspectorCompositeState::createAgentState(const String& agentNam
e) | 129 InspectorState* InspectorCompositeState::createAgentState(const String& agentNam
e) |
| 125 { | 130 { |
| 126 ASSERT(m_stateObject->find(agentName) == m_stateObject->end()); | 131 ASSERT(m_stateObject->find(agentName) == m_stateObject->end()); |
| 127 ASSERT(m_inspectorStateMap.find(agentName) == m_inspectorStateMap.end()); | 132 ASSERT(m_inspectorStateMap.find(agentName) == m_inspectorStateMap.end()); |
| 128 RefPtr<JSONObject> stateProperties = JSONObject::create(); | 133 RefPtr<JSONObject> stateProperties = JSONObject::create(); |
| 129 m_stateObject->setObject(agentName, stateProperties); | 134 m_stateObject->setObject(agentName, stateProperties); |
| 130 OwnPtr<InspectorState> statePtr = adoptPtr(new InspectorState(this, statePro
perties)); | 135 OwnPtrWillBeRawPtr<InspectorState> statePtr = adoptPtrWillBeNoop(new Inspect
orState(this, stateProperties)); |
| 131 InspectorState* state = statePtr.get(); | 136 InspectorState* state = statePtr.get(); |
| 132 m_inspectorStateMap.add(agentName, statePtr.release()); | 137 m_inspectorStateMap.add(agentName, statePtr.release()); |
| 133 return state; | 138 return state; |
| 134 } | 139 } |
| 135 | 140 |
| 136 void InspectorCompositeState::loadFromCookie(const String& inspectorCompositeSta
teCookie) | 141 void InspectorCompositeState::loadFromCookie(const String& inspectorCompositeSta
teCookie) |
| 137 { | 142 { |
| 138 RefPtr<JSONValue> cookie = parseJSON(inspectorCompositeStateCookie); | 143 RefPtr<JSONValue> cookie = parseJSON(inspectorCompositeStateCookie); |
| 139 if (cookie) | 144 if (cookie) |
| 140 m_stateObject = cookie->asObject(); | 145 m_stateObject = cookie->asObject(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 161 { | 166 { |
| 162 m_isMuted = false; | 167 m_isMuted = false; |
| 163 } | 168 } |
| 164 | 169 |
| 165 void InspectorCompositeState::inspectorStateUpdated() | 170 void InspectorCompositeState::inspectorStateUpdated() |
| 166 { | 171 { |
| 167 if (m_client && !m_isMuted) | 172 if (m_client && !m_isMuted) |
| 168 m_client->updateInspectorStateCookie(m_stateObject->toJSONString()); | 173 m_client->updateInspectorStateCookie(m_stateObject->toJSONString()); |
| 169 } | 174 } |
| 170 | 175 |
| 176 void InspectorCompositeState::trace(Visitor* visitor) |
| 177 { |
| 178 #if ENABLE(OILPAN) |
| 179 visitor->trace(m_inspectorStateMap); |
| 180 #endif |
| 181 } |
| 182 |
| 171 } // namespace blink | 183 } // namespace blink |
| 172 | 184 |
| OLD | NEW |