Changeset 32942 in webkit
- Timestamp:
- May 6, 2008 10:31:34 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r32941 r32942 1 2008-05-06 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Sam Weinig 4 5 Fix a few bugs with the final sync'ing of LocalStorageAreas when the thread is shut down. 6 1 - A sync task actually needs to be scheduled for each LocalStorageArea when the shut down occurs. 7 2 - Pending sync timers all need to be cancelled. 8 9 * storage/LocalStorage.cpp: 10 (WebCore::LocalStorage::storageArea): 11 (WebCore::LocalStorage::close): Tell each LocalStorageArea to schedule it's final sync before scheduling 12 thread termination. 13 * storage/LocalStorage.h: Change the map to be of LocalStorageAreas instead of StorageAreas 14 15 * storage/LocalStorageArea.cpp: 16 (WebCore::LocalStorageArea::LocalStorageArea): 17 (WebCore::LocalStorageArea::~LocalStorageArea): ASSERT the timer has been cancelled, but make SURE it is 18 in release builds. 19 (WebCore::LocalStorageArea::scheduleFinalSync): Cancel the sync timer, schedule the final sync, and set the 20 "final sync scheduled" flag 21 (WebCore::LocalStorageArea::scheduleItemForSync): ASSERT that the final sync hasn't already been scheduled 22 (WebCore::LocalStorageArea::scheduleClear): Ditto 23 * storage/LocalStorageArea.h: 24 1 25 2008-05-06 Kevin Ollivier <kevino@theolliviers.com> 2 26 -
trunk/WebCore/storage/LocalStorage.cpp
r32929 r32942 64 64 // sync its existance and quota out to disk via an task of type AreaSync 65 65 66 RefPtr< StorageArea> storageArea;66 RefPtr<LocalStorageArea> storageArea; 67 67 if (storageArea = m_storageAreaMap.get(origin)) 68 68 return storageArea.release(); … … 112 112 ASSERT(isMainThread()); 113 113 114 LocalStorageAreaMap::iterator end = m_storageAreaMap.end(); 115 for (LocalStorageAreaMap::iterator it = m_storageAreaMap.begin(); it != end; ++it) 116 it->second->scheduleFinalSync(); 117 114 118 if (m_thread) { 115 119 m_thread->terminate(); -
trunk/WebCore/storage/LocalStorage.h
r32928 r32942 55 55 LocalStorage(PageGroup*, const String& path); 56 56 57 typedef HashMap<RefPtr<SecurityOrigin>, RefPtr< StorageArea>, SecurityOriginHash>StorageAreaMap;58 StorageAreaMap m_storageAreaMap;57 typedef HashMap<RefPtr<SecurityOrigin>, RefPtr<LocalStorageArea>, SecurityOriginHash> LocalStorageAreaMap; 58 LocalStorageAreaMap m_storageAreaMap; 59 59 60 60 PageGroup* m_group; -
trunk/WebCore/storage/LocalStorageArea.cpp
r32930 r32942 50 50 , m_syncTimer(this, &LocalStorageArea::syncTimerFired) 51 51 , m_itemsCleared(false) 52 , m_finalSyncScheduled(false) 52 53 , m_localStorage(localStorage) 53 54 , m_clearItemsWhileSyncing(false) … … 58 59 59 60 m_localStorage->scheduleImport(this); 61 } 62 63 LocalStorageArea::~LocalStorageArea() 64 { 65 ASSERT(!m_syncTimer.isActive()); 66 } 67 68 void LocalStorageArea::scheduleFinalSync() 69 { 70 m_syncTimer.stop(); 71 syncTimerFired(&m_syncTimer); 72 m_finalSyncScheduled = true; 60 73 } 61 74 … … 221 234 { 222 235 ASSERT(isMainThread()); 236 ASSERT(!m_finalSyncScheduled); 223 237 224 238 m_changedItems.set(key, value); … … 230 244 { 231 245 ASSERT(isMainThread()); 246 ASSERT(!m_finalSyncScheduled); 232 247 233 248 m_changedItems.clear(); -
trunk/WebCore/storage/LocalStorageArea.h
r32930 r32942 45 45 class LocalStorageArea : public StorageArea { 46 46 public: 47 virtual ~LocalStorageArea(); 48 47 49 static PassRefPtr<LocalStorageArea> create(SecurityOrigin* origin, LocalStorage* localStorage) { return adoptRef(new LocalStorageArea(origin, localStorage)); } 50 51 void scheduleFinalSync(); 48 52 49 53 private: … … 61 65 HashMap<String, String> m_changedItems; 62 66 bool m_itemsCleared; 67 68 bool m_finalSyncScheduled; 63 69 64 70 LocalStorage* m_localStorage;
Note: See TracChangeset
for help on using the changeset viewer.