| 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 67a11abc12624b68fd3bae8ff7e8652fe61d389a..993349d47079175522a91380f62bde3c215f8a38 100644
|
| --- a/content/child/indexed_db/indexed_db_dispatcher.h
|
| +++ b/content/child/indexed_db/indexed_db_dispatcher.h
|
| @@ -5,12 +5,16 @@
|
| #ifndef CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_
|
| #define CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_
|
|
|
| +#include <stddef.h>
|
| +#include <stdint.h>
|
| +
|
| #include <map>
|
| #include <string>
|
| #include <vector>
|
|
|
| #include "base/gtest_prod_util.h"
|
| #include "base/id_map.h"
|
| +#include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/strings/nullable_string16.h"
|
| #include "content/common/content_export.h"
|
| @@ -73,13 +77,12 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
|
| blink::WebIDBCallbacks* callbacks,
|
| const std::string& database_identifier);
|
|
|
| - void RequestIDBFactoryOpen(
|
| - const base::string16& name,
|
| - int64 version,
|
| - int64 transaction_id,
|
| - blink::WebIDBCallbacks* callbacks,
|
| - blink::WebIDBDatabaseCallbacks* database_callbacks,
|
| - const std::string& database_identifier);
|
| + void RequestIDBFactoryOpen(const base::string16& name,
|
| + int64_t version,
|
| + int64_t transaction_id,
|
| + blink::WebIDBCallbacks* callbacks,
|
| + blink::WebIDBDatabaseCallbacks* database_callbacks,
|
| + const std::string& database_identifier);
|
|
|
| void RequestIDBFactoryDeleteDatabase(const base::string16& name,
|
| blink::WebIDBCallbacks* callbacks,
|
| @@ -88,97 +91,97 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
|
| // This method is virtual so it can be overridden in unit tests.
|
| virtual void RequestIDBCursorAdvance(unsigned long count,
|
| blink::WebIDBCallbacks* callbacks_ptr,
|
| - int32 ipc_cursor_id,
|
| - int64 transaction_id);
|
| + 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 ipc_cursor_id,
|
| - int64 transaction_id);
|
| + 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 ipc_cursor_id);
|
| + int32_t ipc_cursor_id);
|
|
|
| // This method is virtual so it can be overridden in unit tests.
|
| virtual void RequestIDBCursorPrefetchReset(int used_prefetches,
|
| int unused_prefetches,
|
| - int32 ipc_cursor_id);
|
| + int32_t ipc_cursor_id);
|
|
|
| - void RequestIDBDatabaseClose(int32 ipc_database_id,
|
| - int32 ipc_database_callbacks_id);
|
| + void RequestIDBDatabaseClose(int32_t ipc_database_id,
|
| + int32_t ipc_database_callbacks_id);
|
|
|
| - void NotifyIDBDatabaseVersionChangeIgnored(int32 ipc_database_id);
|
| + void NotifyIDBDatabaseVersionChangeIgnored(int32_t ipc_database_id);
|
|
|
| void RequestIDBDatabaseCreateTransaction(
|
| - int32 ipc_database_id,
|
| - int64 transaction_id,
|
| + int32_t ipc_database_id,
|
| + int64_t transaction_id,
|
| blink::WebIDBDatabaseCallbacks* database_callbacks_ptr,
|
| blink::WebVector<long long> object_store_ids,
|
| blink::WebIDBTransactionMode mode);
|
|
|
| - void RequestIDBDatabaseGet(int32 ipc_database_id,
|
| - int64 transaction_id,
|
| - int64 object_store_id,
|
| - int64 index_id,
|
| + void RequestIDBDatabaseGet(int32_t ipc_database_id,
|
| + int64_t transaction_id,
|
| + int64_t object_store_id,
|
| + int64_t index_id,
|
| const IndexedDBKeyRange& key_range,
|
| bool key_only,
|
| blink::WebIDBCallbacks* callbacks);
|
|
|
| - void RequestIDBDatabaseGetAll(int32 ipc_database_id,
|
| - int64 transaction_id,
|
| - int64 object_store_id,
|
| - int64 index_id,
|
| + void RequestIDBDatabaseGetAll(int32_t ipc_database_id,
|
| + int64_t transaction_id,
|
| + int64_t object_store_id,
|
| + int64_t index_id,
|
| const IndexedDBKeyRange& key_range,
|
| bool key_only,
|
| - int64 max_count,
|
| + int64_t max_count,
|
| blink::WebIDBCallbacks* callbacks);
|
|
|
| void RequestIDBDatabasePut(
|
| - int32 ipc_database_id,
|
| - int64 transaction_id,
|
| - int64 object_store_id,
|
| + int32_t ipc_database_id,
|
| + int64_t transaction_id,
|
| + int64_t object_store_id,
|
| const blink::WebData& value,
|
| const blink::WebVector<blink::WebBlobInfo>& web_blob_info,
|
| const IndexedDBKey& key,
|
| blink::WebIDBPutMode put_mode,
|
| blink::WebIDBCallbacks* callbacks,
|
| const blink::WebVector<long long>& index_ids,
|
| - const blink::WebVector<blink::WebVector<blink::WebIDBKey> >& index_keys);
|
| + const blink::WebVector<blink::WebVector<blink::WebIDBKey>>& index_keys);
|
|
|
| - void RequestIDBDatabaseOpenCursor(int32 ipc_database_id,
|
| - int64 transaction_id,
|
| - int64 object_store_id,
|
| - int64 index_id,
|
| + void RequestIDBDatabaseOpenCursor(int32_t ipc_database_id,
|
| + int64_t transaction_id,
|
| + int64_t object_store_id,
|
| + int64_t index_id,
|
| const IndexedDBKeyRange& key_range,
|
| blink::WebIDBCursorDirection direction,
|
| bool key_only,
|
| blink::WebIDBTaskType task_type,
|
| blink::WebIDBCallbacks* callbacks);
|
|
|
| - void RequestIDBDatabaseCount(int32 ipc_database_id,
|
| - int64 transaction_id,
|
| - int64 object_store_id,
|
| - int64 index_id,
|
| + void RequestIDBDatabaseCount(int32_t ipc_database_id,
|
| + int64_t transaction_id,
|
| + int64_t object_store_id,
|
| + int64_t index_id,
|
| const IndexedDBKeyRange& key_range,
|
| blink::WebIDBCallbacks* callbacks);
|
|
|
| - void RequestIDBDatabaseDeleteRange(int32 ipc_database_id,
|
| - int64 transaction_id,
|
| - int64 object_store_id,
|
| + void RequestIDBDatabaseDeleteRange(int32_t ipc_database_id,
|
| + int64_t transaction_id,
|
| + int64_t object_store_id,
|
| const IndexedDBKeyRange& key_range,
|
| blink::WebIDBCallbacks* callbacks);
|
|
|
| - void RequestIDBDatabaseClear(int32 ipc_database_id,
|
| - int64 transaction_id,
|
| - int64 object_store_id,
|
| + void RequestIDBDatabaseClear(int32_t ipc_database_id,
|
| + int64_t transaction_id,
|
| + int64_t object_store_id,
|
| blink::WebIDBCallbacks* callbacks);
|
|
|
| - virtual void CursorDestroyed(int32 ipc_cursor_id);
|
| - void DatabaseDestroyed(int32 ipc_database_id);
|
| + virtual void CursorDestroyed(int32_t ipc_cursor_id);
|
| + void DatabaseDestroyed(int32_t ipc_database_id);
|
|
|
| private:
|
| FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorReset);
|
| @@ -188,7 +191,7 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
|
|
|
| enum { kAllCursors = -1 };
|
|
|
| - static int32 CurrentWorkerId() { return WorkerThread::GetCurrentId(); }
|
| + static int32_t CurrentWorkerId() { return WorkerThread::GetCurrentId(); }
|
|
|
| template <typename T>
|
| void init_params(T* params, blink::WebIDBCallbacks* callbacks_ptr) {
|
| @@ -198,13 +201,13 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
|
| }
|
|
|
| // IDBCallback message handlers.
|
| - void OnSuccessIDBDatabase(int32 ipc_thread_id,
|
| - int32 ipc_callbacks_id,
|
| - int32 ipc_database_callbacks_id,
|
| - int32 ipc_object_id,
|
| + void OnSuccessIDBDatabase(int32_t ipc_thread_id,
|
| + int32_t ipc_callbacks_id,
|
| + int32_t ipc_database_callbacks_id,
|
| + int32_t ipc_object_id,
|
| const IndexedDBDatabaseMetadata& idb_metadata);
|
| - void OnSuccessIndexedDBKey(int32 ipc_thread_id,
|
| - int32 ipc_callbacks_id,
|
| + void OnSuccessIndexedDBKey(int32_t ipc_thread_id,
|
| + int32_t ipc_callbacks_id,
|
| const IndexedDBKey& key);
|
|
|
| void OnSuccessOpenCursor(
|
| @@ -213,40 +216,40 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
|
| const IndexedDBMsg_CallbacksSuccessCursorContinue_Params& p);
|
| void OnSuccessCursorPrefetch(
|
| const IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params& p);
|
| - void OnSuccessStringList(int32 ipc_thread_id,
|
| - int32 ipc_callbacks_id,
|
| + void OnSuccessStringList(int32_t ipc_thread_id,
|
| + int32_t ipc_callbacks_id,
|
| const std::vector<base::string16>& value);
|
| void OnSuccessValue(const IndexedDBMsg_CallbacksSuccessValue_Params& p);
|
| void OnSuccessArray(const IndexedDBMsg_CallbacksSuccessArray_Params& p);
|
| - void OnSuccessInteger(int32 ipc_thread_id,
|
| - int32 ipc_callbacks_id,
|
| - int64 value);
|
| - void OnSuccessUndefined(int32 ipc_thread_id, int32 ipc_callbacks_id);
|
| - void OnError(int32 ipc_thread_id,
|
| - int32 ipc_callbacks_id,
|
| + void OnSuccessInteger(int32_t ipc_thread_id,
|
| + int32_t ipc_callbacks_id,
|
| + int64_t value);
|
| + void OnSuccessUndefined(int32_t ipc_thread_id, int32_t ipc_callbacks_id);
|
| + void OnError(int32_t ipc_thread_id,
|
| + int32_t ipc_callbacks_id,
|
| int code,
|
| const base::string16& message);
|
| - void OnIntBlocked(int32 ipc_thread_id,
|
| - int32 ipc_callbacks_id,
|
| - int64 existing_version);
|
| + void OnIntBlocked(int32_t ipc_thread_id,
|
| + int32_t ipc_callbacks_id,
|
| + int64_t existing_version);
|
| void OnUpgradeNeeded(const IndexedDBMsg_CallbacksUpgradeNeeded_Params& p);
|
| - void OnAbort(int32 ipc_thread_id,
|
| - int32 ipc_database_id,
|
| - int64 transaction_id,
|
| + void OnAbort(int32_t ipc_thread_id,
|
| + int32_t ipc_database_id,
|
| + int64_t transaction_id,
|
| int code,
|
| const base::string16& message);
|
| - void OnComplete(int32 ipc_thread_id,
|
| - int32 ipc_database_id,
|
| - int64 transaction_id);
|
| - void OnForcedClose(int32 ipc_thread_id, int32 ipc_database_id);
|
| - void OnIntVersionChange(int32 ipc_thread_id,
|
| - int32 ipc_database_id,
|
| - int64 old_version,
|
| - int64 new_version);
|
| + void OnComplete(int32_t ipc_thread_id,
|
| + int32_t ipc_database_id,
|
| + int64_t transaction_id);
|
| + void OnForcedClose(int32_t ipc_thread_id, int32_t ipc_database_id);
|
| + void OnIntVersionChange(int32_t ipc_thread_id,
|
| + int32_t ipc_database_id,
|
| + int64_t old_version,
|
| + int64_t new_version);
|
|
|
| // Reset cursor prefetch caches for all cursors except exception_cursor_id.
|
| - void ResetCursorPrefetchCaches(int64 transaction_id,
|
| - int32 ipc_exception_cursor_id);
|
| + void ResetCursorPrefetchCaches(int64_t transaction_id,
|
| + int32_t ipc_exception_cursor_id);
|
|
|
| scoped_refptr<ThreadSafeSender> thread_safe_sender_;
|
|
|
| @@ -265,12 +268,12 @@ class CONTENT_EXPORT IndexedDBDispatcher : public WorkerThread::Observer {
|
| // Maps the ipc_callback_id from an open cursor request to the request's
|
| // transaction_id. Used to assign the transaction_id to the WebIDBCursorImpl
|
| // when it is created.
|
| - std::map<int32, int64> cursor_transaction_ids_;
|
| + std::map<int32_t, int64_t> cursor_transaction_ids_;
|
|
|
| // Map from cursor id to WebIDBCursorImpl.
|
| - std::map<int32, WebIDBCursorImpl*> cursors_;
|
| + std::map<int32_t, WebIDBCursorImpl*> cursors_;
|
|
|
| - std::map<int32, WebIDBDatabaseImpl*> databases_;
|
| + std::map<int32_t, WebIDBDatabaseImpl*> databases_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher);
|
| };
|
|
|