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 |
(...skipping 13 matching lines...) Expand all Loading... |
24 class IndexedDBConnection; | 24 class IndexedDBConnection; |
25 class IndexedDBCursor; | 25 class IndexedDBCursor; |
26 class IndexedDBDatabase; | 26 class IndexedDBDatabase; |
27 class IndexedDBDatabaseCallbacks; | 27 class IndexedDBDatabaseCallbacks; |
28 struct IndexedDBDatabaseMetadata; | 28 struct IndexedDBDatabaseMetadata; |
29 | 29 |
30 class CONTENT_EXPORT IndexedDBCallbacks | 30 class CONTENT_EXPORT IndexedDBCallbacks |
31 : public base::RefCounted<IndexedDBCallbacks> { | 31 : public base::RefCounted<IndexedDBCallbacks> { |
32 public: | 32 public: |
33 // Simple payload responses | 33 // Simple payload responses |
34 static scoped_refptr<IndexedDBCallbacks> Create( | 34 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, |
35 IndexedDBDispatcherHost* dispatcher_host, | 35 int32 ipc_thread_id, |
36 int32 ipc_thread_id, | 36 int32 ipc_callbacks_id); |
37 int32 ipc_callbacks_id) { | |
38 return make_scoped_refptr(new IndexedDBCallbacks( | |
39 dispatcher_host, ipc_thread_id, ipc_callbacks_id)); | |
40 } | |
41 | 37 |
42 // IndexedDBCursor responses | 38 // IndexedDBCursor responses |
43 static scoped_refptr<IndexedDBCallbacks> Create( | 39 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, |
44 IndexedDBDispatcherHost* dispatcher_host, | 40 int32 ipc_thread_id, |
45 int32 ipc_thread_id, | 41 int32 ipc_callbacks_id, |
46 int32 ipc_callbacks_id, | 42 int32 ipc_cursor_id); |
47 int32 ipc_cursor_id) { | 43 |
48 return make_scoped_refptr(new IndexedDBCallbacks( | |
49 dispatcher_host, ipc_thread_id, ipc_callbacks_id, ipc_cursor_id)); | |
50 } | |
51 // IndexedDBDatabase responses | 44 // IndexedDBDatabase responses |
52 static scoped_refptr<IndexedDBCallbacks> Create( | 45 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, |
53 IndexedDBDispatcherHost* dispatcher_host, | 46 int32 ipc_thread_id, |
54 int32 ipc_thread_id, | 47 int32 ipc_callbacks_id, |
55 int32 ipc_callbacks_id, | 48 int32 ipc_database_callbacks_id, |
56 int32 ipc_database_callbacks_id, | 49 int64 host_transaction_id, |
57 int64 host_transaction_id, | 50 const GURL& origin_url); |
58 const GURL& origin_url) { | |
59 return make_scoped_refptr(new IndexedDBCallbacks(dispatcher_host, | |
60 ipc_thread_id, | |
61 ipc_callbacks_id, | |
62 ipc_database_callbacks_id, | |
63 host_transaction_id, | |
64 origin_url)); | |
65 } | |
66 | 51 |
67 virtual void OnError(const IndexedDBDatabaseError& error); | 52 virtual void OnError(const IndexedDBDatabaseError& error); |
68 | 53 |
69 // IndexedDBFactory::GetDatabaseNames | 54 // IndexedDBFactory::GetDatabaseNames |
70 virtual void OnSuccess(const std::vector<string16>& string); | 55 virtual void OnSuccess(const std::vector<string16>& string); |
71 | 56 |
72 // IndexedDBFactory::Open / DeleteDatabase | 57 // IndexedDBFactory::Open / DeleteDatabase |
73 virtual void OnBlocked(int64 existing_version); | 58 virtual void OnBlocked(int64 existing_version); |
74 | 59 |
75 // IndexedDBFactory::Open | 60 // IndexedDBFactory::Open |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // IndexedDBDatabase::Count | 97 // IndexedDBDatabase::Count |
113 virtual void OnSuccess(int64 value); | 98 virtual void OnSuccess(int64 value); |
114 | 99 |
115 // IndexedDBDatabase::Delete | 100 // IndexedDBDatabase::Delete |
116 // IndexedDBCursor::Continue / Advance (when complete) | 101 // IndexedDBCursor::Continue / Advance (when complete) |
117 virtual void OnSuccess(); | 102 virtual void OnSuccess(); |
118 | 103 |
119 protected: | 104 protected: |
120 virtual ~IndexedDBCallbacks(); | 105 virtual ~IndexedDBCallbacks(); |
121 | 106 |
122 // Simple payload responses | |
123 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, | |
124 int32 ipc_thread_id, | |
125 int32 ipc_callbacks_id); | |
126 | |
127 // IndexedDBCursor responses | |
128 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, | |
129 int32 ipc_thread_id, | |
130 int32 ipc_callbacks_id, | |
131 int32 ipc_cursor_id); | |
132 | |
133 // IndexedDBDatabase responses | |
134 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, | |
135 int32 ipc_thread_id, | |
136 int32 ipc_callbacks_id, | |
137 int32 ipc_database_callbacks_id, | |
138 int64 host_transaction_id, | |
139 const GURL& origin_url); | |
140 | |
141 private: | 107 private: |
142 friend class base::RefCounted<IndexedDBCallbacks>; | 108 friend class base::RefCounted<IndexedDBCallbacks>; |
143 | 109 |
144 // Originally from IndexedDBCallbacks: | 110 // Originally from IndexedDBCallbacks: |
145 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; | 111 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; |
146 int32 ipc_callbacks_id_; | 112 int32 ipc_callbacks_id_; |
147 int32 ipc_thread_id_; | 113 int32 ipc_thread_id_; |
148 | 114 |
149 // IndexedDBCursor callbacks ------------------------ | 115 // IndexedDBCursor callbacks ------------------------ |
150 int32 ipc_cursor_id_; | 116 int32 ipc_cursor_id_; |
151 | 117 |
152 // IndexedDBDatabase callbacks ------------------------ | 118 // IndexedDBDatabase callbacks ------------------------ |
153 int64 host_transaction_id_; | 119 int64 host_transaction_id_; |
154 GURL origin_url_; | 120 GURL origin_url_; |
155 int32 ipc_database_id_; | 121 int32 ipc_database_id_; |
156 int32 ipc_database_callbacks_id_; | 122 int32 ipc_database_callbacks_id_; |
157 }; | 123 }; |
158 | 124 |
159 } // namespace content | 125 } // namespace content |
160 | 126 |
161 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ | 127 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ |
OLD | NEW |