OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_CONNECTION_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONNECTION_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONNECTION_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONNECTION_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "content/browser/indexed_db/indexed_db_database.h" | 14 #include "content/browser/indexed_db/indexed_db_database.h" |
15 #include "content/browser/indexed_db/indexed_db_database_callbacks.h" | 15 #include "content/browser/indexed_db/indexed_db_database_callbacks.h" |
16 #include "content/browser/indexed_db/indexed_db_observer.h" | 16 #include "content/browser/indexed_db/indexed_db_observer.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 class IndexedDBDatabaseError; | |
20 | 19 |
21 class CONTENT_EXPORT IndexedDBConnection { | 20 class CONTENT_EXPORT IndexedDBConnection { |
22 public: | 21 public: |
23 IndexedDBConnection(scoped_refptr<IndexedDBDatabase> db, | 22 IndexedDBConnection(scoped_refptr<IndexedDBDatabase> db, |
24 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks); | 23 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks); |
25 virtual ~IndexedDBConnection(); | 24 virtual ~IndexedDBConnection(); |
26 | 25 |
27 // These methods are virtual to allow subclassing in unit tests. | 26 // These methods are virtual to allow subclassing in unit tests. |
28 virtual void ForceClose(); | 27 virtual void ForceClose(); |
29 virtual void Close(); | 28 virtual void Close(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks_; | 60 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks_; |
62 std::vector<std::unique_ptr<IndexedDBObserver>> active_observers_; | 61 std::vector<std::unique_ptr<IndexedDBObserver>> active_observers_; |
63 base::WeakPtrFactory<IndexedDBConnection> weak_factory_; | 62 base::WeakPtrFactory<IndexedDBConnection> weak_factory_; |
64 | 63 |
65 DISALLOW_COPY_AND_ASSIGN(IndexedDBConnection); | 64 DISALLOW_COPY_AND_ASSIGN(IndexedDBConnection); |
66 }; | 65 }; |
67 | 66 |
68 } // namespace content | 67 } // namespace content |
69 | 68 |
70 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONNECTION_H_ | 69 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CONNECTION_H_ |
OLD | NEW |