Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: Source/core/inspector/InspectorDOMStorageAgent.cpp

Issue 898593002: DevTools: use per-LocalFrame instrumenting agents instead of per-Page ones. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698