| 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 { |
| 47 public: | 48 public: |
| 48 static PassRefPtr<FileReaderSync> create() | 49 static PassRefPtrWillBeRawPtr<FileReaderSync> create() |
| 49 { | 50 { |
| 50 return adoptRef(new FileReaderSync()); | 51 return adoptRefWillBeNoop(new FileReaderSync()); |
| 51 } | 52 } |
| 52 | 53 |
| 53 ~FileReaderSync() { } | 54 ~FileReaderSync() { } |
| 54 | 55 |
| 55 PassRefPtr<ArrayBuffer> readAsArrayBuffer(ExecutionContext*, Blob*, Exceptio
nState&); | 56 PassRefPtr<ArrayBuffer> readAsArrayBuffer(ExecutionContext*, Blob*, Exceptio
nState&); |
| 56 String readAsBinaryString(ExecutionContext*, Blob*, ExceptionState&); | 57 String readAsBinaryString(ExecutionContext*, Blob*, ExceptionState&); |
| 57 String readAsText(ExecutionContext* executionContext, Blob* blob, ExceptionS
tate& ec) | 58 String readAsText(ExecutionContext* executionContext, Blob* blob, ExceptionS
tate& ec) |
| 58 { | 59 { |
| 59 return readAsText(executionContext, blob, "", ec); | 60 return readAsText(executionContext, blob, "", ec); |
| 60 } | 61 } |
| 61 String readAsText(ExecutionContext*, Blob*, const String& encoding, Exceptio
nState&); | 62 String readAsText(ExecutionContext*, Blob*, const String& encoding, Exceptio
nState&); |
| 62 String readAsDataURL(ExecutionContext*, Blob*, ExceptionState&); | 63 String readAsDataURL(ExecutionContext*, Blob*, ExceptionState&); |
| 63 | 64 |
| 65 void trace(Visitor*) { } |
| 66 |
| 64 private: | 67 private: |
| 65 FileReaderSync(); | 68 FileReaderSync(); |
| 66 | 69 |
| 67 void startLoading(ExecutionContext*, FileReaderLoader&, const Blob&, Excepti
onState&); | 70 void startLoading(ExecutionContext*, FileReaderLoader&, const Blob&, Excepti
onState&); |
| 68 }; | 71 }; |
| 69 | 72 |
| 70 } // namespace WebCore | 73 } // namespace WebCore |
| 71 | 74 |
| 72 #endif // FileReaderSync_h | 75 #endif // FileReaderSync_h |
| OLD | NEW |