Skip to content
Permalink
Browse files
Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
https://bugs.webkit.org/show_bug.cgi?id=164720

Patch by Alex Christensen <achristensen@webkit.org> on 2016-11-14
Reviewed by Brady Eidson.

Source/WebCore:

This is adding to r208558 where we moved databaseIdentifier to SecurityOriginData so we
don't have to use SecurityOrigin in the DatabaseProcess.  This is a step towards only using
SecurityOrigin (and the SchemeRegistry) in the WebProcess. SecurityOriginData is for other
processes and IPC. There should be no change in behaviour.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::Database::securityOrigin):
* Modules/webdatabase/Database.h:
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::securityOrigin):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::tryToOpenDatabaseBackend):
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/DatabaseManagerClient.h:
(WebCore::DatabaseManagerClient::dispatchDidAddNewOrigin):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::hasAdequateQuotaForOrigin):
(WebCore::DatabaseTracker::canEstablishDatabase):
(WebCore::DatabaseTracker::retryCanEstablishDatabase):
(WebCore::DatabaseTracker::hasEntryForOriginNoLock):
(WebCore::DatabaseTracker::hasEntryForDatabase):
(WebCore::DatabaseTracker::maximumSize):
(WebCore::DatabaseTracker::originPath):
(WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
(WebCore::DatabaseTracker::fullPathForDatabase):
(WebCore::DatabaseTracker::origins):
(WebCore::DatabaseTracker::databaseNamesNoLock):
(WebCore::DatabaseTracker::databaseNames):
(WebCore::DatabaseTracker::detailsForNameAndOrigin):
(WebCore::DatabaseTracker::setDatabaseDetails):
(WebCore::DatabaseTracker::addOpenDatabase):
(WebCore::DatabaseTracker::removeOpenDatabase):
(WebCore::DatabaseTracker::originLockFor):
(WebCore::DatabaseTracker::deleteOriginLockFor):
(WebCore::DatabaseTracker::usage):
(WebCore::DatabaseTracker::quotaNoLock):
(WebCore::DatabaseTracker::quota):
(WebCore::DatabaseTracker::setQuota):
(WebCore::DatabaseTracker::addDatabase):
(WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
(WebCore::DatabaseTracker::deleteOrigin):
(WebCore::DatabaseTracker::isDeletingDatabaseOrOriginFor):
(WebCore::DatabaseTracker::recordCreatingDatabase):
(WebCore::DatabaseTracker::doneCreatingDatabase):
(WebCore::DatabaseTracker::creatingDatabase):
(WebCore::DatabaseTracker::canDeleteDatabase):
(WebCore::DatabaseTracker::recordDeletingDatabase):
(WebCore::DatabaseTracker::doneDeletingDatabase):
(WebCore::DatabaseTracker::isDeletingDatabase):
(WebCore::DatabaseTracker::canDeleteOrigin):
(WebCore::DatabaseTracker::isDeletingOrigin):
(WebCore::DatabaseTracker::recordDeletingOrigin):
(WebCore::DatabaseTracker::doneDeletingOrigin):
(WebCore::DatabaseTracker::deleteDatabase):
(WebCore::DatabaseTracker::deleteDatabaseFile):
(WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
(WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
* Modules/webdatabase/DatabaseTracker.h:
* Modules/webdatabase/SQLTransactionCoordinator.cpp:
(WebCore::getDatabaseIdentifier):
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* loader/EmptyClients.cpp:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::sessionStorage):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::maybeCreateFromDatabaseIdentifier): Deleted.
(WebCore::SecurityOrigin::createFromDatabaseIdentifier): Deleted.
* page/SecurityOrigin.h:
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::fromDatabaseIdentifier):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::SecurityOriginData):
* storage/StorageArea.h:
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
* storage/StorageEventDispatcher.h:
* storage/StorageNamespace.h:
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):

Source/WebKit:

* Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::StorageAreaImpl):
(WebKit::StorageAreaImpl::create):
(WebKit::StorageAreaImpl::dispatchStorageEvent):
* Storage/StorageAreaImpl.h:
* Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::storageArea):
(WebKit::StorageNamespaceImpl::clearOriginForDeletion):
* Storage/StorageNamespaceImpl.h:
* Storage/StorageTracker.cpp:
(WebKit::StorageTracker::origins):
(WebKit::StorageTracker::deleteOriginWithIdentifier):
(WebKit::StorageTracker::deleteOrigin):
* Storage/StorageTracker.h:
* Storage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::clearLocalStorageForOrigin):
* Storage/WebStorageNamespaceProvider.h:

Source/WebKit/mac:

* Storage/WebDatabaseManager.mm:
(-[WebDatabaseManager origins]):
(-[WebDatabaseManager databasesWithOrigin:]):
(-[WebDatabaseManager deleteOrigin:]):
(-[WebDatabaseManager deleteDatabase:withOrigin:]):
* Storage/WebDatabaseManagerClient.h:
* Storage/WebDatabaseManagerClient.mm:
(DidModifyOriginData::dispatchToMainThread):
(DidModifyOriginData::DidModifyOriginData):
(WebDatabaseManagerClient::dispatchDidModifyOrigin):
(WebDatabaseManagerClient::dispatchDidModifyDatabase):
* Storage/WebDatabaseQuotaManager.mm:
(-[WebDatabaseQuotaManager usage]):
(-[WebDatabaseQuotaManager quota]):
(-[WebDatabaseQuotaManager setQuota:]):
* Storage/WebStorageManager.mm:
(-[WebStorageManager origins]):
(-[WebStorageManager deleteOrigin:]):
* Storage/WebStorageTrackerClient.h:
* Storage/WebStorageTrackerClient.mm:
(WebStorageTrackerClient::dispatchDidModifyOrigin):
* WebCoreSupport/WebSecurityOrigin.mm:
(-[WebSecurityOrigin usage]):
(-[WebSecurityOrigin quota]):
(-[WebSecurityOrigin setQuota:]):

Source/WebKit/win:

* WebDatabaseManager.cpp:
(DidModifyOriginData::dispatchToMainThread):
(DidModifyOriginData::DidModifyOriginData):
(WebDatabaseManager::dispatchDidModifyOrigin):
(WebDatabaseManager::dispatchDidModifyDatabase):
* WebDatabaseManager.h:
* WebSecurityOrigin.cpp:
(WebSecurityOrigin::usage):
(WebSecurityOrigin::quota):
(WebSecurityOrigin::setQuota):

Source/WebKit2:

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::indexedDatabaseOrigins):
* DatabaseProcess/DatabaseProcess.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginCreateFromDatabaseIdentifier):
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::Entry::encode):
(WebKit::WebsiteData::Entry::decode):
* Shared/WebsiteData/WebsiteData.h:
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetStorageDetailsByOrigin):
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
(WebKit::LocalStorageDatabaseTracker::origins):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::exceededDatabaseQuota):
(WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
(WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchData):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::mediaKeyOrigins):
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetDatabaseQuota):
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
(WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
* WebProcess/Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::create):
(WebKit::StorageAreaImpl::StorageAreaImpl):
(WebKit::StorageAreaImpl::securityOrigin):
* WebProcess/Storage/StorageAreaImpl.h:
* WebProcess/Storage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/Storage/StorageAreaMap.h:
(WebKit::StorageAreaMap::securityOrigin):
* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
(WebKit::StorageNamespaceImpl::storageArea):
* WebProcess/Storage/StorageNamespaceImpl.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::exceededDatabaseQuota):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):

