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

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

Issue 2472213003: [IndexedDB] Refactoring to remove ref ptrs and host transaction ids. (Closed)
Patch Set: comments Created 4 years 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_DATABASE_CALLBACKS_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 #include "content/common/indexed_db/indexed_db.mojom.h" 14 #include "content/common/indexed_db/indexed_db.mojom.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 16
17 namespace content { 17 namespace content {
18 class IndexedDBDatabaseError; 18 class IndexedDBDatabaseError;
19 class IndexedDBDispatcherHost; 19 class IndexedDBDispatcherHost;
20 class IndexedDBTransaction;
20 21
21 class CONTENT_EXPORT IndexedDBDatabaseCallbacks 22 class CONTENT_EXPORT IndexedDBDatabaseCallbacks
22 : public base::RefCounted<IndexedDBDatabaseCallbacks> { 23 : public base::RefCounted<IndexedDBDatabaseCallbacks> {
23 public: 24 public:
24 IndexedDBDatabaseCallbacks( 25 IndexedDBDatabaseCallbacks(
25 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host, 26 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host,
26 ::indexed_db::mojom::DatabaseCallbacksAssociatedPtrInfo callbacks_info); 27 ::indexed_db::mojom::DatabaseCallbacksAssociatedPtrInfo callbacks_info);
27 28
28 virtual void OnForcedClose(); 29 virtual void OnForcedClose();
29 virtual void OnVersionChange(int64_t old_version, int64_t new_version); 30 virtual void OnVersionChange(int64_t old_version, int64_t new_version);
30 31
31 virtual void OnAbort(int64_t host_transaction_id, 32 virtual void OnAbort(const IndexedDBTransaction& transaction,
32 const IndexedDBDatabaseError& error); 33 const IndexedDBDatabaseError& error);
33 virtual void OnComplete(int64_t host_transaction_id); 34 virtual void OnComplete(const IndexedDBTransaction& transaction);
34 virtual void OnDatabaseChange( 35 virtual void OnDatabaseChange(
35 ::indexed_db::mojom::ObserverChangesPtr changes); 36 ::indexed_db::mojom::ObserverChangesPtr changes);
36 37
37 protected: 38 protected:
38 virtual ~IndexedDBDatabaseCallbacks(); 39 virtual ~IndexedDBDatabaseCallbacks();
39 40
40 private: 41 private:
41 friend class base::RefCounted<IndexedDBDatabaseCallbacks>; 42 friend class base::RefCounted<IndexedDBDatabaseCallbacks>;
42 43
43 class IOThreadHelper; 44 class IOThreadHelper;
44 45
45 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; 46 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_;
46 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_; 47 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_;
47 base::ThreadChecker thread_checker_; 48 base::ThreadChecker thread_checker_;
48 49
49 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabaseCallbacks); 50 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabaseCallbacks);
50 }; 51 };
51 52
52 } // namespace content 53 } // namespace content
53 54
54 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ 55 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698