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

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

Issue 2480293004: Mandate unique_ptr for base::IDMap in IDMapOwnPointer mode. (Closed)
Patch Set: Fix typo breaking a bunch of trybot builds, oops 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..cbd81e341df6b1b19e9e82d95f8c9af73f6fe29d 100644
--- a/content/child/indexed_db/indexed_db_dispatcher.cc
+++ b/content/child/indexed_db/indexed_db_dispatcher.cc
@@ -126,7 +126,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(
@@ -143,9 +143,8 @@ void IndexedDBDispatcher::RequestIDBCursorAdvance(
// 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::unique_ptr<WebIDBCallbacks>(callbacks_ptr));
Send(new IndexedDBHostMsg_CursorAdvance(
ipc_cursor_id, CurrentWorkerId(), ipc_callbacks_id, count));
}
@@ -159,9 +158,8 @@ void IndexedDBDispatcher::RequestIDBCursorContinue(
// 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::unique_ptr<WebIDBCallbacks>(callbacks_ptr));
Send(new IndexedDBHostMsg_CursorContinue(
ipc_cursor_id, CurrentWorkerId(), ipc_callbacks_id, key, primary_key));
}
@@ -170,9 +168,8 @@ void IndexedDBDispatcher::RequestIDBCursorPrefetch(
int n,
WebIDBCallbacks* callbacks_ptr,
danakj 2016/11/18 00:15:33 and this?
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::unique_ptr<WebIDBCallbacks>(callbacks_ptr));
Send(new IndexedDBHostMsg_CursorPrefetch(
ipc_cursor_id, CurrentWorkerId(), ipc_callbacks_id, n));
}

Powered by Google App Engine
This is Rietveld 408576698