This source file includes following definitions.
- create
- getMetadata
- moveTo
- copyTo
- remove
- getParent
- trace
#include "config.h"
#include "modules/filesystem/EntrySync.h"
#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
#include "modules/filesystem/DOMFilePath.h"
#include "modules/filesystem/DirectoryEntry.h"
#include "modules/filesystem/DirectoryEntrySync.h"
#include "modules/filesystem/FileEntrySync.h"
#include "modules/filesystem/Metadata.h"
#include "modules/filesystem/SyncCallbackHelper.h"
namespace WebCore {
PassRefPtrWillBeRawPtr<EntrySync> EntrySync::create(EntryBase* entry)
{
if (entry->isFile())
return FileEntrySync::create(entry->m_fileSystem, entry->m_fullPath);
return DirectoryEntrySync::create(entry->m_fileSystem, entry->m_fullPath);
}
PassRefPtrWillBeRawPtr<Metadata> EntrySync::getMetadata(ExceptionState& exceptionState)
{
RefPtr<MetadataSyncCallbackHelper> helper = MetadataSyncCallbackHelper::create();
m_fileSystem->getMetadata(this, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous);
return helper->getResult(exceptionState);
}
PassRefPtrWillBeRawPtr<EntrySync> EntrySync::moveTo(PassRefPtrWillBeRawPtr<DirectoryEntrySync> parent, const String& name, ExceptionState& exceptionState) const
{
RefPtr<EntrySyncCallbackHelper> helper = EntrySyncCallbackHelper::create();
m_fileSystem->move(this, parent.get(), name, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous);
return helper->getResult(exceptionState);
}
PassRefPtrWillBeRawPtr<EntrySync> EntrySync::copyTo(PassRefPtrWillBeRawPtr<DirectoryEntrySync> parent, const String& name, ExceptionState& exceptionState) const
{
RefPtr<EntrySyncCallbackHelper> helper = EntrySyncCallbackHelper::create();
m_fileSystem->copy(this, parent.get(), name, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous);
return helper->getResult(exceptionState);
}
void EntrySync::remove(ExceptionState& exceptionState) const
{
RefPtr<VoidSyncCallbackHelper> helper = VoidSyncCallbackHelper::create();
m_fileSystem->remove(this, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous);
helper->getResult(exceptionState);
}
PassRefPtrWillBeRawPtr<EntrySync> EntrySync::getParent() const
{
String parentPath = DOMFilePath::getDirectory(fullPath());
return DirectoryEntrySync::create(m_fileSystem, parentPath);
}
EntrySync::EntrySync(PassRefPtrWillBeRawPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: EntryBase(fileSystem, fullPath)
{
ScriptWrappable::init(this);
}
void EntrySync::trace(Visitor* visitor)
{
EntryBase::trace(visitor);
}
}