[WK2] Handle WebCore::SecurityOrigin objects through Ref<> where possible
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 May 2015 08:18:55 +0000 (08:18 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 May 2015 08:18:55 +0000 (08:18 +0000)
commitc132843275686315e8f09b29cf873af457d76725
treeff1cf879ce8d72adc59f762b1f86a0786c23bfde
parenta7210e744988e1a6d8c119c3673722367f0ebfb9
[WK2] Handle WebCore::SecurityOrigin objects through Ref<> where possible
https://bugs.webkit.org/show_bug.cgi?id=145373

Reviewed by Andreas Kling.

WebCore::SecurityOrigin creation functions in most cases return a
Ref<WebCore::SecurityOrigin> object. In the WebKit2 layer, those objects
were still largely converted to RefPtr<>s.

This patch switches to using Ref<> where possible. The remaining uses of
RefPtr<WebCore::SecurityOrigin> are present due to HashTables, to-be-copied
Vectors, WebCore::DatabaseManager::origins() API and code where non-null
WebCore::SecurityOrigin can't be guaranteed.

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::cfURLCacheOrigins):
* UIProcess/Storage/LocalStorageDatabase.cpp:
(WebKit::LocalStorageDatabase::create):
(WebKit::LocalStorageDatabase::LocalStorageDatabase):
(WebKit::LocalStorageDatabase::openDatabase):
(WebKit::LocalStorageDatabase::close):
* UIProcess/Storage/LocalStorageDatabase.h:
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::origins):
* UIProcess/Storage/LocalStorageDatabaseTracker.h:
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::securityOrigin):
(WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::TransientLocalStorageNamespace::origins):
(WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::StorageArea::create):
(WebKit::StorageManager::StorageArea::StorageArea):
(WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
(WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
(WebKit::StorageManager::SessionStorageNamespace::origins):
(WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
(WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
* WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
(WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setApplicationCacheOriginQuota):
(WebKit::InjectedBundle::resetApplicationCacheOriginQuota):
* WebProcess/ResourceCache/WebResourceCacheManager.cpp:
(WebKit::WebResourceCacheManager::returnCacheOrigins):
(WebKit::WebResourceCacheManager::clearCacheForOrigin):
* WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
(WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
(WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
(WebKit::WebDatabaseManager::setQuotaForOrigin):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184950 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
Source/WebKit2/NetworkProcess/NetworkProcess.cpp
Source/WebKit2/UIProcess/Storage/LocalStorageDatabase.cpp
Source/WebKit2/UIProcess/Storage/LocalStorageDatabase.h
Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp
Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h
Source/WebKit2/UIProcess/Storage/StorageManager.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp
Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm