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

Unified Diff: content/child/indexed_db/webidbcursor_impl_unittest.cc

Issue 2480293004: Mandate unique_ptr for base::IDMap in IDMapOwnPointer mode. (Closed)
Patch Set: Rebase on some ScreenOrientation changes, update that stuff to use unique_ptr (the change I was sca… 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_unittest.cc
diff --git a/content/child/indexed_db/webidbcursor_impl_unittest.cc b/content/child/indexed_db/webidbcursor_impl_unittest.cc
index 83b2110ac14140f1c4b927e7aad776f6992bc806..5448761019d4fff6a5e12b3e9ba73eaeccaa067e 100644
--- a/content/child/indexed_db/webidbcursor_impl_unittest.cc
+++ b/content/child/indexed_db/webidbcursor_impl_unittest.cc
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <memory>
+#include <utility>
#include "base/macros.h"
#include "base/memory/ptr_util.h"
@@ -48,11 +49,11 @@ class MockDispatcher : public IndexedDBDispatcher {
destroyed_cursor_id_(0) {}
void RequestIDBCursorPrefetch(int n,
- WebIDBCallbacks* callbacks,
+ std::unique_ptr<WebIDBCallbacks> callbacks,
int32_t ipc_cursor_id) override {
++prefetch_calls_;
last_prefetch_count_ = n;
- callbacks_.reset(callbacks);
+ callbacks_ = std::move(callbacks);
}
void RequestIDBCursorPrefetchReset(int used_prefetches,
@@ -63,20 +64,20 @@ class MockDispatcher : public IndexedDBDispatcher {
}
void RequestIDBCursorAdvance(unsigned long count,
- WebIDBCallbacks* callbacks,
+ std::unique_ptr<WebIDBCallbacks> callbacks,
int32_t ipc_cursor_id,
int64_t transaction_id) override {
++advance_calls_;
- callbacks_.reset(callbacks);
+ callbacks_ = std::move(callbacks);
}
void RequestIDBCursorContinue(const IndexedDBKey& key,
const IndexedDBKey& primary_key,
- WebIDBCallbacks* callbacks,
+ std::unique_ptr<WebIDBCallbacks> callbacks,
int32_t ipc_cursor_id,
int64_t transaction_id) override {
++continue_calls_;
- callbacks_.reset(callbacks);
+ callbacks_ = std::move(callbacks);
}
void CursorDestroyed(int32_t ipc_cursor_id) override {

Powered by Google App Engine
This is Rietveld 408576698