Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 5 #ifndef CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
| 6 #define CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 6 #define CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 void UnregisterMojoOwnedDatabaseCallbacks( | 123 void UnregisterMojoOwnedDatabaseCallbacks( |
| 124 blink::WebIDBDatabaseCallbacks* callback_state); | 124 blink::WebIDBDatabaseCallbacks* callback_state); |
| 125 | 125 |
| 126 private: | 126 private: |
| 127 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorReset); | 127 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorReset); |
| 128 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorTransactionId); | 128 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorTransactionId); |
| 129 | 129 |
| 130 static int32_t CurrentWorkerId() { return WorkerThread::GetCurrentId(); } | 130 static int32_t CurrentWorkerId() { return WorkerThread::GetCurrentId(); } |
| 131 | 131 |
| 132 template <typename T> | 132 template <typename T> |
| 133 void init_params(T* params, blink::WebIDBCallbacks* callbacks_ptr) { | 133 void init_params(T* params, blink::WebIDBCallbacks* callbacks_ptr) { |
|
danakj
2016/11/18 00:15:33
could this be a unique_ptr?
rlanday
2016/11/18 20:40:41
It's unclear to me that this function is used anyw
| |
| 134 std::unique_ptr<blink::WebIDBCallbacks> callbacks(callbacks_ptr); | |
| 135 params->ipc_thread_id = CurrentWorkerId(); | 134 params->ipc_thread_id = CurrentWorkerId(); |
| 136 params->ipc_callbacks_id = pending_callbacks_.Add(callbacks.release()); | 135 params->ipc_callbacks_id = pending_callbacks_.Add( |
| 136 std::unique_ptr<blink::WebIDBCallbacks>(callbacks_ptr)); | |
| 137 } | 137 } |
| 138 | 138 |
| 139 // IDBCallback message handlers. | 139 // IDBCallback message handlers. |
| 140 void OnSuccessCursorContinue( | 140 void OnSuccessCursorContinue( |
| 141 const IndexedDBMsg_CallbacksSuccessCursorContinue_Params& p); | 141 const IndexedDBMsg_CallbacksSuccessCursorContinue_Params& p); |
| 142 void OnSuccessCursorPrefetch( | 142 void OnSuccessCursorPrefetch( |
| 143 const IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params& p); | 143 const IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params& p); |
| 144 void OnSuccessValue(const IndexedDBMsg_CallbacksSuccessValue_Params& p); | 144 void OnSuccessValue(const IndexedDBMsg_CallbacksSuccessValue_Params& p); |
| 145 void OnSuccessInteger(int32_t ipc_thread_id, | 145 void OnSuccessInteger(int32_t ipc_thread_id, |
| 146 int32_t ipc_callbacks_id, | 146 int32_t ipc_callbacks_id, |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 176 | 176 |
| 177 // Map from cursor id to WebIDBCursorImpl. | 177 // Map from cursor id to WebIDBCursorImpl. |
| 178 std::map<int32_t, WebIDBCursorImpl*> cursors_; | 178 std::map<int32_t, WebIDBCursorImpl*> cursors_; |
| 179 | 179 |
| 180 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); | 180 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 } // namespace content | 183 } // namespace content |
| 184 | 184 |
| 185 #endif // CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 185 #endif // CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
| OLD | NEW |