| 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/file_util.h" | 8 #include "base/file_util.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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 virtual bool HasFileSystemType(fileapi::FileSystemType type) const OVERRIDE { | 88 virtual bool HasFileSystemType(fileapi::FileSystemType type) const OVERRIDE { |
| 89 return enum_->HasFileSystemType(type); | 89 return enum_->HasFileSystemType(type); |
| 90 } | 90 } |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 scoped_ptr<ObfuscatedFileUtil::AbstractOriginEnumerator> enum_; | 93 scoped_ptr<ObfuscatedFileUtil::AbstractOriginEnumerator> enum_; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 void DidOpenFileSystem( | 96 void DidOpenFileSystem( |
| 97 base::WeakPtr<SandboxFileSystemBackend> mount_point_provider, | 97 base::WeakPtr<SandboxFileSystemBackend> sandbox_backend, |
| 98 const base::Callback<void(base::PlatformFileError error)>& callback, | 98 const base::Callback<void(base::PlatformFileError error)>& callback, |
| 99 base::PlatformFileError* error) { | 99 base::PlatformFileError* error) { |
| 100 if (mount_point_provider.get()) | 100 if (sandbox_backend.get()) |
| 101 mount_point_provider.get()->CollectOpenFileSystemMetrics(*error); | 101 sandbox_backend.get()->CollectOpenFileSystemMetrics(*error); |
| 102 callback.Run(*error); | 102 callback.Run(*error); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void OpenFileSystemOnFileThread( | 105 void OpenFileSystemOnFileThread( |
| 106 ObfuscatedFileUtil* file_util, | 106 ObfuscatedFileUtil* file_util, |
| 107 const GURL& origin_url, | 107 const GURL& origin_url, |
| 108 FileSystemType type, | 108 FileSystemType type, |
| 109 OpenFileSystemMode mode, | 109 OpenFileSystemMode mode, |
| 110 base::PlatformFileError* error_ptr) { | 110 base::PlatformFileError* error_ptr) { |
| 111 DCHECK(error_ptr); | 111 DCHECK(error_ptr); |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 | 653 |
| 654 while (!(file_path_each = enumerator->Next()).empty()) { | 654 while (!(file_path_each = enumerator->Next()).empty()) { |
| 655 usage += enumerator->Size(); | 655 usage += enumerator->Size(); |
| 656 usage += ObfuscatedFileUtil::ComputeFilePathCost(file_path_each); | 656 usage += ObfuscatedFileUtil::ComputeFilePathCost(file_path_each); |
| 657 } | 657 } |
| 658 | 658 |
| 659 return usage; | 659 return usage; |
| 660 } | 660 } |
| 661 | 661 |
| 662 } // namespace fileapi | 662 } // namespace fileapi |
| OLD | NEW |