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 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" | 5 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 this, origin)); | 117 this, origin)); |
118 } | 118 } |
119 | 119 |
120 void BrowsingDataFileSystemHelperImpl::FetchFileSystemInfoInFileThread() { | 120 void BrowsingDataFileSystemHelperImpl::FetchFileSystemInfoInFileThread() { |
121 DCHECK(file_task_runner()->RunsTasksOnCurrentThread()); | 121 DCHECK(file_task_runner()->RunsTasksOnCurrentThread()); |
122 | 122 |
123 // We check usage for these filesystem types. | 123 // We check usage for these filesystem types. |
124 const fileapi::FileSystemType types[] = { | 124 const fileapi::FileSystemType types[] = { |
125 fileapi::kFileSystemTypeTemporary, | 125 fileapi::kFileSystemTypeTemporary, |
126 fileapi::kFileSystemTypePersistent, | 126 fileapi::kFileSystemTypePersistent, |
| 127 #if defined(ENABLE_EXTENSIONS) |
127 fileapi::kFileSystemTypeSyncable, | 128 fileapi::kFileSystemTypeSyncable, |
| 129 #endif |
128 }; | 130 }; |
129 | 131 |
130 typedef std::map<GURL, FileSystemInfo> OriginInfoMap; | 132 typedef std::map<GURL, FileSystemInfo> OriginInfoMap; |
131 OriginInfoMap file_system_info_map; | 133 OriginInfoMap file_system_info_map; |
132 for (size_t i = 0; i < arraysize(types); ++i) { | 134 for (size_t i = 0; i < arraysize(types); ++i) { |
133 fileapi::FileSystemType type = types[i]; | 135 fileapi::FileSystemType type = types[i]; |
134 fileapi::FileSystemQuotaUtil* quota_util = | 136 fileapi::FileSystemQuotaUtil* quota_util = |
135 filesystem_context_->GetQuotaUtil(type); | 137 filesystem_context_->GetQuotaUtil(type); |
136 DCHECK(quota_util); | 138 DCHECK(quota_util); |
137 std::set<GURL> origins; | 139 std::set<GURL> origins; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 252 } |
251 | 253 |
252 void CannedBrowsingDataFileSystemHelper::StartFetching( | 254 void CannedBrowsingDataFileSystemHelper::StartFetching( |
253 const base::Callback<void(const std::list<FileSystemInfo>&)>& callback) { | 255 const base::Callback<void(const std::list<FileSystemInfo>&)>& callback) { |
254 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 256 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
255 DCHECK(!callback.is_null()); | 257 DCHECK(!callback.is_null()); |
256 | 258 |
257 BrowserThread::PostTask( | 259 BrowserThread::PostTask( |
258 BrowserThread::UI, FROM_HERE, base::Bind(callback, file_system_info_)); | 260 BrowserThread::UI, FROM_HERE, base::Bind(callback, file_system_info_)); |
259 } | 261 } |
OLD | NEW |