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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 GURL current; | 127 GURL current; |
128 | 128 |
129 while (!(current = origin_enumerator->Next()).is_empty()) { | 129 while (!(current = origin_enumerator->Next()).is_empty()) { |
130 if (!BrowsingDataHelper::HasWebScheme(current)) | 130 if (!BrowsingDataHelper::HasWebScheme(current)) |
131 continue; // Non-websafe state is not considered browsing data. | 131 continue; // Non-websafe state is not considered browsing data. |
132 | 132 |
133 // We can call these synchronous methods as we've already verified that | 133 // We can call these synchronous methods as we've already verified that |
134 // we're running on the FILE thread. | 134 // we're running on the FILE thread. |
135 int64 persistent_usage = quota_util->GetOriginUsageOnFileThread( | 135 int64 persistent_usage = quota_util->GetOriginUsageOnFileThread( |
136 filesystem_context_, current, | 136 filesystem_context_.get(), current, |
137 fileapi::kFileSystemTypePersistent); | 137 fileapi::kFileSystemTypePersistent); |
138 int64 temporary_usage = quota_util->GetOriginUsageOnFileThread( | 138 int64 temporary_usage = quota_util->GetOriginUsageOnFileThread( |
139 filesystem_context_, current, | 139 filesystem_context_.get(), current, |
140 fileapi::kFileSystemTypeTemporary); | 140 fileapi::kFileSystemTypeTemporary); |
141 file_system_info_.push_back( | 141 file_system_info_.push_back( |
142 FileSystemInfo( | 142 FileSystemInfo( |
143 current, | 143 current, |
144 origin_enumerator->HasFileSystemType( | 144 origin_enumerator->HasFileSystemType( |
145 fileapi::kFileSystemTypePersistent), | 145 fileapi::kFileSystemTypePersistent), |
146 origin_enumerator->HasFileSystemType( | 146 origin_enumerator->HasFileSystemType( |
147 fileapi::kFileSystemTypeTemporary), | 147 fileapi::kFileSystemTypeTemporary), |
148 persistent_usage, | 148 persistent_usage, |
149 temporary_usage)); | 149 temporary_usage)); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 base::Bind(&CannedBrowsingDataFileSystemHelper::NotifyOnUIThread, this)); | 277 base::Bind(&CannedBrowsingDataFileSystemHelper::NotifyOnUIThread, this)); |
278 } | 278 } |
279 | 279 |
280 void CannedBrowsingDataFileSystemHelper::NotifyOnUIThread() { | 280 void CannedBrowsingDataFileSystemHelper::NotifyOnUIThread() { |
281 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 281 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
282 DCHECK(is_fetching_); | 282 DCHECK(is_fetching_); |
283 completion_callback_.Run(file_system_info_); | 283 completion_callback_.Run(file_system_info_); |
284 completion_callback_.Reset(); | 284 completion_callback_.Reset(); |
285 is_fetching_ = false; | 285 is_fetching_ = false; |
286 } | 286 } |
OLD | NEW |