Canonical link: https://commits.webkit.org/182441@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Alex Christensen authored and webkit-commit-queue committed Nov 15, 2016
1 parent be14704 commit 377ecd74f108570ec4a43679dc5f927938dc6a75
Showing with 652 additions and 390 deletions.
  1. +95 −0 Source/WebCore/ChangeLog
  2. +4 −4 Source/WebCore/Modules/webdatabase/Database.cpp
  3. +2 −1 Source/WebCore/Modules/webdatabase/Database.h
  4. +3 −2 Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
  5. +2 −1 Source/WebCore/Modules/webdatabase/DatabaseContext.h
  6. +4 −3 Source/WebCore/Modules/webdatabase/DatabaseManager.cpp
  7. +1 −0 Source/WebCore/Modules/webdatabase/DatabaseManager.h
  8. +5 −5 Source/WebCore/Modules/webdatabase/DatabaseManagerClient.h
  9. +94 −95 Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp
  10. +41 −39 Source/WebCore/Modules/webdatabase/DatabaseTracker.h
  11. +1 −1 Source/WebCore/Modules/webdatabase/SQLTransactionCoordinator.cpp
  12. +2 −1 Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
  13. +2 −2 Source/WebCore/loader/EmptyClients.cpp
  14. +2 −1 Source/WebCore/page/DOMWindow.cpp
  15. +0 −48 Source/WebCore/page/SecurityOrigin.cpp
  16. +0 −6 Source/WebCore/page/SecurityOrigin.h
  17. +30 −0 Source/WebCore/page/SecurityOriginData.cpp
  18. +7 −0 Source/WebCore/page/SecurityOriginData.h
  19. +2 −1 Source/WebCore/storage/StorageArea.h
  20. +9 −8 Source/WebCore/storage/StorageEventDispatcher.cpp
  21. +5 −5 Source/WebCore/storage/StorageEventDispatcher.h
  22. +2 −2 Source/WebCore/storage/StorageNamespace.h
  23. +2 −1 Source/WebCore/storage/StorageNamespaceProvider.cpp
  24. +25 −0 Source/WebKit/ChangeLog
  25. +8 −10 Source/WebKit/Storage/StorageAreaImpl.cpp
  26. +5 −4 Source/WebKit/Storage/StorageAreaImpl.h
  27. +4 −4 Source/WebKit/Storage/StorageNamespaceImpl.cpp
  28. +4 −4 Source/WebKit/Storage/StorageNamespaceImpl.h
  29. +21 −7 Source/WebKit/Storage/StorageTracker.cpp
  30. +3 −2 Source/WebKit/Storage/StorageTracker.h
  31. +1 −1 Source/WebKit/Storage/WebStorageNamespaceProvider.cpp
  32. +5 −1 Source/WebKit/Storage/WebStorageNamespaceProvider.h
  33. +33 −0 Source/WebKit/mac/ChangeLog
  34. +4 −4 Source/WebKit/mac/Storage/WebDatabaseManager.mm
  35. +3 −3 Source/WebKit/mac/Storage/WebDatabaseManagerClient.h
  36. +11 −11 Source/WebKit/mac/Storage/WebDatabaseManagerClient.mm
  37. +4 −3 Source/WebKit/mac/Storage/WebDatabaseQuotaManager.mm
  38. +5 −6 Source/WebKit/mac/Storage/WebStorageManager.mm
  39. +1 −1 Source/WebKit/mac/Storage/WebStorageTrackerClient.h
  40. +12 −6 Source/WebKit/mac/Storage/WebStorageTrackerClient.mm
  41. +5 −5 Source/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm
  42. +18 −0 Source/WebKit/win/ChangeLog
  43. +17 −16 Source/WebKit/win/WebDatabaseManager.cpp
  44. +6 −2 Source/WebKit/win/WebDatabaseManager.h
  45. +4 −3 Source/WebKit/win/WebSecurityOrigin.cpp
  46. +57 −0 Source/WebKit2/ChangeLog
  47. +4 −4 Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
  48. +1 −1 Source/WebKit2/DatabaseProcess/DatabaseProcess.h
  49. +3 −2 Source/WebKit2/NetworkProcess/NetworkProcess.cpp
  50. +4 −1 Source/WebKit2/Shared/API/c/WKSecurityOriginRef.cpp
  51. +2 −2 Source/WebKit2/Shared/WebsiteData/WebsiteData.cpp
  52. +3 −6 Source/WebKit2/Shared/WebsiteData/WebsiteData.h
  53. +1 −1 Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp
  54. +1 −1 Source/WebKit2/UIProcess/API/efl/ewk_database_manager.cpp
  55. +10 −4 Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp
  56. +5 −4 Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
  57. +3 −3 Source/WebKit2/UIProcess/WebPageProxy.cpp
  58. +12 −10 Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp
  59. +1 −1 Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
  60. +2 −2 Source/WebKit2/WebProcess/MediaCache/WebMediaKeyStorageManager.cpp
  61. +7 −6 Source/WebKit2/WebProcess/Storage/StorageAreaImpl.cpp
  62. +4 −4 Source/WebKit2/WebProcess/Storage/StorageAreaImpl.h
  63. +2 −2 Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp
  64. +1 −1 Source/WebKit2/WebProcess/Storage/StorageAreaMap.h
  65. +5 −5 Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.cpp
  66. +4 −6 Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.h
  67. +5 −4 Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
  68. +1 −1 Source/WebKit2/WebProcess/WebProcess.cpp
