| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 void InspectorDOMStorageAgent::trace(Visitor* visitor) | 81 void InspectorDOMStorageAgent::trace(Visitor* visitor) |
| 82 { | 82 { |
| 83 visitor->trace(m_pageAgent); | 83 visitor->trace(m_pageAgent); |
| 84 InspectorBaseAgent::trace(visitor); | 84 InspectorBaseAgent::trace(visitor); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void InspectorDOMStorageAgent::setFrontend(InspectorFrontend* frontend) | 87 void InspectorDOMStorageAgent::setFrontend(InspectorFrontend* frontend) |
| 88 { | 88 { |
| 89 m_frontend = frontend; | 89 m_frontend = frontend->domstorage(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void InspectorDOMStorageAgent::clearFrontend() | 92 void InspectorDOMStorageAgent::clearFrontend() |
| 93 { | 93 { |
| 94 m_frontend = 0; | 94 m_frontend = 0; |
| 95 disable(0); | 95 disable(0); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void InspectorDOMStorageAgent::restore() | 98 void InspectorDOMStorageAgent::restore() |
| 99 { | 99 { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 | 187 |
| 188 void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(const String& key, con
st String& oldValue, const String& newValue, StorageType storageType, SecurityOr
igin* securityOrigin) | 188 void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(const String& key, con
st String& oldValue, const String& newValue, StorageType storageType, SecurityOr
igin* securityOrigin) |
| 189 { | 189 { |
| 190 if (!m_frontend || !isEnabled()) | 190 if (!m_frontend || !isEnabled()) |
| 191 return; | 191 return; |
| 192 | 192 |
| 193 RefPtr<TypeBuilder::DOMStorage::StorageId> id = storageId(securityOrigin, st
orageType == LocalStorage); | 193 RefPtr<TypeBuilder::DOMStorage::StorageId> id = storageId(securityOrigin, st
orageType == LocalStorage); |
| 194 | 194 |
| 195 if (key.isNull()) | 195 if (key.isNull()) |
| 196 m_frontend->domstorage()->domStorageItemsCleared(id); | 196 m_frontend->domStorageItemsCleared(id); |
| 197 else if (newValue.isNull()) | 197 else if (newValue.isNull()) |
| 198 m_frontend->domstorage()->domStorageItemRemoved(id, key); | 198 m_frontend->domStorageItemRemoved(id, key); |
| 199 else if (oldValue.isNull()) | 199 else if (oldValue.isNull()) |
| 200 m_frontend->domstorage()->domStorageItemAdded(id, key, newValue); | 200 m_frontend->domStorageItemAdded(id, key, newValue); |
| 201 else | 201 else |
| 202 m_frontend->domstorage()->domStorageItemUpdated(id, key, oldValue, newVa
lue); | 202 m_frontend->domStorageItemUpdated(id, key, oldValue, newValue); |
| 203 } | 203 } |
| 204 | 204 |
| 205 PassOwnPtrWillBeRawPtr<StorageArea> InspectorDOMStorageAgent::findStorageArea(Er
rorString* errorString, const RefPtr<JSONObject>& storageId, LocalFrame*& target
Frame) | 205 PassOwnPtrWillBeRawPtr<StorageArea> InspectorDOMStorageAgent::findStorageArea(Er
rorString* errorString, const RefPtr<JSONObject>& storageId, LocalFrame*& target
Frame) |
| 206 { | 206 { |
| 207 String securityOrigin; | 207 String securityOrigin; |
| 208 bool isLocalStorage = false; | 208 bool isLocalStorage = false; |
| 209 bool success = storageId->getString("securityOrigin", &securityOrigin); | 209 bool success = storageId->getString("securityOrigin", &securityOrigin); |
| 210 if (success) | 210 if (success) |
| 211 success = storageId->getBoolean("isLocalStorage", &isLocalStorage); | 211 success = storageId->getBoolean("isLocalStorage", &isLocalStorage); |
| 212 if (!success) { | 212 if (!success) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 223 } | 223 } |
| 224 targetFrame = frame; | 224 targetFrame = frame; |
| 225 | 225 |
| 226 if (isLocalStorage) | 226 if (isLocalStorage) |
| 227 return StorageNamespace::localStorageArea(frame->document()->securityOri
gin()); | 227 return StorageNamespace::localStorageArea(frame->document()->securityOri
gin()); |
| 228 return m_pageAgent->page()->sessionStorage()->storageArea(frame->document()-
>securityOrigin()); | 228 return m_pageAgent->page()->sessionStorage()->storageArea(frame->document()-
>securityOrigin()); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace blink | 231 } // namespace blink |
| 232 | 232 |
| OLD | NEW |