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 15 matching lines...) Expand all Loading... |
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 DirectoryReaderSync_h | 31 #ifndef DirectoryReaderSync_h |
32 #define DirectoryReaderSync_h | 32 #define DirectoryReaderSync_h |
33 | 33 |
34 #include "bindings/v8/ScriptWrappable.h" | 34 #include "bindings/v8/ScriptWrappable.h" |
35 #include "core/fileapi/FileError.h" | 35 #include "core/fileapi/FileError.h" |
| 36 #include "heap/Handle.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/Vector.h" | 40 #include "wtf/Vector.h" |
40 #include "wtf/text/WTFString.h" | 41 #include "wtf/text/WTFString.h" |
41 | 42 |
42 namespace WebCore { | 43 namespace WebCore { |
43 | 44 |
44 class EntrySync; | 45 class EntrySync; |
45 class ExceptionState; | 46 class ExceptionState; |
46 | 47 |
47 typedef Vector<RefPtr<EntrySync> > EntrySyncVector; | 48 typedef WillBeHeapVector<RefPtrWillBeMember<EntrySync> > EntrySyncHeapVector; |
48 | 49 |
49 class DirectoryReaderSync : public DirectoryReaderBase, public ScriptWrappable { | 50 class DirectoryReaderSync : public DirectoryReaderBase, public ScriptWrappable { |
50 public: | 51 public: |
51 static PassRefPtr<DirectoryReaderSync> create(PassRefPtr<DOMFileSystemBase>
fileSystem, const String& fullPath) | 52 static PassRefPtrWillBeRawPtr<DirectoryReaderSync> create(PassRefPtrWillBeRa
wPtr<DOMFileSystemBase> fileSystem, const String& fullPath) |
52 { | 53 { |
53 return adoptRef(new DirectoryReaderSync(fileSystem, fullPath)); | 54 return adoptRefWillBeNoop(new DirectoryReaderSync(fileSystem, fullPath))
; |
54 } | 55 } |
55 | 56 |
56 virtual ~DirectoryReaderSync(); | 57 virtual ~DirectoryReaderSync(); |
57 | 58 |
58 EntrySyncVector readEntries(ExceptionState&); | 59 EntrySyncHeapVector readEntries(ExceptionState&); |
59 | 60 |
60 void addEntries(const EntrySyncVector& entries) | 61 void addEntries(const EntrySyncHeapVector& entries) |
61 { | 62 { |
62 m_entries.appendVector(entries); | 63 m_entries.appendVector(entries); |
63 } | 64 } |
64 | 65 |
65 void setError(FileError::ErrorCode code) | 66 void setError(FileError::ErrorCode code) |
66 { | 67 { |
67 m_errorCode = code; | 68 m_errorCode = code; |
68 } | 69 } |
69 | 70 |
| 71 virtual void trace(Visitor*) OVERRIDE; |
| 72 |
70 private: | 73 private: |
71 class EntriesCallbackHelper; | 74 class EntriesCallbackHelper; |
72 class ErrorCallbackHelper; | 75 class ErrorCallbackHelper; |
73 | 76 |
74 DirectoryReaderSync(PassRefPtr<DOMFileSystemBase>, const String& fullPath); | 77 DirectoryReaderSync(PassRefPtrWillBeRawPtr<DOMFileSystemBase>, const String&
fullPath); |
75 | 78 |
76 int m_callbacksId; | 79 int m_callbacksId; |
77 EntrySyncVector m_entries; | 80 EntrySyncHeapVector m_entries; |
78 FileError::ErrorCode m_errorCode; | 81 FileError::ErrorCode m_errorCode; |
79 }; | 82 }; |
80 | 83 |
81 } // namespace | 84 } // namespace |
82 | 85 |
83 #endif // DirectoryReaderSync_h | 86 #endif // DirectoryReaderSync_h |
OLD | NEW |