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 // Chromium settings and storage represent user-selected preferences and | 5 // Chromium settings and storage represent user-selected preferences and |
6 // information and MUST not be extracted, overwritten or modified except | 6 // information and MUST not be extracted, overwritten or modified except |
7 // through Chromium defined APIs. | 7 // through Chromium defined APIs. |
8 | 8 |
9 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_SERVICE_H_ | 9 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_SERVICE_H_ |
10 #define COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_SERVICE_H_ | 10 #define COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_SERVICE_H_ |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 void RegisterDBErrorCallback(const DBLoadErrorCallback& callback); | 113 void RegisterDBErrorCallback(const DBLoadErrorCallback& callback); |
114 | 114 |
115 bool db_loaded() const { return db_loaded_; }; | 115 bool db_loaded() const { return db_loaded_; }; |
116 | 116 |
117 private: | 117 private: |
118 class BackendDelegate; | 118 class BackendDelegate; |
119 friend class BackendDelegate; | 119 friend class BackendDelegate; |
120 friend class base::RefCountedDeleteOnMessageLoop<WebDatabaseService>; | 120 friend class base::RefCountedDeleteOnMessageLoop<WebDatabaseService>; |
121 friend class base::DeleteHelper<WebDatabaseService>; | 121 friend class base::DeleteHelper<WebDatabaseService>; |
122 | 122 |
123 typedef std::vector<DBLoadedCallback> LoadedCallbacks; | 123 using LoadedCallbacks = std::vector<DBLoadedCallback>; |
124 typedef std::vector<DBLoadErrorCallback> ErrorCallbacks; | 124 using ErrorCallbacks = std::vector<DBLoadErrorCallback>; |
125 | 125 |
126 virtual ~WebDatabaseService(); | 126 virtual ~WebDatabaseService(); |
127 | 127 |
128 void OnDatabaseLoadDone(sql::InitStatus status, | 128 void OnDatabaseLoadDone(sql::InitStatus status, |
129 const std::string& diagnostics); | 129 const std::string& diagnostics); |
130 | 130 |
131 base::FilePath path_; | 131 base::FilePath path_; |
132 | 132 |
133 // The primary owner is |WebDatabaseService| but is refcounted because | 133 // The primary owner is |WebDatabaseService| but is refcounted because |
134 // PostTask on DB thread may outlive us. | 134 // PostTask on DB thread may outlive us. |
(...skipping 10 matching lines...) Expand all Loading... |
145 | 145 |
146 scoped_refptr<base::SingleThreadTaskRunner> db_thread_; | 146 scoped_refptr<base::SingleThreadTaskRunner> db_thread_; |
147 | 147 |
148 // All vended weak pointers are invalidated in ShutdownDatabase(). | 148 // All vended weak pointers are invalidated in ShutdownDatabase(). |
149 base::WeakPtrFactory<WebDatabaseService> weak_ptr_factory_; | 149 base::WeakPtrFactory<WebDatabaseService> weak_ptr_factory_; |
150 | 150 |
151 DISALLOW_COPY_AND_ASSIGN(WebDatabaseService); | 151 DISALLOW_COPY_AND_ASSIGN(WebDatabaseService); |
152 }; | 152 }; |
153 | 153 |
154 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_SERVICE_H_ | 154 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_SERVICE_H_ |
OLD | NEW |