diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.h')
-rw-r--r-- | chromium/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/chromium/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.h b/chromium/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.h index 1ecdf82a4d5..5dd42642952 100644 --- a/chromium/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.h +++ b/chromium/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.h @@ -32,10 +32,9 @@ #define DirectoryReaderSync_h #include "bindings/v8/ScriptWrappable.h" +#include "core/fileapi/FileError.h" #include "modules/filesystem/DirectoryReaderBase.h" -#include "wtf/PassRefPtr.h" -#include "wtf/RefCounted.h" -#include "wtf/Vector.h" +#include "platform/heap/Handle.h" #include "wtf/text/WTFString.h" namespace WebCore { @@ -43,19 +42,40 @@ namespace WebCore { class EntrySync; class ExceptionState; -typedef Vector<RefPtr<EntrySync> > EntrySyncVector; +typedef HeapVector<Member<EntrySync> > EntrySyncHeapVector; class DirectoryReaderSync : public DirectoryReaderBase, public ScriptWrappable { public: - static PassRefPtr<DirectoryReaderSync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath) + static DirectoryReaderSync* create(DOMFileSystemBase* fileSystem, const String& fullPath) { - return adoptRef(new DirectoryReaderSync(fileSystem, fullPath)); + return new DirectoryReaderSync(fileSystem, fullPath); } - EntrySyncVector readEntries(ExceptionState&); + virtual ~DirectoryReaderSync(); + + EntrySyncHeapVector readEntries(ExceptionState&); + + void addEntries(const EntrySyncHeapVector& entries) + { + m_entries.appendVector(entries); + } + + void setError(FileError::ErrorCode code) + { + m_errorCode = code; + } + + virtual void trace(Visitor*) OVERRIDE; private: - DirectoryReaderSync(PassRefPtr<DOMFileSystemBase>, const String& fullPath); + class EntriesCallbackHelper; + class ErrorCallbackHelper; + + DirectoryReaderSync(DOMFileSystemBase*, const String& fullPath); + + int m_callbacksId; + EntrySyncHeapVector m_entries; + FileError::ErrorCode m_errorCode; }; } // namespace |