diff options
Diffstat (limited to 'Source/WebKit2/UIProcess/Storage/StorageManager.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/Storage/StorageManager.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/Source/WebKit2/UIProcess/Storage/StorageManager.cpp b/Source/WebKit2/UIProcess/Storage/StorageManager.cpp index 5350dde05..8e5dbef8b 100644 --- a/Source/WebKit2/UIProcess/Storage/StorageManager.cpp +++ b/Source/WebKit2/UIProcess/Storage/StorageManager.cpp @@ -76,7 +76,7 @@ private: unsigned m_quotaInBytes; RefPtr<StorageMap> m_storageMap; - HashSet<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>> m_eventListeners; + HashSet<std::pair<RefPtr<CoreIPC::Connection>, uint64_t> > m_eventListeners; }; class StorageManager::LocalStorageNamespace : public ThreadSafeRefCounted<LocalStorageNamespace> { @@ -218,7 +218,7 @@ void StorageManager::StorageArea::clear() m_localStorageDatabase = nullptr; } - for (auto it = m_eventListeners.begin(), end = m_eventListeners.end(); it != end; ++it) + for (HashSet<std::pair<RefPtr<CoreIPC::Connection>, uint64_t> >::iterator it = m_eventListeners.begin(), end = m_eventListeners.end(); it != end; ++it) it->first->send(Messages::StorageAreaMap::ClearCache(), it->second); } @@ -240,7 +240,7 @@ void StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded() void StorageManager::StorageArea::dispatchEvents(CoreIPC::Connection* sourceConnection, uint64_t sourceStorageAreaID, const String& key, const String& oldValue, const String& newValue, const String& urlString) const { - for (HashSet<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>>::const_iterator it = m_eventListeners.begin(), end = m_eventListeners.end(); it != end; ++it) { + for (HashSet<std::pair<RefPtr<CoreIPC::Connection>, uint64_t> >::const_iterator it = m_eventListeners.begin(), end = m_eventListeners.end(); it != end; ++it) { uint64_t storageAreaID = it->first == sourceConnection ? sourceStorageAreaID : 0; it->first->send(Messages::StorageAreaMap::DispatchStorageEvent(storageAreaID, key, oldValue, newValue, urlString), it->second); @@ -292,7 +292,7 @@ void StorageManager::LocalStorageNamespace::didDestroyStorageArea(StorageArea* s void StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin(SecurityOrigin* securityOrigin) { - for (auto it = m_storageAreaMap.begin(), end = m_storageAreaMap.end(); it != end; ++it) { + for (HashMap<RefPtr<SecurityOrigin>, StorageArea*>::iterator it = m_storageAreaMap.begin(), end = m_storageAreaMap.end(); it != end; ++it) { if (it->key->equal(securityOrigin)) it->value->clear(); } @@ -300,7 +300,7 @@ void StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin(Secu void StorageManager::LocalStorageNamespace::clearAllStorageAreas() { - for (auto it = m_storageAreaMap.begin(), end = m_storageAreaMap.end(); it != end; ++it) + for (HashMap<RefPtr<SecurityOrigin>, StorageArea*>::iterator it = m_storageAreaMap.begin(), end = m_storageAreaMap.end(); it != end; ++it) it->value->clear(); } @@ -324,7 +324,7 @@ private: RefPtr<CoreIPC::Connection> m_allowedConnection; unsigned m_quotaInBytes; - HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageArea>> m_storageAreaMap; + HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageArea> > m_storageAreaMap; }; PassRefPtr<StorageManager::SessionStorageNamespace> StorageManager::SessionStorageNamespace::create(CoreIPC::Connection* allowedConnection, unsigned quotaInBytes) @@ -351,7 +351,7 @@ void StorageManager::SessionStorageNamespace::setAllowedConnection(CoreIPC::Conn PassRefPtr<StorageManager::StorageArea> StorageManager::SessionStorageNamespace::getOrCreateStorageArea(PassRefPtr<SecurityOrigin> securityOrigin) { - HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageArea>>::AddResult result = m_storageAreaMap.add(securityOrigin, 0); + HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageArea> >::AddResult result = m_storageAreaMap.add(securityOrigin, 0); if (result.isNewEntry) result.iterator->value = StorageArea::create(0, result.iterator->key, m_quotaInBytes); @@ -362,7 +362,7 @@ void StorageManager::SessionStorageNamespace::cloneTo(SessionStorageNamespace& n { ASSERT_UNUSED(newSessionStorageNamespace, newSessionStorageNamespace.isEmpty()); - for (HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageArea>>::const_iterator it = m_storageAreaMap.begin(), end = m_storageAreaMap.end(); it != end; ++it) + for (HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageArea> >::const_iterator it = m_storageAreaMap.begin(), end = m_storageAreaMap.end(); it != end; ++it) newSessionStorageNamespace.m_storageAreaMap.add(it->key, it->value->clone()); } @@ -420,7 +420,7 @@ void StorageManager::processWillCloseConnection(WebProcessProxy* webProcessProxy m_queue->dispatch(bind(&StorageManager::invalidateConnectionInternal, this, RefPtr<CoreIPC::Connection>(webProcessProxy->connection()))); } -void StorageManager::getOrigins(FunctionDispatcher* callbackDispatcher, void* context, void (*callback)(const Vector<RefPtr<WebCore::SecurityOrigin>>& securityOrigins, void* context)) +void StorageManager::getOrigins(FunctionDispatcher* callbackDispatcher, void* context, void (*callback)(const Vector<RefPtr<WebCore::SecurityOrigin> >& securityOrigins, void* context)) { m_queue->dispatch(bind(&StorageManager::getOriginsInternal, this, RefPtr<FunctionDispatcher>(callbackDispatcher), context, callback)); } @@ -440,13 +440,13 @@ void StorageManager::createLocalStorageMap(CoreIPC::Connection* connection, uint std::pair<RefPtr<CoreIPC::Connection>, uint64_t> connectionAndStorageMapIDPair(connection, storageMapID); // FIXME: This should be a message check. - ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::isValidKey(connectionAndStorageMapIDPair))); + ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::isValidKey(connectionAndStorageMapIDPair))); - HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::AddResult result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, 0); + HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::AddResult result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, 0); // FIXME: These should be a message checks. ASSERT(result.isNewEntry); - ASSERT((HashMap<uint64_t, RefPtr<LocalStorageNamespace>>::isValidKey(storageNamespaceID))); + ASSERT((HashMap<uint64_t, RefPtr<LocalStorageNamespace> >::isValidKey(storageNamespaceID))); LocalStorageNamespace* localStorageNamespace = getOrCreateLocalStorageNamespace(storageNamespaceID); @@ -462,7 +462,7 @@ void StorageManager::createLocalStorageMap(CoreIPC::Connection* connection, uint void StorageManager::createSessionStorageMap(CoreIPC::Connection* connection, uint64_t storageMapID, uint64_t storageNamespaceID, const SecurityOriginData& securityOriginData) { // FIXME: This should be a message check. - ASSERT((HashMap<uint64_t, RefPtr<SessionStorageNamespace>>::isValidKey(storageNamespaceID))); + ASSERT((HashMap<uint64_t, RefPtr<SessionStorageNamespace> >::isValidKey(storageNamespaceID))); SessionStorageNamespace* sessionStorageNamespace = m_sessionStorageNamespaces.get(storageNamespaceID); if (!sessionStorageNamespace) { // We're getting an incoming message from the web process that's for session storage for a web page @@ -473,9 +473,9 @@ void StorageManager::createSessionStorageMap(CoreIPC::Connection* connection, ui std::pair<RefPtr<CoreIPC::Connection>, uint64_t> connectionAndStorageMapIDPair(connection, storageMapID); // FIXME: This should be a message check. - ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::isValidKey(connectionAndStorageMapIDPair))); + ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::isValidKey(connectionAndStorageMapIDPair))); - HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::AddResult result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, 0); + HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::AddResult result = m_storageAreasByConnection.add(connectionAndStorageMapIDPair, 0); // FIXME: This should be a message check. ASSERT(result.isNewEntry); @@ -494,9 +494,9 @@ void StorageManager::destroyStorageMap(CoreIPC::Connection* connection, uint64_t std::pair<RefPtr<CoreIPC::Connection>, uint64_t> connectionAndStorageMapIDPair(connection, storageMapID); // FIXME: This should be a message check. - ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::isValidKey(connectionAndStorageMapIDPair))); + ASSERT((HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::isValidKey(connectionAndStorageMapIDPair))); - HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::iterator it = m_storageAreasByConnection.find(connectionAndStorageMapIDPair); + HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::iterator it = m_storageAreasByConnection.find(connectionAndStorageMapIDPair); if (it == m_storageAreasByConnection.end()) { // The connection has been removed because the last page was closed. return; @@ -588,9 +588,9 @@ void StorageManager::cloneSessionStorageNamespaceInternal(uint64_t storageNamesp void StorageManager::invalidateConnectionInternal(CoreIPC::Connection* connection) { - Vector<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>> connectionAndStorageMapIDPairsToRemove; - HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>> storageAreasByConnection = m_storageAreasByConnection; - for (HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::const_iterator it = storageAreasByConnection.begin(), end = storageAreasByConnection.end(); it != end; ++it) { + Vector<std::pair<RefPtr<CoreIPC::Connection>, uint64_t> > connectionAndStorageMapIDPairsToRemove; + HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> > storageAreasByConnection = m_storageAreasByConnection; + for (HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::const_iterator it = storageAreasByConnection.begin(), end = storageAreasByConnection.end(); it != end; ++it) { if (it->key.first != connection) continue; @@ -605,7 +605,7 @@ void StorageManager::invalidateConnectionInternal(CoreIPC::Connection* connectio StorageManager::StorageArea* StorageManager::findStorageArea(CoreIPC::Connection* connection, uint64_t storageMapID) const { std::pair<CoreIPC::Connection*, uint64_t> connectionAndStorageMapIDPair(connection, storageMapID); - if (!HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea>>::isValidKey(connectionAndStorageMapIDPair)) + if (!HashMap<std::pair<RefPtr<CoreIPC::Connection>, uint64_t>, RefPtr<StorageArea> >::isValidKey(connectionAndStorageMapIDPair)) return 0; return m_storageAreasByConnection.get(connectionAndStorageMapIDPair); @@ -613,31 +613,31 @@ StorageManager::StorageArea* StorageManager::findStorageArea(CoreIPC::Connection StorageManager::LocalStorageNamespace* StorageManager::getOrCreateLocalStorageNamespace(uint64_t storageNamespaceID) { - if (!HashMap<uint64_t, RefPtr<LocalStorageNamespace>>::isValidKey(storageNamespaceID)) + if (!HashMap<uint64_t, RefPtr<LocalStorageNamespace> >::isValidKey(storageNamespaceID)) return 0; - HashMap<uint64_t, RefPtr<LocalStorageNamespace>>::AddResult result = m_localStorageNamespaces.add(storageNamespaceID, 0); + HashMap<uint64_t, RefPtr<LocalStorageNamespace> >::AddResult result = m_localStorageNamespaces.add(storageNamespaceID, 0); if (result.isNewEntry) result.iterator->value = LocalStorageNamespace::create(this, storageNamespaceID); return result.iterator->value.get(); } -static void callCallbackFunction(void* context, void (*callbackFunction)(const Vector<RefPtr<WebCore::SecurityOrigin>>& securityOrigins, void* context), Vector<RefPtr<WebCore::SecurityOrigin>>* securityOriginsPtr) +static void callCallbackFunction(void* context, void (*callbackFunction)(const Vector<RefPtr<WebCore::SecurityOrigin> >& securityOrigins, void* context), Vector<RefPtr<WebCore::SecurityOrigin> >* securityOriginsPtr) { - OwnPtr<Vector<RefPtr<WebCore::SecurityOrigin>>> securityOrigins = adoptPtr(securityOriginsPtr); + OwnPtr<Vector<RefPtr<WebCore::SecurityOrigin> > > securityOrigins = adoptPtr(securityOriginsPtr); callbackFunction(*securityOrigins, context); } -void StorageManager::getOriginsInternal(FunctionDispatcher* dispatcher, void* context, void (*callbackFunction)(const Vector<RefPtr<WebCore::SecurityOrigin>>& securityOrigins, void* context)) +void StorageManager::getOriginsInternal(FunctionDispatcher* dispatcher, void* context, void (*callbackFunction)(const Vector<RefPtr<WebCore::SecurityOrigin> >& securityOrigins, void* context)) { - OwnPtr<Vector<RefPtr<WebCore::SecurityOrigin>>> securityOrigins = adoptPtr(new Vector<RefPtr<WebCore::SecurityOrigin>>(m_localStorageDatabaseTracker->origins())); + OwnPtr<Vector<RefPtr<WebCore::SecurityOrigin> > > securityOrigins = adoptPtr(new Vector<RefPtr<WebCore::SecurityOrigin> >(m_localStorageDatabaseTracker->origins())); dispatcher->dispatch(bind(callCallbackFunction, context, callbackFunction, securityOrigins.leakPtr())); } void StorageManager::deleteEntriesForOriginInternal(SecurityOrigin* securityOrigin) { - for (auto it = m_localStorageNamespaces.begin(), end = m_localStorageNamespaces.end(); it != end; ++it) + for (HashMap<uint64_t, RefPtr<LocalStorageNamespace> >::iterator it = m_localStorageNamespaces.begin(), end = m_localStorageNamespaces.end(); it != end; ++it) it->value->clearStorageAreasMatchingOrigin(securityOrigin); m_localStorageDatabaseTracker->deleteDatabaseWithOrigin(securityOrigin); @@ -645,7 +645,7 @@ void StorageManager::deleteEntriesForOriginInternal(SecurityOrigin* securityOrig void StorageManager::deleteAllEntriesInternal() { - for (auto it = m_localStorageNamespaces.begin(), end = m_localStorageNamespaces.end(); it != end; ++it) + for (HashMap<uint64_t, RefPtr<LocalStorageNamespace> >::iterator it = m_localStorageNamespaces.begin(), end = m_localStorageNamespaces.end(); it != end; ++it) it->value->clearAllStorageAreas(); m_localStorageDatabaseTracker->deleteAllDatabases(); |