| 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 "webkit/fileapi/sandbox_mount_point_provider.h" | 5 #include "webkit/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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 file_message_loop_(file_message_loop), | 309 file_message_loop_(file_message_loop), |
| 310 profile_path_(profile_path), | 310 profile_path_(profile_path), |
| 311 file_system_options_(file_system_options), | 311 file_system_options_(file_system_options), |
| 312 sandbox_file_util_( | 312 sandbox_file_util_( |
| 313 new ObfuscatedFileUtil( | 313 new ObfuscatedFileUtil( |
| 314 profile_path.Append(kNewFileSystemDirectory), | 314 profile_path.Append(kNewFileSystemDirectory), |
| 315 QuotaFileUtil::CreateDefault())) { | 315 QuotaFileUtil::CreateDefault())) { |
| 316 } | 316 } |
| 317 | 317 |
| 318 SandboxMountPointProvider::~SandboxMountPointProvider() { | 318 SandboxMountPointProvider::~SandboxMountPointProvider() { |
| 319 if (!file_message_loop_->BelongsToCurrentThread()) | 319 if (!file_message_loop_->BelongsToCurrentThread()) { |
| 320 file_message_loop_->ReleaseSoon(FROM_HERE, sandbox_file_util_.release()); | 320 ObfuscatedFileUtil* sandbox_file_util = sandbox_file_util_.release(); |
| 321 if (!file_message_loop_->ReleaseSoon(FROM_HERE, sandbox_file_util)) |
| 322 sandbox_file_util->Release(); |
| 323 } |
| 321 } | 324 } |
| 322 | 325 |
| 323 void SandboxMountPointProvider::ValidateFileSystemRoot( | 326 void SandboxMountPointProvider::ValidateFileSystemRoot( |
| 324 const GURL& origin_url, fileapi::FileSystemType type, bool create, | 327 const GURL& origin_url, fileapi::FileSystemType type, bool create, |
| 325 const ValidateFileSystemCallback& callback) { | 328 const ValidateFileSystemCallback& callback) { |
| 326 if (file_system_options_.is_incognito()) { | 329 if (file_system_options_.is_incognito()) { |
| 327 // TODO(kinuko): return an isolated temporary directory. | 330 // TODO(kinuko): return an isolated temporary directory. |
| 328 callback.Run(base::PLATFORM_FILE_ERROR_SECURITY); | 331 callback.Run(base::PLATFORM_FILE_ERROR_SECURITY); |
| 329 UMA_HISTOGRAM_ENUMERATION(kOpenFileSystem, | 332 UMA_HISTOGRAM_ENUMERATION(kOpenFileSystem, |
| 330 kIncognito, | 333 kIncognito, |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 i < file_system_options_.additional_allowed_schemes().size(); | 642 i < file_system_options_.additional_allowed_schemes().size(); |
| 640 ++i) { | 643 ++i) { |
| 641 if (url.SchemeIs( | 644 if (url.SchemeIs( |
| 642 file_system_options_.additional_allowed_schemes()[i].c_str())) | 645 file_system_options_.additional_allowed_schemes()[i].c_str())) |
| 643 return true; | 646 return true; |
| 644 } | 647 } |
| 645 return false; | 648 return false; |
| 646 } | 649 } |
| 647 | 650 |
| 648 } // namespace fileapi | 651 } // namespace fileapi |
| OLD | NEW |