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

Unified Diff: content/child/indexed_db/indexed_db_dispatcher.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/indexed_db_dispatcher.cc
diff --git a/content/child/indexed_db/indexed_db_dispatcher.cc b/content/child/indexed_db/indexed_db_dispatcher.cc
index aafd24419d65f749c47d08f81e01134920406d48..6679d0897518866eddaaf646b8bcf07f79247380 100644
--- a/content/child/indexed_db/indexed_db_dispatcher.cc
+++ b/content/child/indexed_db/indexed_db_dispatcher.cc
@@ -4,6 +4,7 @@
#include "content/child/indexed_db/indexed_db_dispatcher.h"
+#include <memory>
#include <utility>
#include "base/format_macros.h"
@@ -126,7 +127,7 @@ bool IndexedDBDispatcher::Send(IPC::Message* msg) {
int32_t IndexedDBDispatcher::RegisterObserver(
std::unique_ptr<WebIDBObserver> observer) {
- return observers_.Add(observer.release());
+ return observers_.Add(std::move(observer));
}
void IndexedDBDispatcher::RemoveObservers(
@@ -137,15 +138,13 @@ void IndexedDBDispatcher::RemoveObservers(
void IndexedDBDispatcher::RequestIDBCursorAdvance(
unsigned long count,
- WebIDBCallbacks* callbacks_ptr,
+ std::unique_ptr<WebIDBCallbacks> callbacks_ptr,
int32_t ipc_cursor_id,
int64_t transaction_id) {
// Reset all cursor prefetch caches except for this cursor.
ResetCursorPrefetchCaches(transaction_id, ipc_cursor_id);
- std::unique_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
-
- int32_t ipc_callbacks_id = pending_callbacks_.Add(callbacks.release());
+ int32_t ipc_callbacks_id = pending_callbacks_.Add(std::move(callbacks_ptr));
Send(new IndexedDBHostMsg_CursorAdvance(
ipc_cursor_id, CurrentWorkerId(), ipc_callbacks_id, count));
}
@@ -153,26 +152,22 @@ void IndexedDBDispatcher::RequestIDBCursorAdvance(
void IndexedDBDispatcher::RequestIDBCursorContinue(
const IndexedDBKey& key,
const IndexedDBKey& primary_key,
- WebIDBCallbacks* callbacks_ptr,
+ std::unique_ptr<WebIDBCallbacks> callbacks_ptr,
int32_t ipc_cursor_id,
int64_t transaction_id) {
// Reset all cursor prefetch caches except for this cursor.
ResetCursorPrefetchCaches(transaction_id, ipc_cursor_id);
- std::unique_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
-
- int32_t ipc_callbacks_id = pending_callbacks_.Add(callbacks.release());
+ int32_t ipc_callbacks_id = pending_callbacks_.Add(std::move(callbacks_ptr));
Send(new IndexedDBHostMsg_CursorContinue(
ipc_cursor_id, CurrentWorkerId(), ipc_callbacks_id, key, primary_key));
}
void IndexedDBDispatcher::RequestIDBCursorPrefetch(
int n,
- WebIDBCallbacks* callbacks_ptr,
+ std::unique_ptr<WebIDBCallbacks> callbacks_ptr,
int32_t ipc_cursor_id) {
- std::unique_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
-
- int32_t ipc_callbacks_id = pending_callbacks_.Add(callbacks.release());
+ int32_t ipc_callbacks_id = pending_callbacks_.Add(std::move(callbacks_ptr));
Send(new IndexedDBHostMsg_CursorPrefetch(
ipc_cursor_id, CurrentWorkerId(), ipc_callbacks_id, n));
}

Powered by Google App Engine
This is Rietveld 408576698