@@ -1,3 +1,98 @@
2016-11-14 Alex Christensen <achristensen@webkit.org>

Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
https://bugs.webkit.org/show_bug.cgi?id=164720

Reviewed by Brady Eidson.

This is adding to r208558 where we moved databaseIdentifier to SecurityOriginData so we
don't have to use SecurityOrigin in the DatabaseProcess. This is a step towards only using
SecurityOrigin (and the SchemeRegistry) in the WebProcess. SecurityOriginData is for other
processes and IPC. There should be no change in behaviour.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::Database::securityOrigin):
* Modules/webdatabase/Database.h:
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::securityOrigin):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::tryToOpenDatabaseBackend):
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/DatabaseManagerClient.h:
(WebCore::DatabaseManagerClient::dispatchDidAddNewOrigin):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::hasAdequateQuotaForOrigin):
(WebCore::DatabaseTracker::canEstablishDatabase):
(WebCore::DatabaseTracker::retryCanEstablishDatabase):
(WebCore::DatabaseTracker::hasEntryForOriginNoLock):
(WebCore::DatabaseTracker::hasEntryForDatabase):
(WebCore::DatabaseTracker::maximumSize):
(WebCore::DatabaseTracker::originPath):
(WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
(WebCore::DatabaseTracker::fullPathForDatabase):
(WebCore::DatabaseTracker::origins):
(WebCore::DatabaseTracker::databaseNamesNoLock):
(WebCore::DatabaseTracker::databaseNames):
(WebCore::DatabaseTracker::detailsForNameAndOrigin):
(WebCore::DatabaseTracker::setDatabaseDetails):
(WebCore::DatabaseTracker::addOpenDatabase):
(WebCore::DatabaseTracker::removeOpenDatabase):
(WebCore::DatabaseTracker::originLockFor):
(WebCore::DatabaseTracker::deleteOriginLockFor):
(WebCore::DatabaseTracker::usage):
(WebCore::DatabaseTracker::quotaNoLock):
(WebCore::DatabaseTracker::quota):
(WebCore::DatabaseTracker::setQuota):
(WebCore::DatabaseTracker::addDatabase):
(WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
(WebCore::DatabaseTracker::deleteOrigin):
(WebCore::DatabaseTracker::isDeletingDatabaseOrOriginFor):
(WebCore::DatabaseTracker::recordCreatingDatabase):
(WebCore::DatabaseTracker::doneCreatingDatabase):
(WebCore::DatabaseTracker::creatingDatabase):
(WebCore::DatabaseTracker::canDeleteDatabase):
(WebCore::DatabaseTracker::recordDeletingDatabase):
(WebCore::DatabaseTracker::doneDeletingDatabase):
(WebCore::DatabaseTracker::isDeletingDatabase):
(WebCore::DatabaseTracker::canDeleteOrigin):
(WebCore::DatabaseTracker::isDeletingOrigin):
(WebCore::DatabaseTracker::recordDeletingOrigin):
(WebCore::DatabaseTracker::doneDeletingOrigin):
(WebCore::DatabaseTracker::deleteDatabase):
(WebCore::DatabaseTracker::deleteDatabaseFile):
(WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
(WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
* Modules/webdatabase/DatabaseTracker.h:
* Modules/webdatabase/SQLTransactionCoordinator.cpp:
(WebCore::getDatabaseIdentifier):
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* loader/EmptyClients.cpp:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::sessionStorage):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::maybeCreateFromDatabaseIdentifier): Deleted.
(WebCore::SecurityOrigin::createFromDatabaseIdentifier): Deleted.
* page/SecurityOrigin.h:
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::fromDatabaseIdentifier):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::SecurityOriginData):
* storage/StorageArea.h:
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
* storage/StorageEventDispatcher.h:
* storage/StorageNamespace.h:
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):

