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 FileReaderSync_h | 31 #ifndef FileReaderSync_h |
32 #define FileReaderSync_h | 32 #define FileReaderSync_h |
33 | 33 |
34 #include "bindings/v8/ScriptWrappable.h" | 34 #include "bindings/v8/ScriptWrappable.h" |
| 35 #include "heap/Handle.h" |
35 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
36 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
37 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
38 | 39 |
39 namespace WebCore { | 40 namespace WebCore { |
40 | 41 |
41 class Blob; | 42 class Blob; |
42 class ExceptionState; | 43 class ExceptionState; |
43 class FileReaderLoader; | 44 class FileReaderLoader; |
44 class ExecutionContext; | 45 class ExecutionContext; |
45 | 46 |
46 class FileReaderSync FINAL : public RefCounted<FileReaderSync>, public ScriptWra
ppable { | 47 class FileReaderSync FINAL : public RefCountedWillBeGarbageCollectedFinalized<Fi
leReaderSync>, public ScriptWrappable { |
| 48 DECLARE_GC_INFO; |
47 public: | 49 public: |
48 static PassRefPtr<FileReaderSync> create() | 50 static PassRefPtrWillBeRawPtr<FileReaderSync> create() |
49 { | 51 { |
50 return adoptRef(new FileReaderSync()); | 52 return adoptRefWillBeNoop(new FileReaderSync()); |
51 } | 53 } |
52 | 54 |
53 ~FileReaderSync() { } | 55 ~FileReaderSync() { } |
54 | 56 |
55 PassRefPtr<ArrayBuffer> readAsArrayBuffer(ExecutionContext*, Blob*, Exceptio
nState&); | 57 PassRefPtr<ArrayBuffer> readAsArrayBuffer(ExecutionContext*, Blob*, Exceptio
nState&); |
56 String readAsBinaryString(ExecutionContext*, Blob*, ExceptionState&); | 58 String readAsBinaryString(ExecutionContext*, Blob*, ExceptionState&); |
57 String readAsText(ExecutionContext* executionContext, Blob* blob, ExceptionS
tate& ec) | 59 String readAsText(ExecutionContext* executionContext, Blob* blob, ExceptionS
tate& ec) |
58 { | 60 { |
59 return readAsText(executionContext, blob, "", ec); | 61 return readAsText(executionContext, blob, "", ec); |
60 } | 62 } |
61 String readAsText(ExecutionContext*, Blob*, const String& encoding, Exceptio
nState&); | 63 String readAsText(ExecutionContext*, Blob*, const String& encoding, Exceptio
nState&); |
62 String readAsDataURL(ExecutionContext*, Blob*, ExceptionState&); | 64 String readAsDataURL(ExecutionContext*, Blob*, ExceptionState&); |
63 | 65 |
| 66 void trace(Visitor*) { } |
| 67 |
64 private: | 68 private: |
65 FileReaderSync(); | 69 FileReaderSync(); |
66 | 70 |
67 void startLoading(ExecutionContext*, FileReaderLoader&, const Blob&, Excepti
onState&); | 71 void startLoading(ExecutionContext*, FileReaderLoader&, const Blob&, Excepti
onState&); |
68 }; | 72 }; |
69 | 73 |
70 } // namespace WebCore | 74 } // namespace WebCore |
71 | 75 |
72 #endif // FileReaderSync_h | 76 #endif // FileReaderSync_h |
OLD | NEW |