DOMFileSystemBase.h [plain text]
#ifndef DOMFileSystemBase_h
#define DOMFileSystemBase_h
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystem.h"
#include "WebKitFlags.h"
#include "PlatformString.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
class DirectoryEntry;
class DirectoryReaderBase;
class EntriesCallback;
class EntryBase;
class EntryCallback;
class ErrorCallback;
class KURL;
class MetadataCallback;
class ScriptExecutionContext;
class SecurityOrigin;
class VoidCallback;
class DOMFileSystemBase : public RefCounted<DOMFileSystemBase> {
public:
static PassRefPtr<DOMFileSystemBase> create(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
{
return adoptRef(new DOMFileSystemBase(context, name, asyncFileSystem));
}
virtual ~DOMFileSystemBase();
static const char kPersistentPathPrefix[];
static const size_t kPersistentPathPrefixLength;
static const char kTemporaryPathPrefix[];
static const size_t kTemporaryPathPrefixLength;
static const char kExternalPathPrefix[];
static const size_t kExternalPathPrefixLength;
static bool crackFileSystemURL(const KURL&, AsyncFileSystem::Type&, String& filePath);
const String& name() const { return m_name; }
AsyncFileSystem* asyncFileSystem() const { return m_asyncFileSystem.get(); }
SecurityOrigin* securityOrigin() const;
bool getMetadata(const EntryBase*, PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
bool move(const EntryBase* source, EntryBase* parent, const String& name, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool copy(const EntryBase* source, EntryBase* parent, const String& name, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool remove(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
bool removeRecursively(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
bool getParent(const EntryBase*, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool getFile(const EntryBase*, const String& path, PassRefPtr<WebKitFlags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool getDirectory(const EntryBase*, const String& path, PassRefPtr<WebKitFlags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
protected:
DOMFileSystemBase(ScriptExecutionContext*, const String& name, PassOwnPtr<AsyncFileSystem>);
friend class DOMFileSystemSync;
ScriptExecutionContext* m_context;
String m_name;
mutable OwnPtr<AsyncFileSystem> m_asyncFileSystem;
};
}
#endif // ENABLE(FILE_SYSTEM)
#endif // DOMFileSystemBase_h