| Index: webkit/fileapi/media_file_system_proxy.h
|
| diff --git a/webkit/fileapi/media_file_system_proxy.h b/webkit/fileapi/media_file_system_proxy.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fb91904f495d88788f8521c781febba8f8bf4f02
|
| --- /dev/null
|
| +++ b/webkit/fileapi/media_file_system_proxy.h
|
| @@ -0,0 +1,90 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef WEBKIT_FILEAPI_MEDIA_FILE_SYSTEM_PROXY_H_
|
| +#define WEBKIT_FILEAPI_MEDIA_FILE_SYSTEM_PROXY_H_
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/memory/ref_counted.h"
|
| +#include "webkit/fileapi/file_system_operation_interface.h"
|
| +
|
| +class GURL;
|
| +
|
| +namespace fileapi {
|
| +
|
| +class FileSystemOperationContext;
|
| +
|
| +// The interface class for media file system proxy.
|
| +class MediaFileSystemProxyInterface :
|
| + public base::RefCountedThreadSafe<MediaFileSystemProxyInterface> {
|
| + public:
|
| + // Gets the file or directory info for given|path|.
|
| + virtual void GetFileInfo(const FileSystemURL& url,
|
| + const FileSystemOperationInterface::GetMetadataCallback& callback) = 0;
|
| +
|
| + // Copies a file or directory from |src_url| to |dest_url|. If
|
| + // |src_url| is a directory, the contents of |src_url| are copied to
|
| + // |dest_url| recursively. A new file or directory is created at
|
| + // |dest_url| as needed.
|
| + virtual void Copy(
|
| + const FileSystemURL& src_url,
|
| + const FileSystemURL& dest_url,
|
| + const FileSystemOperationInterface::StatusCallback& callback) = 0;
|
| +
|
| + // Moves a file or directory from |src_url| to |dest_url|. A new file
|
| + // or directory is created at |dest_url| as needed.
|
| + virtual void Move(
|
| + const FileSystemURL& src_url,
|
| + const FileSystemURL& dest_url,
|
| + const FileSystemOperationInterface::StatusCallback& callback) = 0;
|
| +
|
| + // Reads contents of a directory at |url|.
|
| + virtual void ReadDirectory(
|
| + FileSystemOperationContext* context,
|
| + const FileSystemURL& url,
|
| + const FileSystemOperationInterface::ReadDirectoryCallback& callback) = 0;
|
| +
|
| + // Removes a file or directory at |url|. If |recursive| is true, remove
|
| + // all files and directories under the directory at |url| recursively.
|
| + virtual void Remove(const FileSystemURL& url, bool recursive,
|
| + const FileSystemOperationInterface::StatusCallback& callback) = 0;
|
| +
|
| + // Creates a directory at |url|. If |exclusive| is true, an error is
|
| + // raised in case a directory is already present at the URL. If
|
| + // |recursive| is true, create parent directories as needed just like
|
| + // mkdir -p does.
|
| + virtual void CreateDirectory(
|
| + const FileSystemURL& url,
|
| + bool exclusive,
|
| + bool recursive,
|
| + const FileSystemOperationInterface::StatusCallback& callback) = 0;
|
| +
|
| + // Creates a file at |url|. If the flag |is_exclusive| is true, an
|
| + // error is raised when a file already exists at the path. It is
|
| + // an error if a directory or a hosted document is already present at the
|
| + // path, or the parent directory of the path is not present yet.
|
| + virtual void CreateFile(
|
| + const FileSystemURL& url,
|
| + bool exclusive,
|
| + const FileSystemOperationInterface::StatusCallback& callback) = 0;
|
| +
|
| + // Opens file for a give |url| with specified |flags| (see
|
| + // base::PlatformFileFlags for details).
|
| + virtual void OpenFile(
|
| + const FileSystemURL& url,
|
| + int flags,
|
| + base::ProcessHandle peer_handle,
|
| + const FileSystemOperationInterface::OpenFileCallback& callback) = 0;
|
| +
|
| + // Notifies that a file opened by OpenFile (at |path|) is closed.
|
| + virtual void NotifyCloseFile(const FileSystemURL& url) = 0;
|
| +
|
| + protected:
|
| + friend class base::RefCountedThreadSafe<MediaFileSystemProxyInterface>;
|
| + virtual ~MediaFileSystemProxyInterface() {}
|
| +};
|
| +
|
| +} // namespace fileapi
|
| +
|
| +#endif // WEBKIT_FILEAPI_MEDIA_FILE_SYSTEM_PROXY_H_
|
|
|