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

Side by Side Diff: content/browser/indexed_db/indexed_db_callbacks.h

Issue 2500263003: Port messages sent by WebIDBCursorImpl to Mojo. (Closed)
Patch Set: Address dcheng@'s comments. 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 unified diff | Download patch
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 18 matching lines...) Expand all
29 class IndexedDBCursor; 29 class IndexedDBCursor;
30 class IndexedDBDatabase; 30 class IndexedDBDatabase;
31 struct IndexedDBDataLossInfo; 31 struct IndexedDBDataLossInfo;
32 struct IndexedDBDatabaseMetadata; 32 struct IndexedDBDatabaseMetadata;
33 struct IndexedDBReturnValue; 33 struct IndexedDBReturnValue;
34 struct IndexedDBValue; 34 struct IndexedDBValue;
35 35
36 class CONTENT_EXPORT IndexedDBCallbacks 36 class CONTENT_EXPORT IndexedDBCallbacks
37 : public base::RefCounted<IndexedDBCallbacks> { 37 : public base::RefCounted<IndexedDBCallbacks> {
38 public: 38 public:
39 // Simple payload responses
40 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host,
41 int32_t ipc_thread_id,
42 int32_t ipc_callbacks_id);
43
44 // IndexedDBCursor responses
45 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host,
46 int32_t ipc_thread_id,
47 int32_t ipc_callbacks_id,
48 int32_t ipc_cursor_id);
49
50 // Mojo-based responses
51 IndexedDBCallbacks( 39 IndexedDBCallbacks(
52 IndexedDBDispatcherHost* dispatcher_host, 40 IndexedDBDispatcherHost* dispatcher_host,
53 const url::Origin& origin, 41 const url::Origin& origin,
54 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks_info); 42 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks_info);
55 43
56 virtual void OnError(const IndexedDBDatabaseError& error); 44 virtual void OnError(const IndexedDBDatabaseError& error);
57 45
58 // IndexedDBFactory::GetDatabaseNames 46 // IndexedDBFactory::GetDatabaseNames
59 virtual void OnSuccess(const std::vector<base::string16>& string); 47 virtual void OnSuccess(const std::vector<base::string16>& string);
60 48
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 private: 109 private:
122 void RegisterBlobsAndSend(const std::vector<IndexedDBBlobInfo>& blob_info, 110 void RegisterBlobsAndSend(const std::vector<IndexedDBBlobInfo>& blob_info,
123 const base::Closure& callback); 111 const base::Closure& callback);
124 112
125 friend class base::RefCounted<IndexedDBCallbacks>; 113 friend class base::RefCounted<IndexedDBCallbacks>;
126 114
127 class IOThreadHelper; 115 class IOThreadHelper;
128 116
129 // Originally from IndexedDBCallbacks: 117 // Originally from IndexedDBCallbacks:
130 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; 118 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_;
131 int32_t ipc_callbacks_id_;
132 int32_t ipc_thread_id_;
133
134 // IndexedDBCursor callbacks ------------------------
135 int32_t ipc_cursor_id_;
136 119
137 // IndexedDBDatabase callbacks ------------------------ 120 // IndexedDBDatabase callbacks ------------------------
138 int64_t host_transaction_id_; 121 int64_t host_transaction_id_;
139 url::Origin origin_; 122 url::Origin origin_;
140 bool database_sent_ = false; 123 bool database_sent_ = false;
141 124
142 // Used to assert that OnSuccess is only called if there was no data loss. 125 // Used to assert that OnSuccess is only called if there was no data loss.
143 blink::WebIDBDataLoss data_loss_; 126 blink::WebIDBDataLoss data_loss_;
144 127
145 // The "blocked" event should be sent at most once per request. 128 // The "blocked" event should be sent at most once per request.
146 bool sent_blocked_; 129 bool sent_blocked_;
147 base::TimeTicks connection_open_start_time_; 130 base::TimeTicks connection_open_start_time_;
148 131
149 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_; 132 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_;
150 base::ThreadChecker thread_checker_; 133 base::ThreadChecker thread_checker_;
151 134
152 DISALLOW_COPY_AND_ASSIGN(IndexedDBCallbacks); 135 DISALLOW_COPY_AND_ASSIGN(IndexedDBCallbacks);
153 }; 136 };
154 137
155 } // namespace content 138 } // namespace content
156 139
157 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ 140 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_
OLDNEW
« no previous file with comments | « content/browser/indexed_db/cursor_impl.cc ('k') | content/browser/indexed_db/indexed_db_callbacks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698