| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef DirectoryReader_h | 31 #ifndef DirectoryReader_h |
| 32 #define DirectoryReader_h | 32 #define DirectoryReader_h |
| 33 | 33 |
| 34 #include "bindings/v8/ScriptWrappable.h" | 34 #include "bindings/v8/ScriptWrappable.h" |
| 35 #include "heap/Handle.h" |
| 35 #include "modules/filesystem/DOMFileSystem.h" | 36 #include "modules/filesystem/DOMFileSystem.h" |
| 36 #include "modules/filesystem/DirectoryReaderBase.h" | 37 #include "modules/filesystem/DirectoryReaderBase.h" |
| 37 #include "wtf/PassRefPtr.h" | 38 #include "wtf/PassRefPtr.h" |
| 38 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
| 39 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 40 | 41 |
| 41 namespace WebCore { | 42 namespace WebCore { |
| 42 | 43 |
| 43 class EntriesCallback; | 44 class EntriesCallback; |
| 44 class EntriesCallbacks; | 45 class EntriesCallbacks; |
| 45 class ErrorCallback; | 46 class ErrorCallback; |
| 46 | 47 |
| 47 class DirectoryReader : public DirectoryReaderBase, public ScriptWrappable { | 48 class DirectoryReader : public DirectoryReaderBase, public ScriptWrappable { |
| 48 public: | 49 public: |
| 49 static PassRefPtr<DirectoryReader> create(PassRefPtr<DOMFileSystemBase> file
System, const String& fullPath) | 50 static PassRefPtrWillBeRawPtr<DirectoryReader> create(PassRefPtrWillBeRawPtr
<DOMFileSystemBase> fileSystem, const String& fullPath) |
| 50 { | 51 { |
| 51 return adoptRef(new DirectoryReader(fileSystem, fullPath)); | 52 return adoptRefWillBeNoop(new DirectoryReader(fileSystem, fullPath)); |
| 52 } | 53 } |
| 53 | 54 |
| 54 virtual ~DirectoryReader(); | 55 virtual ~DirectoryReader(); |
| 55 | 56 |
| 56 void readEntries(PassOwnPtr<EntriesCallback>, PassOwnPtr<ErrorCallback> = nu
llptr); | 57 void readEntries(PassOwnPtr<EntriesCallback>, PassOwnPtr<ErrorCallback> = nu
llptr); |
| 57 | 58 |
| 58 DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fil
eSystem.get()); } | 59 DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fil
eSystem.get()); } |
| 59 | 60 |
| 61 virtual void trace(Visitor*) OVERRIDE; |
| 62 |
| 60 private: | 63 private: |
| 61 class EntriesCallbackHelper; | 64 class EntriesCallbackHelper; |
| 62 class ErrorCallbackHelper; | 65 class ErrorCallbackHelper; |
| 63 | 66 |
| 64 DirectoryReader(PassRefPtr<DOMFileSystemBase>, const String& fullPath); | 67 DirectoryReader(PassRefPtrWillBeRawPtr<DOMFileSystemBase>, const String& ful
lPath); |
| 65 | 68 |
| 66 void addEntries(const Vector<RefPtr<Entry> >& entries); | 69 void addEntries(const WillBeHeapVector<RefPtrWillBeMember<Entry> >& entries)
; |
| 67 | 70 |
| 68 void onError(FileError*); | 71 void onError(FileError*); |
| 69 | 72 |
| 70 bool m_isReading; | 73 bool m_isReading; |
| 71 Vector<RefPtr<Entry> > m_entries; | 74 WillBeHeapVector<RefPtrWillBeMember<Entry> > m_entries; |
| 72 RefPtrWillBePersistent<FileError> m_error; | 75 RefPtrWillBeMember<FileError> m_error; |
| 73 OwnPtr<EntriesCallback> m_entriesCallback; | 76 OwnPtr<EntriesCallback> m_entriesCallback; |
| 74 OwnPtr<ErrorCallback> m_errorCallback; | 77 OwnPtr<ErrorCallback> m_errorCallback; |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 } | 80 } |
| 78 | 81 |
| 79 #endif // DirectoryReader_h | 82 #endif // DirectoryReader_h |
| OLD | NEW |