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

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

Issue 15724006: Migrate IDBDatabaseBackendTest from blink to chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix exports for WebIDBDatabase too 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
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_database.h » ('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) 2013 The Chromium Authors. All rights reserved. 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 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_WRAPPER_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_
7 7
8 #include <string>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 14 #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.h"
15 #include "content/browser/indexed_db/indexed_db_database_error.h" 16 #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.h"
17 #include "content/common/indexed_db/indexed_db_key_path.h" 18 #include "content/common/indexed_db/indexed_db_key_path.h"
18 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h" 19 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h"
19 20
20 namespace WebKit { 21 namespace WebKit {
21 class WebIDBCallbacks; 22 class WebIDBCallbacks;
22 } 23 }
23 24
24 namespace content { 25 namespace content {
25 class IndexedDBCursor; 26 class IndexedDBCursor;
26 class WebIDBDatabaseImpl; 27 class WebIDBDatabaseImpl;
27 28
28 class IndexedDBCallbacksWrapper 29 class CONTENT_EXPORT IndexedDBCallbacksWrapper
29 : public base::RefCounted<IndexedDBCallbacksWrapper> { 30 : public base::RefCounted<IndexedDBCallbacksWrapper> {
30 public: 31 public:
31 static scoped_refptr<IndexedDBCallbacksWrapper> Create( 32 static scoped_refptr<IndexedDBCallbacksWrapper> Create(
32 WebKit::WebIDBCallbacks* callbacks) { 33 WebKit::WebIDBCallbacks* callbacks) {
33 return make_scoped_refptr(new IndexedDBCallbacksWrapper(callbacks)); 34 return make_scoped_refptr(new IndexedDBCallbacksWrapper(callbacks));
34 } 35 }
35 36
36 virtual void OnError(scoped_refptr<IndexedDBDatabaseError> error); 37 virtual void OnError(scoped_refptr<IndexedDBDatabaseError> error);
37 // From IDBFactory.webkitGetDatabaseNames() 38 // From IDBFactory.webkitGetDatabaseNames()
38 virtual void OnSuccess(const std::vector<string16>& string); 39 virtual void OnSuccess(const std::vector<string16>& string);
(...skipping 23 matching lines...) Expand all
62 // From IDBCursor.advance()/continue() 63 // From IDBCursor.advance()/continue()
63 virtual void OnSuccess(const IndexedDBKey& key, 64 virtual void OnSuccess(const IndexedDBKey& key,
64 const IndexedDBKey& primary_key, 65 const IndexedDBKey& primary_key,
65 std::vector<char>* value); 66 std::vector<char>* value);
66 // From IDBCursor.advance()/continue() 67 // From IDBCursor.advance()/continue()
67 virtual void OnSuccessWithPrefetch( 68 virtual void OnSuccessWithPrefetch(
68 const std::vector<IndexedDBKey>& keys, 69 const std::vector<IndexedDBKey>& keys,
69 const std::vector<IndexedDBKey>& primary_keys, 70 const std::vector<IndexedDBKey>& primary_keys,
70 const std::vector<std::vector<char> >& values); 71 const std::vector<std::vector<char> >& values);
71 // From IDBFactory.open()/deleteDatabase() 72 // From IDBFactory.open()/deleteDatabase()
72 virtual void OnBlocked(int64 /* existing_version */); 73 virtual void OnBlocked(int64 existing_version);
73 // From IDBFactory.open() 74 // From IDBFactory.open()
74 virtual void OnUpgradeNeeded(int64 /* old_version */, 75 virtual void OnUpgradeNeeded(int64 /* old_version */,
75 scoped_refptr<IndexedDBDatabase> db, 76 scoped_refptr<IndexedDBDatabase> db,
76 const IndexedDBDatabaseMetadata& metadata); 77 const IndexedDBDatabaseMetadata& metadata);
77 virtual void OnSuccess(scoped_refptr<IndexedDBDatabase> db, 78 virtual void OnSuccess(scoped_refptr<IndexedDBDatabase> db,
78 const IndexedDBDatabaseMetadata& metadata); 79 const IndexedDBDatabaseMetadata& metadata);
79 virtual void SetDatabaseCallbacks( 80 virtual void SetDatabaseCallbacks(
80 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks); 81 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks);
81 82
83 protected:
84 virtual ~IndexedDBCallbacksWrapper();
85 explicit IndexedDBCallbacksWrapper(WebKit::WebIDBCallbacks* callbacks);
86
82 private: 87 private:
83 explicit IndexedDBCallbacksWrapper(WebKit::WebIDBCallbacks* callbacks);
84 virtual ~IndexedDBCallbacksWrapper();
85 friend class base::RefCounted<IndexedDBCallbacksWrapper>; 88 friend class base::RefCounted<IndexedDBCallbacksWrapper>;
86 scoped_ptr<WebIDBDatabaseImpl> web_database_impl_; 89 scoped_ptr<WebIDBDatabaseImpl> web_database_impl_;
87 scoped_ptr<WebKit::WebIDBCallbacks> callbacks_; 90 scoped_ptr<WebKit::WebIDBCallbacks> callbacks_;
88 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks_; 91 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks_;
89 bool did_complete_; 92 bool did_complete_;
90 bool did_create_proxy_; 93 bool did_create_proxy_;
91 }; 94 };
92 95
93 } // namespace content 96 } // namespace content
94 97
95 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_ 98 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698