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

Unified Diff: content/child/indexed_db/webidbcursor_impl.h

Issue 2500263003: Port messages sent by WebIDBCursorImpl to Mojo. (Closed)
Patch Set: Address dcheng@'s comments. Created 4 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: content/child/indexed_db/webidbcursor_impl.h
diff --git a/content/child/indexed_db/webidbcursor_impl.h b/content/child/indexed_db/webidbcursor_impl.h
index afe3d43a2eebc6702ef5db6d316fb0e36ddce7e8..63b4735f09104465bdc29a3ec373868146c9a298 100644
--- a/content/child/indexed_db/webidbcursor_impl.h
+++ b/content/child/indexed_db/webidbcursor_impl.h
@@ -14,21 +14,25 @@
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
+#include "content/common/indexed_db/indexed_db.mojom.h"
#include "content/common/indexed_db/indexed_db_key.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCallbacks.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCursor.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBKey.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBValue.h"
+namespace base {
+class SingleThreadTaskRunner;
+}
+
namespace content {
-class ThreadSafeSender;
class CONTENT_EXPORT WebIDBCursorImpl
: NON_EXPORTED_BASE(public blink::WebIDBCursor) {
public:
- WebIDBCursorImpl(int32_t ipc_cursor_id,
+ WebIDBCursorImpl(indexed_db::mojom::CursorAssociatedPtrInfo cursor,
int64_t transaction_id,
- ThreadSafeSender* thread_safe_sender);
+ scoped_refptr<base::SingleThreadTaskRunner> io_runner);
~WebIDBCursorImpl() override;
void advance(unsigned long count, blink::WebIDBCallbacks* callback) override;
@@ -58,14 +62,18 @@ class CONTENT_EXPORT WebIDBCursorImpl
FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchReset);
FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchTest);
+ class IOThreadHelper;
+
enum { kInvalidCursorId = -1 };
enum { kPrefetchContinueThreshold = 2 };
enum { kMinPrefetchAmount = 5 };
enum { kMaxPrefetchAmount = 100 };
- int32_t ipc_cursor_id_;
int64_t transaction_id_;
+ IOThreadHelper* helper_;
+ scoped_refptr<base::SingleThreadTaskRunner> io_runner_;
+
// Prefetch cache.
std::deque<IndexedDBKey> prefetch_keys_;
std::deque<IndexedDBKey> prefetch_primary_keys_;
@@ -83,7 +91,9 @@ class CONTENT_EXPORT WebIDBCursorImpl
// Number of items to request in next prefetch.
int prefetch_amount_;
- scoped_refptr<ThreadSafeSender> thread_safe_sender_;
+ base::WeakPtrFactory<WebIDBCursorImpl> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebIDBCursorImpl);
};
} // namespace content
« no previous file with comments | « content/child/indexed_db/indexed_db_message_filter.cc ('k') | content/child/indexed_db/webidbcursor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698