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 3 // found in the LICENSE file. 4 5 #ifndef WEBKIT_BROWSER_FILEAPI_ISOLATED_FILE_UTIL_H_ 6 #define WEBKIT_BROWSER_FILEAPI_ISOLATED_FILE_UTIL_H_ 7 8 #include "base/memory/scoped_ptr.h" 9 #include "webkit/browser/fileapi/local_file_util.h" 10 #include "webkit/browser/webkit_storage_browser_export.h" 11 12 namespace fileapi { 13 14 class FileSystemOperationContext; 15 16 class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE IsolatedFileUtil 17 : public LocalFileUtil { 18 public: 19 IsolatedFileUtil(); 20 virtual ~IsolatedFileUtil() {} 21 22 // LocalFileUtil overrides. 23 virtual base::PlatformFileError GetLocalFilePath( 24 FileSystemOperationContext* context, 25 const FileSystemURL& file_system_url, 26 base::FilePath* local_file_path) OVERRIDE; 27 }; 28 29 // Dragged file system is a specialized IsolatedFileUtil where read access to 30 // the virtual root directory (i.e. empty cracked path case) is allowed 31 // and single isolated context may be associated with multiple file paths. 32 class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE DraggedFileUtil 33 : public IsolatedFileUtil { 34 public: 35 DraggedFileUtil(); 36 virtual ~DraggedFileUtil() {} 37 38 // FileSystemFileUtil overrides. 39 virtual base::PlatformFileError GetFileInfo( 40 FileSystemOperationContext* context, 41 const FileSystemURL& url, 42 base::PlatformFileInfo* file_info, 43 base::FilePath* platform_path) OVERRIDE; 44 virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator( 45 FileSystemOperationContext* context, 46 const FileSystemURL& root_url) OVERRIDE; 47 48 private: 49 DISALLOW_COPY_AND_ASSIGN(DraggedFileUtil); 50 }; 51 52 } // namespace fileapi 53 54 #endif // WEBKIT_BROWSER_FILEAPI_ISOLATED_FILE_UTIL_H_ 55