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

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

Issue 10854081: IndexedDB: Simplify cursor data callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 months 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
« no previous file with comments | « no previous file | content/browser/in_process_webkit/indexed_db_callbacks.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" 10 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 NOTREACHED(); 98 NOTREACHED();
99 } 99 }
100 100
101 101
102 private: 102 private:
103 GURL origin_url_; 103 GURL origin_url_;
104 int32 database_id_; 104 int32 database_id_;
105 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); 105 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
106 }; 106 };
107 107
108 // TODO(jsbell): Remove this preamble comment after WK92278 rolls.
109 // Pre WK92278:
110 // WebIDBCursor uses onSuccess(WebIDBCursor*) when a cursor has been opened,
111 // onSuccessWithContinuation() when a continue() call has succeeded, or
112 // onSuccess(SerializedScriptValue::nullValue()) to indicate it does
113 // not contain any data, i.e., there is no key within the key range,
114 // or it has reached the end.
115 // Post WK92278:
116 // WebIDBCursor uses: 108 // WebIDBCursor uses:
117 // * onSuccess(WebIDBCursor*, WebIDBKey, WebIDBKey, SerializedScriptValue) 109 // * onSuccess(WebIDBCursor*, WebIDBKey, WebIDBKey, SerializedScriptValue)
118 // when an openCursor()/openKeyCursor() call has succeeded, 110 // when an openCursor()/openKeyCursor() call has succeeded,
119 // * onSuccess(WebIDBKey, WebIDBKey, SerializedScriptValue) 111 // * onSuccess(WebIDBKey, WebIDBKey, SerializedScriptValue)
120 // when an advance()/continue() call has succeeded, or 112 // when an advance()/continue() call has succeeded, or
121 // * onSuccess(SerializedScriptValue::nullValue()) 113 // * onSuccess(SerializedScriptValue::nullValue())
122 // to indicate it does not contain any data, i.e., there is no key within 114 // to indicate it does not contain any data, i.e., there is no key within
123 // the key range, or it has reached the end. 115 // the key range, or it has reached the end.
124 template <> 116 template <>
125 class IndexedDBCallbacks<WebKit::WebIDBCursor> 117 class IndexedDBCallbacks<WebKit::WebIDBCursor>
126 : public IndexedDBCallbacksBase { 118 : public IndexedDBCallbacksBase {
127 public: 119 public:
128 IndexedDBCallbacks( 120 IndexedDBCallbacks(
129 IndexedDBDispatcherHost* dispatcher_host, 121 IndexedDBDispatcherHost* dispatcher_host,
130 int32 thread_id, 122 int32 thread_id,
131 int32 response_id, 123 int32 response_id,
132 int32 cursor_id) 124 int32 cursor_id)
133 : IndexedDBCallbacksBase(dispatcher_host, thread_id, response_id), 125 : IndexedDBCallbacksBase(dispatcher_host, thread_id, response_id),
134 cursor_id_(cursor_id) { } 126 cursor_id_(cursor_id) { }
135 127
136 // TODO(jsbell): Remove this after WK92278 rolls.
137 virtual void onSuccess(WebKit::WebIDBCursor* idb_object);
138 virtual void onSuccess(WebKit::WebIDBCursor* idb_object, 128 virtual void onSuccess(WebKit::WebIDBCursor* idb_object,
139 const WebKit::WebIDBKey& key, 129 const WebKit::WebIDBKey& key,
140 const WebKit::WebIDBKey& primaryKey, 130 const WebKit::WebIDBKey& primaryKey,
141 const WebKit::WebSerializedScriptValue& value); 131 const WebKit::WebSerializedScriptValue& value);
142 virtual void onSuccess(const WebKit::WebIDBKey& key, 132 virtual void onSuccess(const WebKit::WebIDBKey& key,
143 const WebKit::WebIDBKey& primaryKey, 133 const WebKit::WebIDBKey& primaryKey,
144 const WebKit::WebSerializedScriptValue& value); 134 const WebKit::WebSerializedScriptValue& value);
145 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); 135 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value);
146 // TODO(jsbell): Remove this after WK92278 rolls.
147 virtual void onSuccessWithContinuation();
148 virtual void onSuccessWithPrefetch( 136 virtual void onSuccessWithPrefetch(
149 const WebKit::WebVector<WebKit::WebIDBKey>& keys, 137 const WebKit::WebVector<WebKit::WebIDBKey>& keys,
150 const WebKit::WebVector<WebKit::WebIDBKey>& primaryKeys, 138 const WebKit::WebVector<WebKit::WebIDBKey>& primaryKeys,
151 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values); 139 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values);
152 140
153 private: 141 private:
154 // The id of the cursor this callback concerns, or -1 if the cursor 142 // The id of the cursor this callback concerns, or -1 if the cursor
155 // does not exist yet. 143 // does not exist yet.
156 int32 cursor_id_; 144 int32 cursor_id_;
157 145
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); 198 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value);
211 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value, 199 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value,
212 const WebKit::WebIDBKey& key, 200 const WebKit::WebIDBKey& key,
213 const WebKit::WebIDBKeyPath& keyPath); 201 const WebKit::WebIDBKeyPath& keyPath);
214 202
215 private: 203 private:
216 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); 204 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
217 }; 205 };
218 206
219 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ 207 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/in_process_webkit/indexed_db_callbacks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698