Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: webkit/browser/fileapi/sandbox_mount_point_provider.cc

Issue 15959006: Deprecate FileSystemMountPointProvider::GetFileSystemRootPathOnFileThread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "webkit/browser/fileapi/sandbox_mount_point_provider.h" 5 #include "webkit/browser/fileapi/sandbox_mount_point_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 // Schedule full usage recalculation on the next launch without 236 // Schedule full usage recalculation on the next launch without
237 // --disable-file-system-usage-tracking. 237 // --disable-file-system-usage-tracking.
238 file_task_runner_->PostTask( 238 file_task_runner_->PostTask(
239 FROM_HERE, 239 FROM_HERE,
240 base::Bind(&SandboxMountPointProvider::InvalidateUsageCacheOnFileThread, 240 base::Bind(&SandboxMountPointProvider::InvalidateUsageCacheOnFileThread,
241 sandbox_sync_file_util(), origin_url, type, 241 sandbox_sync_file_util(), origin_url, type,
242 file_system_usage_cache_.get())); 242 file_system_usage_cache_.get()));
243 }; 243 };
244 244
245 base::FilePath
246 SandboxMountPointProvider::GetFileSystemRootPathOnFileThread(
247 const FileSystemURL& url,
248 bool create) {
249 if (file_system_options_.is_incognito() &&
250 !(enable_temporary_file_system_in_incognito_ &&
251 url.type() == kFileSystemTypeTemporary)) {
252 // TODO(kinuko): return an isolated temporary directory.
253 return base::FilePath();
254 }
255
256 if (!IsAllowedScheme(url.origin()))
257 return base::FilePath();
258
259 return GetBaseDirectoryForOriginAndType(url.origin(), url.type(), create);
260 }
261
262 FileSystemFileUtil* SandboxMountPointProvider::GetFileUtil( 245 FileSystemFileUtil* SandboxMountPointProvider::GetFileUtil(
263 FileSystemType type) { 246 FileSystemType type) {
264 DCHECK(sandbox_file_util_.get()); 247 DCHECK(sandbox_file_util_.get());
265 return sandbox_file_util_->sync_file_util(); 248 return sandbox_file_util_->sync_file_util();
266 } 249 }
267 250
268 AsyncFileUtil* SandboxMountPointProvider::GetAsyncFileUtil( 251 AsyncFileUtil* SandboxMountPointProvider::GetAsyncFileUtil(
269 FileSystemType type) { 252 FileSystemType type) {
270 return sandbox_file_util_.get(); 253 return sandbox_file_util_.get();
271 } 254 }
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 674
692 while (!(file_path_each = enumerator->Next()).empty()) { 675 while (!(file_path_each = enumerator->Next()).empty()) {
693 usage += enumerator->Size(); 676 usage += enumerator->Size();
694 usage += ObfuscatedFileUtil::ComputeFilePathCost(file_path_each); 677 usage += ObfuscatedFileUtil::ComputeFilePathCost(file_path_each);
695 } 678 }
696 679
697 return usage; 680 return usage;
698 } 681 }
699 682
700 } // namespace fileapi 683 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/sandbox_mount_point_provider.h ('k') | webkit/browser/fileapi/test_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698