Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp

Issue 1865213006: Replace setIndexedDBClientCreateFunction madness with Supplements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify per review feedback Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
index 75e0235256a04e563f72dd5a2c4cf20078303480..282640230a129134044e47ab5b59885b7cd99cb6 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
@@ -50,16 +50,10 @@ namespace blink {
static const char permissionDeniedErrorMessage[] = "The user denied permission to access the database.";
-IDBFactory::IDBFactory(IndexedDBClient* permissionClient)
- : m_permissionClient(permissionClient)
+IDBFactory::IDBFactory()
{
}
-DEFINE_TRACE(IDBFactory)
-{
- visitor->trace(m_permissionClient);
-}
-
static bool isContextValid(ExecutionContext* context)
{
ASSERT(context->isDocument() || context->isWorkerGlobalScope());
@@ -82,7 +76,7 @@ IDBRequest* IDBFactory::getDatabaseNames(ScriptState* scriptState, ExceptionStat
IDBRequest* request = IDBRequest::create(scriptState, IDBAny::createNull(), nullptr);
- if (!m_permissionClient->allowIndexedDB(scriptState->getExecutionContext(), "Database Listing")) {
+ if (!IndexedDBClient::from(scriptState->getExecutionContext())->allowIndexedDB(scriptState->getExecutionContext(), "Database Listing")) {
request->onError(DOMException::create(UnknownError, permissionDeniedErrorMessage));
return request;
}
@@ -116,7 +110,7 @@ IDBOpenDBRequest* IDBFactory::openInternal(ScriptState* scriptState, const Strin
int64_t transactionId = IDBDatabase::nextTransactionId();
IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState, databaseCallbacks, transactionId, version);
- if (!m_permissionClient->allowIndexedDB(scriptState->getExecutionContext(), name)) {
+ if (!IndexedDBClient::from(scriptState->getExecutionContext())->allowIndexedDB(scriptState->getExecutionContext(), name)) {
request->onError(DOMException::create(UnknownError, permissionDeniedErrorMessage));
return request;
}
@@ -144,7 +138,7 @@ IDBOpenDBRequest* IDBFactory::deleteDatabase(ScriptState* scriptState, const Str
IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState, nullptr, 0, IDBDatabaseMetadata::DefaultVersion);
- if (!m_permissionClient->allowIndexedDB(scriptState->getExecutionContext(), name)) {
+ if (!IndexedDBClient::from(scriptState->getExecutionContext())->allowIndexedDB(scriptState->getExecutionContext(), name)) {
request->onError(DOMException::create(UnknownError, permissionDeniedErrorMessage));
return request;
}

Powered by Google App Engine
This is Rietveld 408576698