OLD | NEW |
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 CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_DATABASE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_DATABASE_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_DATABASE_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_DATABASE_HELPER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void NotifyInUIThread(); | 65 void NotifyInUIThread(); |
66 | 66 |
67 // Access to |database_info_| is triggered indirectly via the UI thread and | 67 // Access to |database_info_| is triggered indirectly via the UI thread and |
68 // guarded by |is_fetching_|. This means |database_info_| is only accessed | 68 // guarded by |is_fetching_|. This means |database_info_| is only accessed |
69 // while |is_fetching_| is true. The flag |is_fetching_| is only accessed on | 69 // while |is_fetching_| is true. The flag |is_fetching_| is only accessed on |
70 // the UI thread. | 70 // the UI thread. |
71 // In the context of this class |database_info_| is only accessed on the FILE | 71 // In the context of this class |database_info_| is only accessed on the FILE |
72 // thread. | 72 // thread. |
73 std::list<DatabaseInfo> database_info_; | 73 std::list<DatabaseInfo> database_info_; |
74 | 74 |
75 // This only mutates on the UI thread. | 75 // This member is only mutated on the UI thread. |
76 base::Callback<void(const std::list<DatabaseInfo>&)> completion_callback_; | 76 base::Callback<void(const std::list<DatabaseInfo>&)> completion_callback_; |
77 | 77 |
78 // Indicates whether or not we're currently fetching information: | 78 // Indicates whether or not we're currently fetching information: |
79 // it's true when StartFetching() is called in the UI thread, and it's reset | 79 // it's true when StartFetching() is called in the UI thread, and it's reset |
80 // after we notify the callback in the UI thread. | 80 // after we notify the callback in the UI thread. |
81 // This only mutates on the UI thread. | 81 // This member is only mutated on the UI thread. |
82 bool is_fetching_; | 82 bool is_fetching_; |
83 | 83 |
84 private: | 84 private: |
85 // Enumerates all databases. This must be called in the FILE thread. | 85 // Enumerates all databases. This must be called in the FILE thread. |
86 void FetchDatabaseInfoOnFileThread(); | 86 void FetchDatabaseInfoOnFileThread(); |
87 | 87 |
88 // Delete a single database file. This must be called in the FILE thread. | 88 // Delete a single database file. This must be called in the FILE thread. |
89 void DeleteDatabaseOnFileThread(const std::string& origin, | 89 void DeleteDatabaseOnFileThread(const std::string& origin, |
90 const std::string& name); | 90 const std::string& name); |
91 | 91 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 virtual ~CannedBrowsingDataDatabaseHelper(); | 149 virtual ~CannedBrowsingDataDatabaseHelper(); |
150 | 150 |
151 std::set<PendingDatabaseInfo> pending_database_info_; | 151 std::set<PendingDatabaseInfo> pending_database_info_; |
152 | 152 |
153 Profile* profile_; | 153 Profile* profile_; |
154 | 154 |
155 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataDatabaseHelper); | 155 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataDatabaseHelper); |
156 }; | 156 }; |
157 | 157 |
158 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_DATABASE_HELPER_H_ | 158 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_DATABASE_HELPER_H_ |
OLD | NEW |