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

Unified Diff: content/browser/indexed_db/indexed_db_callbacks.h

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Require explicit wrapping when discarding map keys. Created 4 years, 2 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: content/browser/indexed_db/indexed_db_callbacks.h
diff --git a/content/browser/indexed_db/indexed_db_callbacks.h b/content/browser/indexed_db/indexed_db_callbacks.h
index 088c16333059ae3f2b0b323441b8756a0e996775..fa2bc9ae1495c9f99f29bffc9e20ea783ae47753 100644
--- a/content/browser/indexed_db/indexed_db_callbacks.h
+++ b/content/browser/indexed_db/indexed_db_callbacks.h
@@ -17,6 +17,7 @@
#include "base/strings/string16.h"
#include "content/browser/indexed_db/indexed_db_database_error.h"
#include "content/browser/indexed_db/indexed_db_dispatcher_host.h"
+#include "content/common/indexed_db/indexed_db.mojom.h"
#include "content/common/indexed_db/indexed_db_key.h"
#include "content/common/indexed_db/indexed_db_key_path.h"
#include "url/origin.h"
@@ -46,13 +47,11 @@ class CONTENT_EXPORT IndexedDBCallbacks
int32_t ipc_callbacks_id,
int32_t ipc_cursor_id);
- // IndexedDBDatabase responses
- IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host,
- int32_t ipc_thread_id,
- int32_t ipc_callbacks_id,
- int32_t ipc_database_callbacks_id,
- int64_t host_transaction_id,
- const url::Origin& origin);
+ // Mojo-based responses
+ IndexedDBCallbacks(
+ IndexedDBDispatcherHost* dispatcher_host,
+ const url::Origin& origin,
+ ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks_info);
virtual void OnError(const IndexedDBDatabaseError& error);
@@ -113,6 +112,10 @@ class CONTENT_EXPORT IndexedDBCallbacks
void SetConnectionOpenStartTime(const base::TimeTicks& start_time);
+ void set_host_transaction_id(int64_t host_transaction_id) {
+ host_transaction_id_ = host_transaction_id;
+ }
+
protected:
virtual ~IndexedDBCallbacks();
@@ -122,6 +125,8 @@ class CONTENT_EXPORT IndexedDBCallbacks
friend class base::RefCounted<IndexedDBCallbacks>;
+ class IOThreadHelper;
+
// Originally from IndexedDBCallbacks:
scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_;
int32_t ipc_callbacks_id_;
@@ -134,7 +139,6 @@ class CONTENT_EXPORT IndexedDBCallbacks
int64_t host_transaction_id_;
url::Origin origin_;
int32_t ipc_database_id_;
- int32_t ipc_database_callbacks_id_;
// Used to assert that OnSuccess is only called if there was no data loss.
blink::WebIDBDataLoss data_loss_;
@@ -142,6 +146,9 @@ class CONTENT_EXPORT IndexedDBCallbacks
// The "blocked" event should be sent at most once per request.
bool sent_blocked_;
base::TimeTicks connection_open_start_time_;
+
+ IOThreadHelper* io_helper_;
dcheng 2016/10/17 05:33:44 Can this be std::unique_ptr<IOThreadHelper, Browse
Reilly Grant (use Gerrit) 2016/10/19 00:36:51 No, because tests initialize this class and don't
dcheng 2016/10/19 03:55:29 Can we use TestBrowserThreadBundle in the tests? I
Reilly Grant (use Gerrit) 2016/10/19 06:01:24 I'll have that a try.
Reilly Grant (use Gerrit) 2016/10/19 18:33:13 Done.
+
DISALLOW_COPY_AND_ASSIGN(IndexedDBCallbacks);
};

Powered by Google App Engine
This is Rietveld 408576698