Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "content/browser/indexed_db/indexed_db_database_error.h" | 16 #include "content/browser/indexed_db/indexed_db_database_error.h" |
| 17 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" | 17 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
| 18 #include "content/common/indexed_db/indexed_db_key.h" | 18 #include "content/common/indexed_db/indexed_db_key.h" |
| 19 #include "content/common/indexed_db/indexed_db_key_path.h" | 19 #include "content/common/indexed_db/indexed_db_key_path.h" |
| 20 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
| 21 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h" | 21 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h" |
| 22 #include "third_party/WebKit/public/platform/WebIDBDatabase.h" | |
| 23 | 22 |
| 24 namespace content { | 23 namespace content { |
| 24 class IndexedDBConnection; | |
| 25 class IndexedDBCursor; | 25 class IndexedDBCursor; |
| 26 class IndexedDBDatabase; | 26 class IndexedDBDatabase; |
| 27 class IndexedDBDatabaseCallbacks; | 27 class IndexedDBDatabaseCallbacks; |
| 28 class WebIDBDatabaseImpl; | |
| 29 struct IndexedDBDatabaseMetadata; | 28 struct IndexedDBDatabaseMetadata; |
| 30 | 29 |
| 31 class CONTENT_EXPORT IndexedDBCallbacks | 30 class CONTENT_EXPORT IndexedDBCallbacks |
| 32 : public base::RefCounted<IndexedDBCallbacks> { | 31 : public base::RefCounted<IndexedDBCallbacks> { |
| 33 public: | 32 public: |
| 34 // Simple payload responses | 33 // Simple payload responses |
| 35 static scoped_refptr<IndexedDBCallbacks> Create( | 34 static scoped_refptr<IndexedDBCallbacks> Create( |
| 36 IndexedDBDispatcherHost* dispatcher_host, | 35 IndexedDBDispatcherHost* dispatcher_host, |
| 37 int32 ipc_thread_id, | 36 int32 ipc_thread_id, |
| 38 int32 ipc_callbacks_id) { | 37 int32 ipc_callbacks_id) { |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 69 | 68 |
| 70 // IndexedDBFactory::GetDatabaseNames | 69 // IndexedDBFactory::GetDatabaseNames |
| 71 virtual void OnSuccess(const std::vector<string16>& string); | 70 virtual void OnSuccess(const std::vector<string16>& string); |
| 72 | 71 |
| 73 // IndexedDBFactory::Open / DeleteDatabase | 72 // IndexedDBFactory::Open / DeleteDatabase |
| 74 virtual void OnBlocked(int64 existing_version); | 73 virtual void OnBlocked(int64 existing_version); |
| 75 | 74 |
| 76 // IndexedDBFactory::Open | 75 // IndexedDBFactory::Open |
| 77 virtual void OnUpgradeNeeded( | 76 virtual void OnUpgradeNeeded( |
| 78 int64 old_version, | 77 int64 old_version, |
| 79 scoped_refptr<IndexedDBDatabase> db, | 78 scoped_ptr<IndexedDBConnection> connection, |
| 80 const content::IndexedDBDatabaseMetadata& metadata, | 79 const content::IndexedDBDatabaseMetadata& metadata, |
| 81 WebKit::WebIDBCallbacks::DataLoss data_loss); | 80 WebKit::WebIDBCallbacks::DataLoss data_loss); |
| 82 virtual void OnSuccess(scoped_refptr<IndexedDBDatabase> db, | 81 virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection, |
| 83 const content::IndexedDBDatabaseMetadata& metadata); | 82 const content::IndexedDBDatabaseMetadata& metadata); |
| 84 void SetDatabaseCallbacks( | |
| 85 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks); | |
| 86 | 83 |
| 87 // IndexedDBDatabase::OpenCursor | 84 // IndexedDBDatabase::OpenCursor |
| 88 virtual void OnSuccess(scoped_refptr<IndexedDBCursor> cursor, | 85 virtual void OnSuccess(scoped_refptr<IndexedDBCursor> cursor, |
| 89 const IndexedDBKey& key, | 86 const IndexedDBKey& key, |
| 90 const IndexedDBKey& primary_key, | 87 const IndexedDBKey& primary_key, |
| 91 std::vector<char>* value); | 88 std::vector<char>* value); |
| 92 | 89 |
| 93 // IndexedDBCursor::Continue / Advance | 90 // IndexedDBCursor::Continue / Advance |
| 94 virtual void OnSuccess(const IndexedDBKey& key, | 91 virtual void OnSuccess(const IndexedDBKey& key, |
| 95 const IndexedDBKey& primary_key, | 92 const IndexedDBKey& primary_key, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, | 134 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, |
| 138 int32 ipc_thread_id, | 135 int32 ipc_thread_id, |
| 139 int32 ipc_callbacks_id, | 136 int32 ipc_callbacks_id, |
| 140 int32 ipc_database_callbacks_id, | 137 int32 ipc_database_callbacks_id, |
| 141 int64 host_transaction_id, | 138 int64 host_transaction_id, |
| 142 const GURL& origin_url); | 139 const GURL& origin_url); |
| 143 | 140 |
| 144 private: | 141 private: |
| 145 friend class base::RefCounted<IndexedDBCallbacks>; | 142 friend class base::RefCounted<IndexedDBCallbacks>; |
| 146 | 143 |
| 147 scoped_ptr<WebIDBDatabaseImpl> web_database_impl_; | |
|
jsbell
2013/07/02 17:38:15
Unused even before this patch.
| |
| 148 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks_; | |
|
jsbell
2013/07/02 17:38:15
The db callbacks and connection are now associated
| |
| 149 bool did_complete_; | |
|
jsbell
2013/07/02 17:38:15
Unused even before this patch.
| |
| 150 bool did_create_proxy_; | |
|
jsbell
2013/07/02 17:38:15
Redundant with ipc_database_id_
| |
| 151 | |
| 152 // Originally from IndexedDBCallbacks: | 144 // Originally from IndexedDBCallbacks: |
| 153 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; | 145 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; |
| 154 int32 ipc_callbacks_id_; | 146 int32 ipc_callbacks_id_; |
| 155 int32 ipc_thread_id_; | 147 int32 ipc_thread_id_; |
| 156 | 148 |
| 157 // IndexedDBCursor callbacks ------------------------ | 149 // IndexedDBCursor callbacks ------------------------ |
| 158 int32 ipc_cursor_id_; | 150 int32 ipc_cursor_id_; |
| 159 | 151 |
| 160 // IndexedDBDatabase callbacks ------------------------ | 152 // IndexedDBDatabase callbacks ------------------------ |
| 161 int64 host_transaction_id_; | 153 int64 host_transaction_id_; |
| 162 GURL origin_url_; | 154 GURL origin_url_; |
| 163 int32 ipc_database_id_; | 155 int32 ipc_database_id_; |
| 164 int32 ipc_database_callbacks_id_; | 156 int32 ipc_database_callbacks_id_; |
| 165 }; | 157 }; |
| 166 | 158 |
| 167 } // namespace content | 159 } // namespace content |
| 168 | 160 |
| 169 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ | 161 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ |
| OLD | NEW |