| 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_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  Loading... | 
| 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: | 
| 108 // WebIDBCursor uses onSuccess(WebIDBCursor*) when a cursor has been opened, | 110 // WebIDBCursor uses onSuccess(WebIDBCursor*) when a cursor has been opened, | 
| 109 // onSuccessWithContinuation() when a continue() call has succeeded, or | 111 // onSuccessWithContinuation() when a continue() call has succeeded, or | 
| 110 // onSuccess(SerializedScriptValue::nullValue()) to indicate it does | 112 // onSuccess(SerializedScriptValue::nullValue()) to indicate it does | 
| 111 // not contain any data, i.e., there is no key within the key range, | 113 // not contain any data, i.e., there is no key within the key range, | 
| 112 // or it has reached the end. | 114 // or it has reached the end. | 
|  | 115 // Post WK92278: | 
|  | 116 // WebIDBCursor uses: | 
|  | 117 // * onSuccess(WebIDBCursor*, WebIDBKey, WebIDBKey, SerializedScriptValue) | 
|  | 118 //   when an openCursor()/openKeyCursor() call has succeeded, | 
|  | 119 // * onSuccess(WebIDBKey, WebIDBKey, SerializedScriptValue) | 
|  | 120 //   when an advance()/continue() call has succeeded, or | 
|  | 121 // * onSuccess(SerializedScriptValue::nullValue()) | 
|  | 122 //   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. | 
| 113 template <> | 124 template <> | 
| 114 class IndexedDBCallbacks<WebKit::WebIDBCursor> | 125 class IndexedDBCallbacks<WebKit::WebIDBCursor> | 
| 115     : public IndexedDBCallbacksBase { | 126     : public IndexedDBCallbacksBase { | 
| 116  public: | 127  public: | 
| 117   IndexedDBCallbacks( | 128   IndexedDBCallbacks( | 
| 118       IndexedDBDispatcherHost* dispatcher_host, | 129       IndexedDBDispatcherHost* dispatcher_host, | 
| 119       int32 thread_id, | 130       int32 thread_id, | 
| 120       int32 response_id, | 131       int32 response_id, | 
| 121       int32 cursor_id) | 132       int32 cursor_id) | 
| 122       : IndexedDBCallbacksBase(dispatcher_host, thread_id, response_id), | 133       : IndexedDBCallbacksBase(dispatcher_host, thread_id, response_id), | 
| 123         cursor_id_(cursor_id) { } | 134         cursor_id_(cursor_id) { } | 
| 124 | 135 | 
|  | 136   // TODO(jsbell): Remove this after WK92278 rolls. | 
| 125   virtual void onSuccess(WebKit::WebIDBCursor* idb_object); | 137   virtual void onSuccess(WebKit::WebIDBCursor* idb_object); | 
|  | 138   virtual void onSuccess(WebKit::WebIDBCursor* idb_object, | 
|  | 139                          const WebKit::WebIDBKey& key, | 
|  | 140                          const WebKit::WebIDBKey& primaryKey, | 
|  | 141                          const WebKit::WebSerializedScriptValue& value); | 
|  | 142   virtual void onSuccess(const WebKit::WebIDBKey& key, | 
|  | 143                          const WebKit::WebIDBKey& primaryKey, | 
|  | 144                          const WebKit::WebSerializedScriptValue& value); | 
| 126   virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); | 145   virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); | 
|  | 146   // TODO(jsbell): Remove this after WK92278 rolls. | 
| 127   virtual void onSuccessWithContinuation(); | 147   virtual void onSuccessWithContinuation(); | 
| 128   virtual void onSuccessWithPrefetch( | 148   virtual void onSuccessWithPrefetch( | 
| 129       const WebKit::WebVector<WebKit::WebIDBKey>& keys, | 149       const WebKit::WebVector<WebKit::WebIDBKey>& keys, | 
| 130       const WebKit::WebVector<WebKit::WebIDBKey>& primaryKeys, | 150       const WebKit::WebVector<WebKit::WebIDBKey>& primaryKeys, | 
| 131       const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values); | 151       const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values); | 
| 132 | 152 | 
| 133  private: | 153  private: | 
| 134   // The id of the cursor this callback concerns, or -1 if the cursor | 154   // The id of the cursor this callback concerns, or -1 if the cursor | 
| 135   // does not exist yet. | 155   // does not exist yet. | 
| 136   int32 cursor_id_; | 156   int32 cursor_id_; | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 190   virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); | 210   virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); | 
| 191   virtual void onSuccess(const WebKit::WebSerializedScriptValue& value, | 211   virtual void onSuccess(const WebKit::WebSerializedScriptValue& value, | 
| 192                          const WebKit::WebIDBKey& key, | 212                          const WebKit::WebIDBKey& key, | 
| 193                          const WebKit::WebIDBKeyPath& keyPath); | 213                          const WebKit::WebIDBKeyPath& keyPath); | 
| 194 | 214 | 
| 195  private: | 215  private: | 
| 196   DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); | 216   DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); | 
| 197 }; | 217 }; | 
| 198 | 218 | 
| 199 #endif  // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ | 219 #endif  // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ | 
| OLD | NEW | 
|---|