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/browser/fileapi/sandbox_file_system_backend.h" | 5 #include "webkit/browser/fileapi/sandbox_file_system_backend.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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 SandboxFileSystemBackend::~SandboxFileSystemBackend() { | 166 SandboxFileSystemBackend::~SandboxFileSystemBackend() { |
167 } | 167 } |
168 | 168 |
169 bool SandboxFileSystemBackend::CanHandleType(FileSystemType type) const { | 169 bool SandboxFileSystemBackend::CanHandleType(FileSystemType type) const { |
170 return type == kFileSystemTypeTemporary || | 170 return type == kFileSystemTypeTemporary || |
171 type == kFileSystemTypePersistent || | 171 type == kFileSystemTypePersistent || |
172 type == kFileSystemTypeSyncable || | 172 type == kFileSystemTypeSyncable || |
173 type == kFileSystemTypeSyncableForInternalSync; | 173 type == kFileSystemTypeSyncableForInternalSync; |
174 } | 174 } |
175 | 175 |
176 void SandboxFileSystemBackend::OpenFileSystem( | 176 void SandboxFileSystemBackend::InitializeFileSystem( |
177 const GURL& origin_url, | 177 const GURL& origin_url, |
178 fileapi::FileSystemType type, | 178 fileapi::FileSystemType type, |
179 OpenFileSystemMode mode, | 179 OpenFileSystemMode mode, |
180 const OpenFileSystemCallback& callback) { | 180 FileSystemContext* context, |
| 181 const InitializeFileSystemCallback& callback) { |
181 if (file_system_options_.is_incognito() && | 182 if (file_system_options_.is_incognito() && |
182 !(type == kFileSystemTypeTemporary && | 183 !(type == kFileSystemTypeTemporary && |
183 enable_temporary_file_system_in_incognito_)) { | 184 enable_temporary_file_system_in_incognito_)) { |
184 // TODO(kinuko): return an isolated temporary directory. | 185 // TODO(kinuko): return an isolated temporary directory. |
185 callback.Run(GURL(), std::string(), base::PLATFORM_FILE_ERROR_SECURITY); | 186 callback.Run(GURL(), std::string(), base::PLATFORM_FILE_ERROR_SECURITY); |
186 UMA_HISTOGRAM_ENUMERATION(kOpenFileSystemLabel, | 187 UMA_HISTOGRAM_ENUMERATION(kOpenFileSystemLabel, |
187 kIncognito, | 188 kIncognito, |
188 kFileSystemErrorMax); | 189 kFileSystemErrorMax); |
189 return; | 190 return; |
190 } | 191 } |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 | 658 |
658 while (!(file_path_each = enumerator->Next()).empty()) { | 659 while (!(file_path_each = enumerator->Next()).empty()) { |
659 usage += enumerator->Size(); | 660 usage += enumerator->Size(); |
660 usage += ObfuscatedFileUtil::ComputeFilePathCost(file_path_each); | 661 usage += ObfuscatedFileUtil::ComputeFilePathCost(file_path_each); |
661 } | 662 } |
662 | 663 |
663 return usage; | 664 return usage; |
664 } | 665 } |
665 | 666 |
666 } // namespace fileapi | 667 } // namespace fileapi |
OLD | NEW |