| 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 27 matching lines...) Expand all Loading... |
| 38 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 class Blob; | 42 class Blob; |
| 43 class ExceptionState; | 43 class ExceptionState; |
| 44 class FileReaderLoader; | 44 class FileReaderLoader; |
| 45 class ExecutionContext; | 45 class ExecutionContext; |
| 46 | 46 |
| 47 class FileReaderSync FINAL : public RefCountedWillBeGarbageCollected<FileReaderS
ync>, public ScriptWrappable { | 47 class FileReaderSync FINAL : public RefCountedWillBeGarbageCollected<FileReaderS
ync>, public ScriptWrappable { |
| 48 DEFINE_WRAPPERTYPEINFO(); |
| 48 public: | 49 public: |
| 49 static PassRefPtrWillBeRawPtr<FileReaderSync> create() | 50 static PassRefPtrWillBeRawPtr<FileReaderSync> create() |
| 50 { | 51 { |
| 51 return adoptRefWillBeNoop(new FileReaderSync()); | 52 return adoptRefWillBeNoop(new FileReaderSync()); |
| 52 } | 53 } |
| 53 | 54 |
| 54 PassRefPtr<ArrayBuffer> readAsArrayBuffer(ExecutionContext*, Blob*, Exceptio
nState&); | 55 PassRefPtr<ArrayBuffer> readAsArrayBuffer(ExecutionContext*, Blob*, Exceptio
nState&); |
| 55 String readAsBinaryString(ExecutionContext*, Blob*, ExceptionState&); | 56 String readAsBinaryString(ExecutionContext*, Blob*, ExceptionState&); |
| 56 String readAsText(ExecutionContext* executionContext, Blob* blob, ExceptionS
tate& ec) | 57 String readAsText(ExecutionContext* executionContext, Blob* blob, ExceptionS
tate& ec) |
| 57 { | 58 { |
| 58 return readAsText(executionContext, blob, "", ec); | 59 return readAsText(executionContext, blob, "", ec); |
| 59 } | 60 } |
| 60 String readAsText(ExecutionContext*, Blob*, const String& encoding, Exceptio
nState&); | 61 String readAsText(ExecutionContext*, Blob*, const String& encoding, Exceptio
nState&); |
| 61 String readAsDataURL(ExecutionContext*, Blob*, ExceptionState&); | 62 String readAsDataURL(ExecutionContext*, Blob*, ExceptionState&); |
| 62 | 63 |
| 63 void trace(Visitor*) { } | 64 void trace(Visitor*) { } |
| 64 | 65 |
| 65 private: | 66 private: |
| 66 FileReaderSync(); | 67 FileReaderSync(); |
| 67 | 68 |
| 68 void startLoading(ExecutionContext*, FileReaderLoader&, const Blob&, Excepti
onState&); | 69 void startLoading(ExecutionContext*, FileReaderLoader&, const Blob&, Excepti
onState&); |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 } // namespace blink | 72 } // namespace blink |
| 72 | 73 |
| 73 #endif // FileReaderSync_h | 74 #endif // FileReaderSync_h |
| OLD | NEW |