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

Unified Diff: content/browser/indexed_db/indexed_db_cursor.cc

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
« no previous file with comments | « content/browser/indexed_db/indexed_db_cursor.h ('k') | content/browser/indexed_db/indexed_db_database.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/indexed_db_cursor.cc
diff --git a/content/browser/indexed_db/indexed_db_cursor.cc b/content/browser/indexed_db/indexed_db_cursor.cc
index a029b08242f58b2e1acc888ce612f1f9e3760cda..f9d30f28915b12e69578c81d60ac389690cf5081 100644
--- a/content/browser/indexed_db/indexed_db_cursor.cc
+++ b/content/browser/indexed_db/indexed_db_cursor.cc
@@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/logging.h"
-#include "content/browser/indexed_db/indexed_db_callbacks.h"
#include "content/browser/indexed_db/indexed_db_database_error.h"
#include "content/browser/indexed_db/indexed_db_tracing.h"
#include "content/browser/indexed_db/indexed_db_transaction.h"
@@ -36,32 +35,24 @@ IndexedDBCursor::~IndexedDBCursor() {
}
void IndexedDBCursor::Continue(std::unique_ptr<IndexedDBKey> key,
- std::unique_ptr<IndexedDBKey> primary_key,
- scoped_refptr<IndexedDBCallbacks> callbacks) {
+ std::unique_ptr<IndexedDBKey> primary_key) {
IDB_TRACE("IndexedDBCursor::Continue");
transaction_->ScheduleTask(
- task_type_,
- base::Bind(&IndexedDBCursor::CursorIterationOperation,
- this,
- base::Passed(&key),
- base::Passed(&primary_key),
- callbacks));
+ task_type_, base::Bind(&IndexedDBCursor::CursorIterationOperation, this,
+ base::Passed(&key), base::Passed(&primary_key)));
}
-void IndexedDBCursor::Advance(uint32_t count,
- scoped_refptr<IndexedDBCallbacks> callbacks) {
+void IndexedDBCursor::Advance(uint32_t count) {
IDB_TRACE("IndexedDBCursor::Advance");
transaction_->ScheduleTask(
task_type_,
- base::Bind(
- &IndexedDBCursor::CursorAdvanceOperation, this, count, callbacks));
+ base::Bind(&IndexedDBCursor::CursorAdvanceOperation, this, count));
}
void IndexedDBCursor::CursorAdvanceOperation(
uint32_t count,
- scoped_refptr<IndexedDBCallbacks> callbacks,
IndexedDBTransaction* /*transaction*/) {
IDB_TRACE("IndexedDBCursor::CursorAdvanceOperation");
leveldb::Status s;
@@ -70,17 +61,20 @@ void IndexedDBCursor::CursorAdvanceOperation(
// will be ignored.
if (!cursor_ || !cursor_->Advance(count, &s)) {
cursor_.reset();
+#ifdef CJM_NEED_CALLBACK
callbacks->OnSuccess(nullptr);
+#endif
return;
}
+#ifdef CJM_NEED_CALLBACK
callbacks->OnSuccess(key(), primary_key(), Value());
+#endif
}
void IndexedDBCursor::CursorIterationOperation(
std::unique_ptr<IndexedDBKey> key,
std::unique_ptr<IndexedDBKey> primary_key,
- scoped_refptr<IndexedDBCallbacks> callbacks,
IndexedDBTransaction* /*transaction*/) {
IDB_TRACE("IndexedDBCursor::CursorIterationOperation");
leveldb::Status s;
@@ -92,29 +86,27 @@ void IndexedDBCursor::CursorIterationOperation(
IndexedDBBackingStore::Cursor::SEEK,
&s) || !s.ok()) {
cursor_.reset();
+#ifdef CJM_NEED_CALLBACK
callbacks->OnSuccess(nullptr);
+#endif
return;
}
+#ifdef CJM_NEED_CALLBACK
callbacks->OnSuccess(this->key(), this->primary_key(), Value());
+#endif
}
-void IndexedDBCursor::PrefetchContinue(
- int number_to_fetch,
- scoped_refptr<IndexedDBCallbacks> callbacks) {
+void IndexedDBCursor::PrefetchContinue(int number_to_fetch) {
IDB_TRACE("IndexedDBCursor::PrefetchContinue");
transaction_->ScheduleTask(
- task_type_,
- base::Bind(&IndexedDBCursor::CursorPrefetchIterationOperation,
- this,
- number_to_fetch,
- callbacks));
+ task_type_, base::Bind(&IndexedDBCursor::CursorPrefetchIterationOperation,
+ this, number_to_fetch));
}
void IndexedDBCursor::CursorPrefetchIterationOperation(
int number_to_fetch,
- scoped_refptr<IndexedDBCallbacks> callbacks,
IndexedDBTransaction* /*transaction*/) {
IDB_TRACE("IndexedDBCursor::CursorPrefetchIterationOperation");
@@ -168,12 +160,16 @@ void IndexedDBCursor::CursorPrefetchIterationOperation(
}
if (found_keys.empty()) {
+#ifdef CJM_NEED_CALLBACK
callbacks->OnSuccess(nullptr);
+#endif
return;
}
+#ifdef CJM_NEED_CALLBACK
callbacks->OnSuccessWithPrefetch(
found_keys, found_primary_keys, &found_values);
+#endif
}
leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches,
« no previous file with comments | « content/browser/indexed_db/indexed_db_cursor.h ('k') | content/browser/indexed_db/indexed_db_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698