Chromium Code Reviews| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 *errorString = toErrorString(exceptionState); | 179 *errorString = toErrorString(exceptionState); |
| 180 } | 180 } |
| 181 | 181 |
| 182 PassRefPtr<TypeBuilder::DOMStorage::StorageId> InspectorDOMStorageAgent::storage Id(SecurityOrigin* securityOrigin, bool isLocalStorage) | 182 PassRefPtr<TypeBuilder::DOMStorage::StorageId> InspectorDOMStorageAgent::storage Id(SecurityOrigin* securityOrigin, bool isLocalStorage) |
| 183 { | 183 { |
| 184 return TypeBuilder::DOMStorage::StorageId::create() | 184 return TypeBuilder::DOMStorage::StorageId::create() |
| 185 .setSecurityOrigin(securityOrigin->toRawString()) | 185 .setSecurityOrigin(securityOrigin->toRawString()) |
| 186 .setIsLocalStorage(isLocalStorage).release(); | 186 .setIsLocalStorage(isLocalStorage).release(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(const String& key, con st String& oldValue, const String& newValue, StorageType storageType, SecurityOr igin* securityOrigin) | 189 void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(LocalFrame* frame, con st String& key, const String& oldValue, const String& newValue, StorageType stor ageType, SecurityOrigin* securityOrigin) |
| 190 { | 190 { |
| 191 if (!m_frontend || !isEnabled()) | 191 if (!m_frontend || !isEnabled() || !frame->isMainFrame()) |
|
yurys
2015/02/03 06:44:00
How are we supposed to track dom storage events in
pfeldman
2015/02/03 07:09:16
I'll replace it with the check for being pageAgent
| |
| 192 return; | 192 return; |
| 193 | 193 |
| 194 RefPtr<TypeBuilder::DOMStorage::StorageId> id = storageId(securityOrigin, st orageType == LocalStorage); | 194 RefPtr<TypeBuilder::DOMStorage::StorageId> id = storageId(securityOrigin, st orageType == LocalStorage); |
| 195 | 195 |
| 196 if (key.isNull()) | 196 if (key.isNull()) |
| 197 m_frontend->domStorageItemsCleared(id); | 197 m_frontend->domStorageItemsCleared(id); |
| 198 else if (newValue.isNull()) | 198 else if (newValue.isNull()) |
| 199 m_frontend->domStorageItemRemoved(id, key); | 199 m_frontend->domStorageItemRemoved(id, key); |
| 200 else if (oldValue.isNull()) | 200 else if (oldValue.isNull()) |
| 201 m_frontend->domStorageItemAdded(id, key, newValue); | 201 m_frontend->domStorageItemAdded(id, key, newValue); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 219 LocalFrame* frame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin) ; | 219 LocalFrame* frame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin) ; |
| 220 if (!frame) { | 220 if (!frame) { |
| 221 if (errorString) | 221 if (errorString) |
| 222 *errorString = "LocalFrame not found for the given security origin"; | 222 *errorString = "LocalFrame not found for the given security origin"; |
| 223 return nullptr; | 223 return nullptr; |
| 224 } | 224 } |
| 225 targetFrame = frame; | 225 targetFrame = frame; |
| 226 | 226 |
| 227 if (isLocalStorage) | 227 if (isLocalStorage) |
| 228 return StorageNamespace::localStorageArea(frame->document()->securityOri gin()); | 228 return StorageNamespace::localStorageArea(frame->document()->securityOri gin()); |
| 229 return StorageNamespaceController::from(m_pageAgent->page())->sessionStorage ()->storageArea(frame->document()->securityOrigin()); | 229 return StorageNamespaceController::from(frame->page())->sessionStorage()->st orageArea(frame->document()->securityOrigin()); |
|
yurys
2015/02/03 06:44:00
Frame::page() is being deprecated, you shouldn't a
pfeldman
2015/02/03 07:09:16
This part is particularly stupid. I'll follow up.
| |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace blink | 232 } // namespace blink |
| 233 | 233 |
| OLD | NEW |