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

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: Rebased 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
« no previous file with comments | « Source/web/IDBFactoryBackendProxy.h ('k') | Source/web/WebIDBCallbacks.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/IDBFactoryBackendProxy.cpp
diff --git a/Source/web/IDBFactoryBackendProxy.cpp b/Source/web/IDBFactoryBackendProxy.cpp
index 7bd4fa0903e74cffc2d71e37abe0b6cde128f5e1..6ce40c467d56475ad328247b03bea28367011b23 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"
@@ -42,9 +36,6 @@
#include "WebViewImpl.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"
@@ -58,19 +49,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;
adamk 2013/11/25 21:56:44 You could get rid of this bool now that you check
jsbell 2013/11/26 00:42:53 Done.
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());
@@ -82,40 +65,7 @@ bool IDBFactoryBackendProxy::allowIndexedDB(ExecutionContext* context, const Str
allowed = WorkerPermissionClient::from(workerGlobalScope)->allowIndexedDB(name);
adamk 2013/11/25 21:56:44 and return this too.
jsbell 2013/11/26 00:42:53 Done.
}
- 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
« no previous file with comments | « Source/web/IDBFactoryBackendProxy.h ('k') | Source/web/WebIDBCallbacks.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698