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

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

Issue 15659013: Revert "Migrate the IndexedDB backend from Blink to Chromium" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/logging.h"
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "content/browser/indexed_db/indexed_db_database.h"
15 #include "content/browser/indexed_db/indexed_db_database_error.h"
16 #include "content/common/indexed_db/indexed_db_key.h"
17 #include "content/common/indexed_db/indexed_db_key_path.h"
18 #include "third_party/WebKit/Source/Platform/chromium/public/WebIDBCallbacks.h"
19
20 namespace WebKit {
21 class WebIDBCallbacks;
22 }
23
24 namespace content {
25 class IndexedDBCursor;
26 class WebIDBDatabaseImpl;
27
28 class IndexedDBCallbacksWrapper
29 : public base::RefCounted<IndexedDBCallbacksWrapper> {
30 public:
31 static scoped_refptr<IndexedDBCallbacksWrapper> Create(
32 WebKit::WebIDBCallbacks* callbacks) {
33 return make_scoped_refptr(new IndexedDBCallbacksWrapper(callbacks));
34 }
35
36 virtual void OnError(scoped_refptr<IndexedDBDatabaseError> error);
37 // From IDBFactory.webkitGetDatabaseNames()
38 virtual void OnSuccess(const std::vector<string16>& string);
39 // From IDBObjectStore/IDBIndex.openCursor(),
40 // IDBIndex.openKeyCursor()
41 virtual void OnSuccess(scoped_refptr<IndexedDBCursor> cursor,
42 const IndexedDBKey& key,
43 const IndexedDBKey& primary_key,
44 std::vector<char>* value);
45 // From IDBObjectStore.add()/put(), IDBIndex.getKey()
46 virtual void OnSuccess(const IndexedDBKey& key);
47 // From IDBObjectStore/IDBIndex.get()/count(), and various methods
48 // that yield null/undefined.
49 virtual void OnSuccess(std::vector<char>* value);
50 // From IDBObjectStore/IDBIndex.get() (with key injection)
51 virtual void OnSuccess(std::vector<char>* data,
52 const IndexedDBKey& key,
53 const IndexedDBKeyPath& key_path);
54 // From IDBObjectStore/IDBIndex.count()
55 virtual void OnSuccess(int64 value);
56
57 // From IDBFactor.deleteDatabase(),
58 // IDBObjectStore/IDBIndex.get(), IDBObjectStore.delete(),
59 // IDBObjectStore.clear()
60 virtual void OnSuccess();
61
62 // From IDBCursor.advance()/continue()
63 virtual void OnSuccess(const IndexedDBKey& key,
64 const IndexedDBKey& primary_key,
65 std::vector<char>* value);
66 // From IDBCursor.advance()/continue()
67 virtual void OnSuccessWithPrefetch(
68 const std::vector<IndexedDBKey>& keys,
69 const std::vector<IndexedDBKey>& primary_keys,
70 const std::vector<std::vector<char> >& values);
71 // From IDBFactory.open()/deleteDatabase()
72 virtual void OnBlocked(int64 /* existing_version */);
73 // From IDBFactory.open()
74 virtual void OnUpgradeNeeded(int64 /* old_version */,
75 scoped_refptr<IndexedDBDatabase> db,
76 const IndexedDBDatabaseMetadata& metadata);
77 virtual void OnSuccess(scoped_refptr<IndexedDBDatabase> db,
78 const IndexedDBDatabaseMetadata& metadata);
79 virtual void SetDatabaseCallbacks(
80 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks);
81
82 private:
83 explicit IndexedDBCallbacksWrapper(WebKit::WebIDBCallbacks* callbacks);
84 virtual ~IndexedDBCallbacksWrapper();
85 friend class base::RefCounted<IndexedDBCallbacksWrapper>;
86 scoped_ptr<WebIDBDatabaseImpl> web_database_impl_;
87 scoped_ptr<WebKit::WebIDBCallbacks> callbacks_;
88 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks_;
89 bool did_complete_;
90 bool did_create_proxy_;
91 };
92
93 } // namespace content
94
95 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698