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

Unified Diff: Source/web/IDBFactoryBackendProxy.cpp

Issue 67463006: IndexedDB: Simplify WebIDBCallbacks exports, strip IDBFactoryBackend (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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: Source/web/IDBFactoryBackendProxy.cpp
diff --git a/Source/web/IDBFactoryBackendProxy.cpp b/Source/web/IDBFactoryBackendProxy.cpp
index 4ff7e3ddcaf0b47f5c2fea4406bb9310adf689c1..2bd2263b25c8b10f88d4b6ac5f5c13c98e044c4c 100644
--- a/Source/web/IDBFactoryBackendProxy.cpp
+++ b/Source/web/IDBFactoryBackendProxy.cpp
@@ -29,12 +29,6 @@
#include "config.h"
#include "IDBFactoryBackendProxy.h"
-#include "public/platform/WebIDBCallbacks.h"
-#include "public/platform/WebIDBDatabase.h"
-#include "public/platform/WebIDBDatabaseCallbacks.h"
-#include "public/platform/WebIDBDatabaseError.h"
-#include "public/platform/WebIDBFactory.h"
-#include "public/platform/WebVector.h"
#include "WebFrameImpl.h"
#include "WebKit.h"
#include "WebPermissionClient.h"
@@ -43,9 +37,6 @@
#include "WebWorkerClientImpl.h"
#include "WorkerPermissionClient.h"
#include "bindings/v8/WorkerScriptController.h"
-#include "core/dom/DOMError.h"
-#include "core/dom/ExceptionCode.h"
-#include "core/dom/ExecutionContext.h"
#include "core/workers/WorkerGlobalScope.h"
#include "platform/weborigin/SecurityOrigin.h"
@@ -59,19 +50,11 @@ PassRefPtr<IDBFactoryBackendInterface> IDBFactoryBackendProxy::create()
return adoptRef(new IDBFactoryBackendProxy());
}
-IDBFactoryBackendProxy::IDBFactoryBackendProxy()
-{
- m_webIDBFactory = blink::Platform::current()->idbFactory();
-}
-
-IDBFactoryBackendProxy::~IDBFactoryBackendProxy()
-{
-}
-
-bool IDBFactoryBackendProxy::allowIndexedDB(ExecutionContext* context, const String& name, const WebSecurityOrigin& origin, PassRefPtr<IDBRequest> callbacks)
+bool IDBFactoryBackendProxy::allowIndexedDB(ExecutionContext* context, const String& name)
{
bool allowed;
ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument() || context->isWorkerGlobalScope());
+ WebSecurityOrigin origin(context->securityOrigin());
if (context->isDocument()) {
Document* document = toDocument(context);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
@@ -83,40 +66,7 @@ bool IDBFactoryBackendProxy::allowIndexedDB(ExecutionContext* context, const Str
allowed = WorkerPermissionClient::from(workerGlobalScope)->allowIndexedDB(name);
}
- if (!allowed)
- callbacks->onError(WebIDBDatabaseError(UnknownError, "The user denied permission to access the database."));
-
return allowed;
}
-void IDBFactoryBackendProxy::getDatabaseNames(PassRefPtr<IDBRequest> prpCallbacks, const String& databaseIdentifier, ExecutionContext* context)
-{
- RefPtr<IDBRequest> callbacks(prpCallbacks);
- WebSecurityOrigin origin(context->securityOrigin());
- if (!allowIndexedDB(context, "Database Listing", origin, callbacks))
- return;
-
- m_webIDBFactory->getDatabaseNames(new WebIDBCallbacks(callbacks), databaseIdentifier);
-}
-
-void IDBFactoryBackendProxy::open(const String& name, int64_t version, int64_t transactionId, PassRefPtr<IDBRequest> prpCallbacks, PassOwnPtr<WebIDBDatabaseCallbacks> databaseCallbacks, const String& databaseIdentifier, ExecutionContext* context)
-{
- RefPtr<IDBRequest> callbacks(prpCallbacks);
- WebSecurityOrigin origin(context->securityOrigin());
- if (!allowIndexedDB(context, name, origin, callbacks))
- return;
-
- m_webIDBFactory->open(name, version, transactionId, new WebIDBCallbacks(callbacks), databaseCallbacks.leakPtr(), databaseIdentifier);
-}
-
-void IDBFactoryBackendProxy::deleteDatabase(const String& name, PassRefPtr<IDBRequest> prpCallbacks, const String& databaseIdentifier, ExecutionContext* context)
-{
- RefPtr<IDBRequest> callbacks(prpCallbacks);
- WebSecurityOrigin origin(context->securityOrigin());
- if (!allowIndexedDB(context, name, origin, callbacks))
- return;
-
- m_webIDBFactory->deleteDatabase(name, new WebIDBCallbacks(callbacks), databaseIdentifier);
-}
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698