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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring after Passing URLRequestContextGetter. Created 4 years, 4 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/IDBOpenDBRequest.h
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h
index 637d1a2880d5941284726a703fd5b32a36ea7436..211fd5b78b356cfbe82a989a08934d8cab251f49 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h
@@ -26,32 +26,43 @@
#ifndef IDBOpenDBRequest_h
#define IDBOpenDBRequest_h
+#include "Source/modules/indexeddb/indexed_db.mojom-blink.h"
#include "modules/ModulesExport.h"
#include "modules/indexeddb/IDBRequest.h"
-#include "public/platform/modules/indexeddb/WebIDBDatabase.h"
-#include <memory>
+#include "mojo/public/cpp/bindings/binding.h"
namespace blink {
-class IDBDatabaseCallbacks;
+class IDBDatabase;
-class MODULES_EXPORT IDBOpenDBRequest final : public IDBRequest {
+// A request to either open or delete a database.
+//
+// Note: This is an Oilpan managed object with an interface passed to Mojo.
+// TODO(cmumford): Update this note when the request is removed from IDBDatabaseObserverImpl.
+class MODULES_EXPORT IDBOpenDBRequest final : public IDBRequest, WTF_NON_EXPORTED_BASE(public indexed_db::mojom::blink::OpenRequestObserver)
+{
DEFINE_WRAPPERTYPEINFO();
public:
- static IDBOpenDBRequest* create(ScriptState*, IDBDatabaseCallbacks*, int64_t transactionId, int64_t version);
+ static IDBOpenDBRequest* create(ScriptState*, int64_t transactionId, int64_t version, indexed_db::mojom::blink::OpenRequestObserverRequest);
~IDBOpenDBRequest() override;
DECLARE_VIRTUAL_TRACE();
using IDBRequest::onSuccess;
- void onBlocked(int64_t existingVersion) override;
- void onUpgradeNeeded(int64_t oldVersion, std::unique_ptr<WebIDBDatabase>, const IDBDatabaseMetadata&, WebIDBDataLoss, String dataLossMessage) override;
- void onSuccess(std::unique_ptr<WebIDBDatabase>, const IDBDatabaseMetadata&) override;
+ void onSuccess(std::unique_ptr<IDBDatabaseProxy>, const IDBDatabaseMetadata&) override;
void onSuccess(int64_t oldVersion) override;
// EventTarget
const AtomicString& interfaceName() const override;
+ // indexed_db::mojom::blink::OpenRequestObserver:
+ void OnBlocked(int64_t oldVersion) override;
+ void OnUpgradeNeeded(int64_t oldVersion, indexed_db::mojom::blink::DatabasePtr, indexed_db::mojom::blink::DatabaseMetadataPtr, indexed_db::mojom::blink::DataLossInfoPtr) override;
+
+ IDBDatabase* getDatabase() const;
+
+ void onOpenResult(indexed_db::mojom::blink::OpenResultPtr);
+
DEFINE_ATTRIBUTE_EVENT_LISTENER(blocked);
DEFINE_ATTRIBUTE_EVENT_LISTENER(upgradeneeded);
@@ -62,11 +73,14 @@ protected:
DispatchEventResult dispatchEventInternal(Event*) override;
private:
- IDBOpenDBRequest(ScriptState*, IDBDatabaseCallbacks*, int64_t transactionId, int64_t version);
+ IDBOpenDBRequest(ScriptState*, int64_t transactionId, int64_t version, indexed_db::mojom::blink::OpenRequestObserverRequest);
+
+ void onBlocked(int64_t existingVersion);
+ void onUpgradeNeeded(int64_t oldVersion, std::unique_ptr<IDBDatabaseProxy>, const IDBDatabaseMetadata&, WebIDBDataLoss, String dataLossMessage);
- Member<IDBDatabaseCallbacks> m_databaseCallbacks;
const int64_t m_transactionId;
int64_t m_version;
+ mojo::Binding<indexed_db::mojom::blink::OpenRequestObserver> m_binding;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698