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

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 & rebase Created 4 years, 1 month 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 IndexedDBObserverChanges; 20 class IndexedDBObserverChanges;
21 class IndexedDBTransaction;
21 22
22 class CONTENT_EXPORT IndexedDBDatabaseCallbacks 23 class CONTENT_EXPORT IndexedDBDatabaseCallbacks
23 : public base::RefCounted<IndexedDBDatabaseCallbacks> { 24 : public base::RefCounted<IndexedDBDatabaseCallbacks> {
24 public: 25 public:
25 IndexedDBDatabaseCallbacks( 26 IndexedDBDatabaseCallbacks(
26 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host, 27 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host,
27 int32_t ipc_thread_id, 28 int32_t ipc_thread_id,
28 ::indexed_db::mojom::DatabaseCallbacksAssociatedPtrInfo callbacks_info); 29 ::indexed_db::mojom::DatabaseCallbacksAssociatedPtrInfo callbacks_info);
29 30
30 virtual void OnForcedClose(); 31 virtual void OnForcedClose();
31 virtual void OnVersionChange(int64_t old_version, int64_t new_version); 32 virtual void OnVersionChange(int64_t old_version, int64_t new_version);
32 33
33 virtual void OnAbort(int64_t host_transaction_id, 34 virtual void OnAbort(const IndexedDBTransaction& transaction,
34 const IndexedDBDatabaseError& error); 35 const IndexedDBDatabaseError& error);
35 virtual void OnComplete(int64_t host_transaction_id); 36 virtual void OnComplete(const IndexedDBTransaction& transaction);
36 virtual void OnDatabaseChange( 37 virtual void OnDatabaseChange(
37 std::unique_ptr<IndexedDBObserverChanges> changes); 38 std::unique_ptr<IndexedDBObserverChanges> changes);
38 39
39 protected: 40 protected:
40 virtual ~IndexedDBDatabaseCallbacks(); 41 virtual ~IndexedDBDatabaseCallbacks();
41 42
42 private: 43 private:
43 friend class base::RefCounted<IndexedDBDatabaseCallbacks>; 44 friend class base::RefCounted<IndexedDBDatabaseCallbacks>;
44 45
45 class IOThreadHelper; 46 class IOThreadHelper;
46 47
47 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; 48 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_;
48 int32_t ipc_thread_id_; 49 int32_t ipc_thread_id_;
49 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_; 50 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_;
50 base::ThreadChecker thread_checker_; 51 base::ThreadChecker thread_checker_;
51 52
52 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabaseCallbacks); 53 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabaseCallbacks);
53 }; 54 };
54 55
55 } // namespace content 56 } // namespace content
56 57
57 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ 58 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698