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. | |
4 * | 3 * |
5 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
7 * are met: | 6 * are met: |
8 * | 7 * |
9 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
11 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
12 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
13 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 215 |
217 RefPtr<InspectorDOMStorageResource> resource = InspectorDOMStorageResource::
create(storageArea, isLocalStorage, frame); | 216 RefPtr<InspectorDOMStorageResource> resource = InspectorDOMStorageResource::
create(storageArea, isLocalStorage, frame); |
218 | 217 |
219 m_resources.set(resource->id(), resource); | 218 m_resources.set(resource->id(), resource); |
220 | 219 |
221 // Resources are only bound while visible. | 220 // Resources are only bound while visible. |
222 if (m_enabled) | 221 if (m_enabled) |
223 resource->bind(m_frontend); | 222 resource->bind(m_frontend); |
224 } | 223 } |
225 | 224 |
226 void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(const String& key, con
st String& oldValue, const String& newValue, StorageType storageType, SecurityOr
igin* securityOrigin, Page*) | 225 void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(const String&, const S
tring&, const String&, StorageType storageType, SecurityOrigin* securityOrigin,
Page*) |
227 { | 226 { |
228 if (!m_frontend || !m_enabled) | 227 if (!m_frontend || !m_enabled) |
229 return; | 228 return; |
230 | 229 |
231 String id = storageId(securityOrigin, storageType == LocalStorage); | 230 String id = storageId(securityOrigin, storageType == LocalStorage); |
232 | 231 |
233 if (id.isEmpty()) | 232 if (id.isEmpty()) |
234 return; | 233 return; |
235 | 234 |
236 if (key.isNull()) | 235 m_frontend->domstorage()->domStorageUpdated(id); |
237 m_frontend->domstorage()->domStorageItemsCleared(id); | |
238 else if (newValue.isNull()) | |
239 m_frontend->domstorage()->domStorageItemRemoved(id, key); | |
240 else if (oldValue.isNull()) | |
241 m_frontend->domstorage()->domStorageItemAdded(id, key, newValue); | |
242 else | |
243 m_frontend->domstorage()->domStorageItemUpdated(id, key, oldValue, newVa
lue); | |
244 } | 236 } |
245 | 237 |
246 void InspectorDOMStorageAgent::clearResources() | 238 void InspectorDOMStorageAgent::clearResources() |
247 { | 239 { |
248 m_resources.clear(); | 240 m_resources.clear(); |
249 } | 241 } |
250 | 242 |
251 void InspectorDOMStorageAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectI
nfo) const | 243 void InspectorDOMStorageAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjectI
nfo) const |
252 { | 244 { |
253 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorDO
MStorageAgent); | 245 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorDO
MStorageAgent); |
254 InspectorBaseAgent<InspectorDOMStorageAgent>::reportMemoryUsage(memoryObject
Info); | 246 InspectorBaseAgent<InspectorDOMStorageAgent>::reportMemoryUsage(memoryObject
Info); |
255 info.addMember(m_resources, "resources"); | 247 info.addMember(m_resources, "resources"); |
256 info.addWeakPointer(m_frontend); | 248 info.addWeakPointer(m_frontend); |
257 } | 249 } |
258 | 250 |
259 } // namespace WebCore | 251 } // namespace WebCore |
260 | 252 |
261 #endif // ENABLE(INSPECTOR) | 253 #endif // ENABLE(INSPECTOR) |
OLD | NEW |