Changeset 144791 in webkit
- Timestamp:
- Mar 5, 2013, 11:43:40 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r144790 r144791 1 2013-03-05 Anders Carlsson <andersca@apple.com> 2 3 Simplify storage event dispatch somewhat 4 https://bugs.webkit.org/show_bug.cgi?id=111461 5 6 Reviewed by Beth Dakin. 7 8 Add a StorageAreaImpl::dispatchStorageEvent to avoid replicating the calls to 9 StorageEventDispatcher::dispatch there times. This is in preparation for changing the 10 interface of StorageEventDispatcher so it can be used by WebKit2. 11 12 * storage/StorageAreaImpl.cpp: 13 (WebCore::StorageAreaImpl::setItem): 14 (WebCore::StorageAreaImpl::removeItem): 15 (WebCore::StorageAreaImpl::clear): 16 (WebCore::StorageAreaImpl::dispatchStorageEvent): 17 18 * storage/StorageAreaImpl.h: 19 Reindent. 20 1 21 2013-03-05 Tony Chang <tony@chromium.org> 2 22 -
trunk/Source/WebCore/storage/StorageAreaImpl.cpp
r144103 r144791 200 200 if (m_storageAreaSync) 201 201 m_storageAreaSync->scheduleItemForSync(key, value); 202 StorageEventDispatcher::dispatch(key, oldValue, value, m_storageType, m_securityOrigin.get(), frame); 202 203 dispatchStorageEvent(key, oldValue, value, frame); 203 204 } 204 205 … … 227 228 if (m_storageAreaSync) 228 229 m_storageAreaSync->scheduleItemForSync(key, String()); 229 StorageEventDispatcher::dispatch(key, oldValue, String(), m_storageType, m_securityOrigin.get(), frame);230 dispatchStorageEvent(key, oldValue, String(), frame); 230 231 } 231 232 … … 252 253 if (m_storageAreaSync) 253 254 m_storageAreaSync->scheduleClear(); 254 StorageEventDispatcher::dispatch(String(), String(), String(), m_storageType, m_securityOrigin.get(), frame);255 dispatchStorageEvent(String(), String(), String(), frame); 255 256 } 256 257 … … 361 362 } 362 363 363 } 364 void StorageAreaImpl::dispatchStorageEvent(const String& key, const String& oldValue, const String& newValue, Frame* sourceFrame) 365 { 366 StorageEventDispatcher::dispatch(key, oldValue, newValue, m_storageType, m_securityOrigin.get(), sourceFrame); 367 } 368 369 } // namespace WebCore -
trunk/Source/WebCore/storage/StorageAreaImpl.h
r144103 r144791 36 36 namespace WebCore { 37 37 38 39 40 38 class SecurityOrigin; 39 class StorageMap; 40 class StorageAreaSync; 41 41 42 43 44 45 42 class StorageAreaImpl : public StorageArea { 43 public: 44 static PassRefPtr<StorageAreaImpl> create(StorageType, PassRefPtr<SecurityOrigin>, PassRefPtr<StorageSyncManager>, unsigned quota); 45 virtual ~StorageAreaImpl(); 46 46 47 48 49 50 51 52 53 54 47 // The HTML5 DOM Storage API (and contains) 48 virtual unsigned length(ExceptionCode&, Frame* sourceFrame) OVERRIDE; 49 virtual String key(unsigned index, ExceptionCode&, Frame* sourceFrame) OVERRIDE; 50 virtual String getItem(const String& key, ExceptionCode&, Frame* sourceFrame) OVERRIDE; 51 virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame) OVERRIDE; 52 virtual void removeItem(const String& key, ExceptionCode&, Frame* sourceFrame) OVERRIDE; 53 virtual void clear(ExceptionCode&, Frame* sourceFrame) OVERRIDE; 54 virtual bool contains(const String& key, ExceptionCode&, Frame* sourceFrame) OVERRIDE; 55 55 56 56 virtual bool canAccessStorage(Frame* sourceFrame) OVERRIDE; 57 57 58 58 virtual size_t memoryBytesUsedByCache() OVERRIDE; 59 59 60 61 62 60 virtual void incrementAccessCount(); 61 virtual void decrementAccessCount(); 62 virtual void closeDatabaseIfIdle(); 63 63 64 65 64 PassRefPtr<StorageAreaImpl> copy(); 65 void close(); 66 66 67 68 67 // Only called from a background thread. 68 void importItems(const HashMap<String, String>& items); 69 69 70 71 70 // Used to clear a StorageArea and close db before backing db file is deleted. 71 void clearForOriginDeletion(); 72 72 73 73 void sync(); 74 74 75 76 77 75 private: 76 StorageAreaImpl(StorageType, PassRefPtr<SecurityOrigin>, PassRefPtr<StorageSyncManager>, unsigned quota); 77 explicit StorageAreaImpl(StorageAreaImpl*); 78 78 79 80 81 79 void blockUntilImportComplete() const; 80 void closeDatabaseTimerFired(Timer<StorageAreaImpl>*); 81 bool disabledByPrivateBrowsingInFrame(const Frame* sourceFrame) const; 82 82 83 StorageType m_storageType; 84 RefPtr<SecurityOrigin> m_securityOrigin; 85 RefPtr<StorageMap> m_storageMap; 83 void dispatchStorageEvent(const String& key, const String& oldValue, const String& newValue, Frame* sourceFrame); 86 84 87 RefPtr<StorageAreaSync> m_storageAreaSync; 88 RefPtr<StorageSyncManager> m_storageSyncManager; 85 StorageType m_storageType; 86 RefPtr<SecurityOrigin> m_securityOrigin; 87 RefPtr<StorageMap> m_storageMap; 88 89 RefPtr<StorageAreaSync> m_storageAreaSync; 90 RefPtr<StorageSyncManager> m_storageSyncManager; 89 91 90 92 #ifndef NDEBUG 91 93 bool m_isShutdown; 92 94 #endif 93 94 95 95 unsigned m_accessCount; 96 Timer<StorageAreaImpl> m_closeDatabaseTimer; 97 }; 96 98 97 99 } // namespace WebCore
Note:
See TracChangeset
for help on using the changeset viewer.