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

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

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.h
diff --git a/content/child/indexed_db/indexed_db_dispatcher.h b/content/child/indexed_db/indexed_db_dispatcher.h
index 3d75d37bc6dc1ba54beb815020c0774b9306c01e..241530b064336756324869d1ff59f513276b9e56 100644
--- a/content/child/indexed_db/indexed_db_dispatcher.h
+++ b/content/child/indexed_db/indexed_db_dispatcher.h
@@ -9,7 +9,9 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <string>
+#include <utility>
#include <vector>
#include "base/gtest_prod_util.h"
@@ -82,22 +84,25 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
void RemoveObservers(const std::vector<int32_t>& observer_ids_to_remove);
// This method is virtual so it can be overridden in unit tests.
- virtual void RequestIDBCursorAdvance(unsigned long count,
- blink::WebIDBCallbacks* callbacks_ptr,
- int32_t ipc_cursor_id,
- int64_t transaction_id);
+ virtual void RequestIDBCursorAdvance(
+ unsigned long count,
+ std::unique_ptr<blink::WebIDBCallbacks> callbacks_ptr,
+ int32_t ipc_cursor_id,
+ int64_t transaction_id);
// This method is virtual so it can be overridden in unit tests.
- virtual void RequestIDBCursorContinue(const IndexedDBKey& key,
- const IndexedDBKey& primary_key,
- blink::WebIDBCallbacks* callbacks_ptr,
- int32_t ipc_cursor_id,
- int64_t transaction_id);
+ virtual void RequestIDBCursorContinue(
+ const IndexedDBKey& key,
+ const IndexedDBKey& primary_key,
+ std::unique_ptr<blink::WebIDBCallbacks> callbacks_ptr,
+ int32_t ipc_cursor_id,
+ int64_t transaction_id);
// This method is virtual so it can be overridden in unit tests.
- virtual void RequestIDBCursorPrefetch(int n,
- blink::WebIDBCallbacks* callbacks_ptr,
- int32_t ipc_cursor_id);
+ virtual void RequestIDBCursorPrefetch(
+ int n,
+ std::unique_ptr<blink::WebIDBCallbacks> callbacks_ptr,
+ int32_t ipc_cursor_id);
// This method is virtual so it can be overridden in unit tests.
virtual void RequestIDBCursorPrefetchReset(int used_prefetches,
@@ -130,10 +135,10 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
static int32_t CurrentWorkerId() { return WorkerThread::GetCurrentId(); }
template <typename T>
- void init_params(T* params, blink::WebIDBCallbacks* callbacks_ptr) {
- std::unique_ptr<blink::WebIDBCallbacks> callbacks(callbacks_ptr);
+ void init_params(T* params,
+ std::unique_ptr<blink::WebIDBCallbacks> callbacks_ptr) {
params->ipc_thread_id = CurrentWorkerId();
- params->ipc_callbacks_id = pending_callbacks_.Add(callbacks.release());
+ params->ipc_callbacks_id = pending_callbacks_.Add(std::move(callbacks_ptr));
}
// IDBCallback message handlers.

Powered by Google App Engine
This is Rietveld 408576698