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_FILE_SYSTEM_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // class. It hasn't been necessary for anything that uses the canned | 137 // class. It hasn't been necessary for anything that uses the canned |
138 // implementation, as the canned class is only used in tests, or in read-only | 138 // implementation, as the canned class is only used in tests, or in read-only |
139 // contexts (like the non-modal cookie dialog). | 139 // contexts (like the non-modal cookie dialog). |
140 virtual void DeleteFileSystemOrigin(const GURL& origin) OVERRIDE {} | 140 virtual void DeleteFileSystemOrigin(const GURL& origin) OVERRIDE {} |
141 | 141 |
142 private: | 142 private: |
143 // Used by Clone() to create an object without a Profile | 143 // Used by Clone() to create an object without a Profile |
144 CannedBrowsingDataFileSystemHelper(); | 144 CannedBrowsingDataFileSystemHelper(); |
145 virtual ~CannedBrowsingDataFileSystemHelper(); | 145 virtual ~CannedBrowsingDataFileSystemHelper(); |
146 | 146 |
147 // Holds the current list of filesystems returned to the client. Access to | 147 // Holds the current list of filesystems returned to the client. |
148 // |file_system_info_| is triggered indirectly via the UI thread and guarded | |
149 // by |is_fetching_|. This means |file_system_info_| is only accessed while | |
150 // |is_fetching_| is true. The flag |is_fetching_| is only accessed on the UI | |
151 // thread. | |
152 std::list<FileSystemInfo> file_system_info_; | 148 std::list<FileSystemInfo> file_system_info_; |
153 | 149 |
154 // The callback passed in at the beginning of the StartFetching workflow so | 150 // The callback passed in at the beginning of the StartFetching workflow so |
155 // that it can be triggered via NotifyOnUIThread. | 151 // that it can be triggered via NotifyOnUIThread. |
156 base::Callback<void(const std::list<FileSystemInfo>&)> completion_callback_; | 152 base::Callback<void(const std::list<FileSystemInfo>&)> completion_callback_; |
157 | 153 |
158 // Indicates whether or not we're currently fetching information: set to true | |
159 // when StartFetching is called on the UI thread, and reset to false when | |
160 // NotifyOnUIThread triggers the success callback. | |
161 // This property only mutates on the UI thread. | |
162 bool is_fetching_; | |
163 | |
164 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataFileSystemHelper); | 154 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataFileSystemHelper); |
165 }; | 155 }; |
166 | 156 |
167 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ | 157 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ |
OLD | NEW |