| 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 #ifndef WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ |
| 6 #define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ |
| 7 | 7 |
| 8 #include "base/file_util_proxy.h" | 8 #include "base/file_util_proxy.h" |
| 9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 public base::SupportsWeakPtr<SimpleFileSystem> { | 35 public base::SupportsWeakPtr<SimpleFileSystem> { |
| 36 public: | 36 public: |
| 37 SimpleFileSystem(); | 37 SimpleFileSystem(); |
| 38 virtual ~SimpleFileSystem(); | 38 virtual ~SimpleFileSystem(); |
| 39 | 39 |
| 40 void OpenFileSystem(WebKit::WebFrame* frame, | 40 void OpenFileSystem(WebKit::WebFrame* frame, |
| 41 WebKit::WebFileSystem::Type type, | 41 WebKit::WebFileSystem::Type type, |
| 42 long long size, | 42 long long size, |
| 43 bool create, | 43 bool create, |
| 44 WebKit::WebFileSystemCallbacks* callbacks); | 44 WebKit::WebFileSystemCallbacks* callbacks); |
| 45 void DeleteFileSystem(WebKit::WebFrame* frame, |
| 46 WebKit::WebFileSystem::Type type, |
| 47 WebKit::WebFileSystemCallbacks* callbacks); |
| 45 | 48 |
| 46 fileapi::FileSystemContext* file_system_context() { | 49 fileapi::FileSystemContext* file_system_context() { |
| 47 return file_system_context_.get(); | 50 return file_system_context_.get(); |
| 48 } | 51 } |
| 49 | 52 |
| 50 // WebKit::WebFileSystem implementation. | 53 // WebKit::WebFileSystem implementation. |
| 51 virtual void move( | 54 virtual void move( |
| 52 const WebKit::WebURL& src_path, | 55 const WebKit::WebURL& src_path, |
| 53 const WebKit::WebURL& dest_path, | 56 const WebKit::WebURL& dest_path, |
| 54 WebKit::WebFileSystemCallbacks*) OVERRIDE; | 57 WebKit::WebFileSystemCallbacks*) OVERRIDE; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 111 |
| 109 // Callback Handlers | 112 // Callback Handlers |
| 110 fileapi::FileSystemOperationInterface::StatusCallback FinishHandler( | 113 fileapi::FileSystemOperationInterface::StatusCallback FinishHandler( |
| 111 WebKit::WebFileSystemCallbacks* callbacks); | 114 WebKit::WebFileSystemCallbacks* callbacks); |
| 112 fileapi::FileSystemOperationInterface::GetMetadataCallback GetMetadataHandler( | 115 fileapi::FileSystemOperationInterface::GetMetadataCallback GetMetadataHandler( |
| 113 WebKit::WebFileSystemCallbacks* callbacks); | 116 WebKit::WebFileSystemCallbacks* callbacks); |
| 114 fileapi::FileSystemOperationInterface::ReadDirectoryCallback | 117 fileapi::FileSystemOperationInterface::ReadDirectoryCallback |
| 115 ReadDirectoryHandler(WebKit::WebFileSystemCallbacks* callbacks); | 118 ReadDirectoryHandler(WebKit::WebFileSystemCallbacks* callbacks); |
| 116 fileapi::FileSystemContext::OpenFileSystemCallback OpenFileSystemHandler( | 119 fileapi::FileSystemContext::OpenFileSystemCallback OpenFileSystemHandler( |
| 117 WebKit::WebFileSystemCallbacks* callbacks); | 120 WebKit::WebFileSystemCallbacks* callbacks); |
| 121 fileapi::FileSystemContext::DeleteFileSystemCallback DeleteFileSystemHandler( |
| 122 WebKit::WebFileSystemCallbacks* callbacks); |
| 118 fileapi::FileSystemOperationInterface::SnapshotFileCallback | 123 fileapi::FileSystemOperationInterface::SnapshotFileCallback |
| 119 SnapshotFileHandler(const GURL& blob_url, | 124 SnapshotFileHandler(const GURL& blob_url, |
| 120 WebKit::WebFileSystemCallbacks* callbacks); | 125 WebKit::WebFileSystemCallbacks* callbacks); |
| 121 void DidFinish(WebKit::WebFileSystemCallbacks* callbacks, | 126 void DidFinish(WebKit::WebFileSystemCallbacks* callbacks, |
| 122 base::PlatformFileError result); | 127 base::PlatformFileError result); |
| 123 void DidGetMetadata(WebKit::WebFileSystemCallbacks* callbacks, | 128 void DidGetMetadata(WebKit::WebFileSystemCallbacks* callbacks, |
| 124 base::PlatformFileError result, | 129 base::PlatformFileError result, |
| 125 const base::PlatformFileInfo& info, | 130 const base::PlatformFileInfo& info, |
| 126 const FilePath& platform_path); | 131 const FilePath& platform_path); |
| 127 void DidReadDirectory( | 132 void DidReadDirectory( |
| 128 WebKit::WebFileSystemCallbacks* callbacks, | 133 WebKit::WebFileSystemCallbacks* callbacks, |
| 129 base::PlatformFileError result, | 134 base::PlatformFileError result, |
| 130 const std::vector<base::FileUtilProxy::Entry>& entries, | 135 const std::vector<base::FileUtilProxy::Entry>& entries, |
| 131 bool has_more); | 136 bool has_more); |
| 132 void DidOpenFileSystem(WebKit::WebFileSystemCallbacks* callbacks, | 137 void DidOpenFileSystem(WebKit::WebFileSystemCallbacks* callbacks, |
| 133 base::PlatformFileError result, | 138 base::PlatformFileError result, |
| 134 const std::string& name, const GURL& root); | 139 const std::string& name, const GURL& root); |
| 140 void DidDeleteFileSystem(WebKit::WebFileSystemCallbacks* callbacks, |
| 141 base::PlatformFileError result); |
| 135 void DidCreateSnapshotFile( | 142 void DidCreateSnapshotFile( |
| 136 const GURL& blob_url, | 143 const GURL& blob_url, |
| 137 WebKit::WebFileSystemCallbacks* callbacks, | 144 WebKit::WebFileSystemCallbacks* callbacks, |
| 138 base::PlatformFileError result, | 145 base::PlatformFileError result, |
| 139 const base::PlatformFileInfo& info, | 146 const base::PlatformFileInfo& info, |
| 140 const FilePath& platform_path, | 147 const FilePath& platform_path, |
| 141 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); | 148 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); |
| 142 | 149 |
| 143 // A temporary directory for FileSystem API. | 150 // A temporary directory for FileSystem API. |
| 144 ScopedTempDir file_system_dir_; | 151 ScopedTempDir file_system_dir_; |
| 145 | 152 |
| 146 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 153 scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
| 147 | 154 |
| 148 DISALLOW_COPY_AND_ASSIGN(SimpleFileSystem); | 155 DISALLOW_COPY_AND_ASSIGN(SimpleFileSystem); |
| 149 }; | 156 }; |
| 150 | 157 |
| 151 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ | 158 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_SYSTEM_H_ |
| OLD | NEW |