#ifndef WebDOMFileSystem_h
#define WebDOMFileSystem_h
#include "../platform/WebCommon.h"
#include "../platform/WebFileSystem.h"
#include "../platform/WebPrivatePtr.h"
#include "../platform/WebString.h"
#include "../platform/WebURL.h"
#include "WebFrame.h"
#if BLINK_IMPLEMENTATION
#include "heap/Handle.h"
#endif
namespace v8 {
class Value;
template <class T> class Handle;
}
namespace WebCore { class DOMFileSystem; }
namespace blink {
class WebDOMFileSystem {
public:
enum SerializableType {
SerializableTypeSerializable,
SerializableTypeNotSerializable,
};
enum EntryType {
EntryTypeFile,
EntryTypeDirectory,
};
~WebDOMFileSystem() { reset(); }
WebDOMFileSystem() { }
WebDOMFileSystem(const WebDOMFileSystem& d) { assign(d); }
WebDOMFileSystem& operator=(const WebDOMFileSystem& d)
{
assign(d);
return *this;
}
BLINK_EXPORT static WebDOMFileSystem fromV8Value(v8::Handle<v8::Value>);
BLINK_EXPORT static WebDOMFileSystem create(
WebLocalFrame*,
WebFileSystemType,
const WebString& name,
const WebURL& rootURL,
SerializableType = SerializableTypeNotSerializable);
BLINK_EXPORT void reset();
BLINK_EXPORT void assign(const WebDOMFileSystem&);
BLINK_EXPORT WebString name() const;
BLINK_EXPORT WebFileSystem::Type type() const;
BLINK_EXPORT WebURL rootURL() const;
BLINK_EXPORT v8::Handle<v8::Value> toV8Value();
BLINK_EXPORT v8::Handle<v8::Value> createV8Entry(
const WebString& path,
EntryType);
bool isNull() const { return m_private.isNull(); }
#if BLINK_IMPLEMENTATION
WebDOMFileSystem(const PassRefPtrWillBeRawPtr<WebCore::DOMFileSystem>&);
WebDOMFileSystem& operator=(const PassRefPtrWillBeRawPtr<WebCore::DOMFileSystem>&);
#endif
private:
WebPrivatePtr<WebCore::DOMFileSystem> m_private;
};
}
#endif