Skip to content
Permalink
Browse files
Use Ref in another StorageManager function
https://bugs.webkit.org/show_bug.cgi?id=139700

Reviewed by Andreas Kling.

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):

Canonical link: https://commits.webkit.org/157595@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Dec 16, 2014
1 parent 52815db commit e1917b3babe8be4b6435927debbd233cd8d973cb
Showing with 16 additions and 6 deletions.
  1. +10 −0 Source/WebKit2/ChangeLog
  2. +6 −6 Source/WebKit2/UIProcess/Storage/StorageManager.cpp
@@ -1,3 +1,13 @@
2014-12-16 Anders Carlsson <andersca@apple.com>

Use Ref in another StorageManager function
https://bugs.webkit.org/show_bug.cgi?id=139700

Reviewed by Andreas Kling.

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):

2014-12-16 Anders Carlsson <andersca@apple.com>

Use Ref in StorageManager
@@ -89,7 +89,7 @@ class StorageManager::LocalStorageNamespace : public ThreadSafeRefCounted<LocalS

StorageManager* storageManager() const { return m_storageManager; }

RefPtr<StorageArea> getOrCreateStorageArea(RefPtr<SecurityOrigin>&&);
Ref<StorageArea> getOrCreateStorageArea(RefPtr<SecurityOrigin>&&);
void didDestroyStorageArea(StorageArea*);

void clearStorageAreasMatchingOrigin(SecurityOrigin*);
@@ -317,16 +317,16 @@ StorageManager::LocalStorageNamespace::~LocalStorageNamespace()
ASSERT(m_storageAreaMap.isEmpty());
}

RefPtr<StorageManager::StorageArea> StorageManager::LocalStorageNamespace::getOrCreateStorageArea(RefPtr<SecurityOrigin>&& securityOrigin)
Ref<StorageManager::StorageArea> StorageManager::LocalStorageNamespace::getOrCreateStorageArea(RefPtr<SecurityOrigin>&& securityOrigin)
{
auto result = m_storageAreaMap.add(securityOrigin, nullptr);
if (!result.isNewEntry)
return result.iterator->value;
return *result.iterator->value;

RefPtr<StorageArea> storageArea = StorageArea::create(this, result.iterator->key.copyRef(), m_quotaInBytes);
result.iterator->value = storageArea.get();
auto storageArea = StorageArea::create(this, result.iterator->key.copyRef(), m_quotaInBytes);
result.iterator->value = &storageArea.get();

return storageArea.release();
return storageArea;
}

void StorageManager::LocalStorageNamespace::didDestroyStorageArea(StorageArea* storageArea)

0 comments on commit e1917b3

Please sign in to comment.