2016-11-14 Joseph Pecoraro <pecoraro@apple.com>

Web Inspector: Worker debugging should pause all targets and view call frames in all targets
@@ -208,7 +208,7 @@ Database::Database(DatabaseContext& context, const String& name, const String& e
{
std::lock_guard<StaticLock> locker(guidMutex);

m_guid = guidForOriginAndName(securityOrigin().toString(), name);
m_guid = guidForOriginAndName(securityOrigin().securityOrigin()->toString(), name);
guidToDatabaseMap().ensure(m_guid, [] {
return HashSet<Database*>();
}).iterator->value.add(this);
@@ -766,13 +766,13 @@ Vector<String> Database::tableNames()
return result;
}

SecurityOrigin& Database::securityOrigin()
SecurityOriginData Database::securityOrigin()
{
if (m_scriptExecutionContext->isContextThread())
return m_contextThreadSecurityOrigin.get();
return SecurityOriginData::fromSecurityOrigin(m_contextThreadSecurityOrigin.get());
auto& thread = databaseThread();
if (currentThread() == thread.getThreadID())
return m_databaseThreadSecurityOrigin.get();
return SecurityOriginData::fromSecurityOrigin(m_databaseThreadSecurityOrigin.get());
RELEASE_ASSERT_NOT_REACHED();
}

@@ -48,6 +48,7 @@ class SQLTransactionCoordinator;
class SQLTransactionErrorCallback;
class SQLTransactionWrapper;
class VoidCallback;
struct SecurityOriginData;

using DatabaseGUID = int;

@@ -108,7 +109,7 @@ class Database : public ThreadSafeRefCounted<Database> {

Vector<String> tableNames();

SecurityOrigin& securityOrigin();
SecurityOriginData securityOrigin();

void markAsDeletedAndClose();
bool deleted() const { return m_deleted; }
@@ -39,6 +39,7 @@
#include "SchemeRegistry.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
#include "SecurityOriginData.h"
#include "Settings.h"

namespace WebCore {
@@ -210,9 +211,9 @@ void DatabaseContext::databaseExceededQuota(const String& name, DatabaseDetails
ASSERT(m_scriptExecutionContext->isWorkerGlobalScope());
}

SecurityOrigin* DatabaseContext::securityOrigin() const
SecurityOriginData DatabaseContext::securityOrigin() const
{
return m_scriptExecutionContext->securityOrigin();
return SecurityOriginData::fromSecurityOrigin(*m_scriptExecutionContext->securityOrigin());
}

bool DatabaseContext::isContextThread() const
@@ -42,6 +42,7 @@ class DatabaseDetails;
class DatabaseTaskSynchronizer;
class DatabaseThread;
class SecurityOrigin;
struct SecurityOriginData;

class DatabaseContext final : public ThreadSafeRefCounted<DatabaseContext>, private ActiveDOMObject {
public:
@@ -60,7 +61,7 @@ class DatabaseContext final : public ThreadSafeRefCounted<DatabaseContext>, priv
void databaseExceededQuota(const String& name, DatabaseDetails);

using ActiveDOMObject::scriptExecutionContext;
SecurityOrigin* securityOrigin() const;
SecurityOriginData securityOrigin() const;

bool isContextThread() const;

@@ -38,6 +38,7 @@
#include "ScriptController.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
#include "SecurityOriginData.h"
#include <wtf/NeverDestroyed.h>

namespace WebCore {
@@ -176,7 +177,7 @@ ExceptionOr<Ref<Database>> DatabaseManager::tryToOpenDatabaseBackend(DatabaseCon
return openResult.releaseException();

// FIXME: What guarantees backendContext.securityOrigin() is non-null?
DatabaseTracker::singleton().setDatabaseDetails(*backendContext.securityOrigin(), name, displayName, estimatedSize);
DatabaseTracker::singleton().setDatabaseDetails(backendContext.securityOrigin(), name, displayName, estimatedSize);
return WTFMove(database);
}

@@ -243,7 +244,7 @@ String DatabaseManager::fullPathForDatabase(SecurityOrigin& origin, const String
return String();
}
}
return DatabaseTracker::singleton().fullPathForDatabase(origin, name, createIfDoesNotExist);
return DatabaseTracker::singleton().fullPathForDatabase(SecurityOriginData::fromSecurityOrigin(origin), name, createIfDoesNotExist);
}

DatabaseDetails DatabaseManager::detailsForNameAndOrigin(const String& name, SecurityOrigin& origin)
@@ -258,7 +259,7 @@ DatabaseDetails DatabaseManager::detailsForNameAndOrigin(const String& name, Sec
}
}

return DatabaseTracker::singleton().detailsForNameAndOrigin(name, origin);
return DatabaseTracker::singleton().detailsForNameAndOrigin(name, SecurityOriginData::fromSecurityOrigin(origin));
}

void DatabaseManager::logErrorMessage(ScriptExecutionContext& context, const String& message)
@@ -43,6 +43,7 @@ class DatabaseTaskSynchronizer;
class Exception;
class SecurityOrigin;
class ScriptExecutionContext;
struct SecurityOriginData;

class DatabaseManager {
WTF_MAKE_NONCOPYABLE(DatabaseManager);
@@ -29,20 +29,20 @@

namespace WebCore {

class SecurityOrigin;
struct SecurityOriginData;

class DatabaseManagerClient {
public:
virtual ~DatabaseManagerClient() { }
virtual void dispatchDidModifyOrigin(SecurityOrigin&) = 0;
virtual void dispatchDidModifyDatabase(SecurityOrigin&, const String& databaseName) = 0;
virtual void dispatchDidModifyOrigin(const SecurityOriginData&) = 0;
virtual void dispatchDidModifyDatabase(const SecurityOriginData&, const String& databaseName) = 0;

#if PLATFORM(IOS)
virtual void dispatchDidAddNewOrigin(SecurityOrigin&) = 0;
virtual void dispatchDidAddNewOrigin() = 0;
virtual void dispatchDidDeleteDatabase() = 0;
virtual void dispatchDidDeleteDatabaseOrigin() = 0;
#else
static void dispatchDidAddNewOrigin(SecurityOrigin&) { }
static void dispatchDidAddNewOrigin() { }
static void dispatchDidDeleteDatabase() { }
static void dispatchDidDeleteDatabaseOrigin() { }
#endif

0 comments on commit 377ecd7

Please sign in to comment.