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

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

Issue 1504033007: Move Indexed DB from dedicated thread to task scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@timer
Patch Set: Tweak traits Created 3 years, 6 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/cursor_impl.h ('k') | content/browser/indexed_db/database_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/cursor_impl.cc
diff --git a/content/browser/indexed_db/cursor_impl.cc b/content/browser/indexed_db/cursor_impl.cc
index 60c171ad204a0ebb7604d0e36db0e71e1ca687d1..65158584c2294579e1dcc53a0332a6f84703751b 100644
--- a/content/browser/indexed_db/cursor_impl.cc
+++ b/content/browser/indexed_db/cursor_impl.cc
@@ -12,11 +12,11 @@
namespace content {
-// Expected to be constructed on IO thread, and used/destroyed on IDB thread.
-class CursorImpl::IDBThreadHelper {
+// Expected to be constructed on IO thread, and used/destroyed on IDB sequence.
+class CursorImpl::IDBSequenceHelper {
public:
- explicit IDBThreadHelper(std::unique_ptr<IndexedDBCursor> cursor);
- ~IDBThreadHelper();
+ explicit IDBSequenceHelper(std::unique_ptr<IndexedDBCursor> cursor);
+ ~IDBSequenceHelper();
void Advance(uint32_t count, scoped_refptr<IndexedDBCallbacks> callbacks);
void Continue(const IndexedDBKey& key,
@@ -28,14 +28,14 @@ class CursorImpl::IDBThreadHelper {
private:
std::unique_ptr<IndexedDBCursor> cursor_;
- DISALLOW_COPY_AND_ASSIGN(IDBThreadHelper);
+ DISALLOW_COPY_AND_ASSIGN(IDBSequenceHelper);
};
CursorImpl::CursorImpl(std::unique_ptr<IndexedDBCursor> cursor,
const url::Origin& origin,
IndexedDBDispatcherHost* dispatcher_host,
scoped_refptr<base::SequencedTaskRunner> idb_runner)
- : helper_(new IDBThreadHelper(std::move(cursor))),
+ : helper_(new IDBSequenceHelper(std::move(cursor))),
dispatcher_host_(dispatcher_host),
origin_(origin),
idb_runner_(std::move(idb_runner)) {}
@@ -50,7 +50,7 @@ void CursorImpl::Advance(
scoped_refptr<IndexedDBCallbacks> callbacks(
new IndexedDBCallbacks(dispatcher_host_->AsWeakPtr(), origin_,
std::move(callbacks_info), idb_runner_));
- idb_runner_->PostTask(FROM_HERE, base::Bind(&IDBThreadHelper::Advance,
+ idb_runner_->PostTask(FROM_HERE, base::Bind(&IDBSequenceHelper::Advance,
base::Unretained(helper_), count,
base::Passed(&callbacks)));
}
@@ -64,7 +64,7 @@ void CursorImpl::Continue(
std::move(callbacks_info), idb_runner_));
idb_runner_->PostTask(
FROM_HERE,
- base::Bind(&IDBThreadHelper::Continue, base::Unretained(helper_), key,
+ base::Bind(&IDBSequenceHelper::Continue, base::Unretained(helper_), key,
primary_key, base::Passed(&callbacks)));
}
@@ -74,7 +74,7 @@ void CursorImpl::Prefetch(
scoped_refptr<IndexedDBCallbacks> callbacks(
new IndexedDBCallbacks(dispatcher_host_->AsWeakPtr(), origin_,
std::move(callbacks_info), idb_runner_));
- idb_runner_->PostTask(FROM_HERE, base::Bind(&IDBThreadHelper::Prefetch,
+ idb_runner_->PostTask(FROM_HERE, base::Bind(&IDBSequenceHelper::Prefetch,
base::Unretained(helper_), count,
base::Passed(&callbacks)));
}
@@ -88,23 +88,23 @@ void CursorImpl::PrefetchReset(
idb_runner_->PostTask(
FROM_HERE,
- base::Bind(&IDBThreadHelper::PrefetchReset, base::Unretained(helper_),
+ base::Bind(&IDBSequenceHelper::PrefetchReset, base::Unretained(helper_),
used_prefetches, unused_prefetches));
}
-CursorImpl::IDBThreadHelper::IDBThreadHelper(
+CursorImpl::IDBSequenceHelper::IDBSequenceHelper(
std::unique_ptr<IndexedDBCursor> cursor)
: cursor_(std::move(cursor)) {}
-CursorImpl::IDBThreadHelper::~IDBThreadHelper() {}
+CursorImpl::IDBSequenceHelper::~IDBSequenceHelper() {}
-void CursorImpl::IDBThreadHelper::Advance(
+void CursorImpl::IDBSequenceHelper::Advance(
uint32_t count,
scoped_refptr<IndexedDBCallbacks> callbacks) {
cursor_->Advance(count, std::move(callbacks));
}
-void CursorImpl::IDBThreadHelper::Continue(
+void CursorImpl::IDBSequenceHelper::Continue(
const IndexedDBKey& key,
const IndexedDBKey& primary_key,
scoped_refptr<IndexedDBCallbacks> callbacks) {
@@ -115,14 +115,14 @@ void CursorImpl::IDBThreadHelper::Continue(
std::move(callbacks));
}
-void CursorImpl::IDBThreadHelper::Prefetch(
+void CursorImpl::IDBSequenceHelper::Prefetch(
int32_t count,
scoped_refptr<IndexedDBCallbacks> callbacks) {
cursor_->PrefetchContinue(count, std::move(callbacks));
}
-void CursorImpl::IDBThreadHelper::PrefetchReset(int32_t used_prefetches,
- int32_t unused_prefetches) {
+void CursorImpl::IDBSequenceHelper::PrefetchReset(int32_t used_prefetches,
+ int32_t unused_prefetches) {
leveldb::Status s =
cursor_->PrefetchReset(used_prefetches, unused_prefetches);
// TODO(cmumford): Handle this error (crbug.com/363397)
« no previous file with comments | « content/browser/indexed_db/cursor_impl.h ('k') | content/browser/indexed_db/database_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698