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