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

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

Issue 2727733004: [IndexedDB] Closing mojo connections when renderer quits (Closed)
Patch Set: Cleaned up logging Created 3 years, 9 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
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/weak_ptr.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 IndexedDBContextImpl;
18 class IndexedDBDatabaseError; 19 class IndexedDBDatabaseError;
19 class IndexedDBDispatcherHost;
20 class IndexedDBTransaction; 20 class IndexedDBTransaction;
21 21
22 class CONTENT_EXPORT IndexedDBDatabaseCallbacks 22 class CONTENT_EXPORT IndexedDBDatabaseCallbacks
23 : public base::RefCounted<IndexedDBDatabaseCallbacks> { 23 : public base::RefCounted<IndexedDBDatabaseCallbacks> {
24 public: 24 public:
25 IndexedDBDatabaseCallbacks( 25 IndexedDBDatabaseCallbacks(
26 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host, 26 scoped_refptr<IndexedDBContextImpl> context,
27 ::indexed_db::mojom::DatabaseCallbacksAssociatedPtrInfo callbacks_info); 27 ::indexed_db::mojom::DatabaseCallbacksAssociatedPtrInfo callbacks_info);
28 28
29 virtual void OnForcedClose(); 29 virtual void OnForcedClose();
30 virtual void OnVersionChange(int64_t old_version, int64_t new_version); 30 virtual void OnVersionChange(int64_t old_version, int64_t new_version);
31 31
32 virtual void OnAbort(const IndexedDBTransaction& transaction, 32 virtual void OnAbort(const IndexedDBTransaction& transaction,
33 const IndexedDBDatabaseError& error); 33 const IndexedDBDatabaseError& error);
34 virtual void OnComplete(const IndexedDBTransaction& transaction); 34 virtual void OnComplete(const IndexedDBTransaction& transaction);
35 virtual void OnDatabaseChange( 35 virtual void OnDatabaseChange(
36 ::indexed_db::mojom::ObserverChangesPtr changes); 36 ::indexed_db::mojom::ObserverChangesPtr changes);
37 37
38 protected: 38 protected:
39 virtual ~IndexedDBDatabaseCallbacks(); 39 virtual ~IndexedDBDatabaseCallbacks();
40 40
41 private: 41 private:
42 friend class base::RefCounted<IndexedDBDatabaseCallbacks>; 42 friend class base::RefCounted<IndexedDBDatabaseCallbacks>;
43 43
44 class IOThreadHelper; 44 class IOThreadHelper;
45 45
46 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; 46 bool closed = false;
47 scoped_refptr<IndexedDBContextImpl> indexed_db_context_;
47 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_; 48 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_;
48 base::ThreadChecker thread_checker_; 49 base::ThreadChecker thread_checker_;
49 50
50 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabaseCallbacks); 51 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabaseCallbacks);
51 }; 52 };
52 53
53 } // namespace content 54 } // namespace content
54 55
55 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_ 56 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_CALLBACKS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698