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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class ExceptionState; | 42 class ExceptionState; |
43 class ExecutionContext; | 43 class ExecutionContext; |
44 class FileReaderLoader; | 44 class FileReaderLoader; |
45 class ScriptState; | 45 class ScriptState; |
46 | 46 |
47 class FileReaderSync final : public GarbageCollected<FileReaderSync>, | 47 class FileReaderSync final : public GarbageCollected<FileReaderSync>, |
48 public ScriptWrappable { | 48 public ScriptWrappable { |
49 DEFINE_WRAPPERTYPEINFO(); | 49 DEFINE_WRAPPERTYPEINFO(); |
50 | 50 |
51 public: | 51 public: |
52 static FileReaderSync* create() { return new FileReaderSync(); } | 52 static FileReaderSync* create(ExecutionContext* context) { |
| 53 return new FileReaderSync(context); |
| 54 } |
53 | 55 |
54 DOMArrayBuffer* readAsArrayBuffer(ScriptState*, Blob*, ExceptionState&); | 56 DOMArrayBuffer* readAsArrayBuffer(ScriptState*, Blob*, ExceptionState&); |
55 String readAsBinaryString(ScriptState*, Blob*, ExceptionState&); | 57 String readAsBinaryString(ScriptState*, Blob*, ExceptionState&); |
56 String readAsText(ScriptState* scriptState, Blob* blob, ExceptionState& ec) { | 58 String readAsText(ScriptState* scriptState, Blob* blob, ExceptionState& ec) { |
57 return readAsText(scriptState, blob, "", ec); | 59 return readAsText(scriptState, blob, "", ec); |
58 } | 60 } |
59 String readAsText(ScriptState*, | 61 String readAsText(ScriptState*, |
60 Blob*, | 62 Blob*, |
61 const String& encoding, | 63 const String& encoding, |
62 ExceptionState&); | 64 ExceptionState&); |
63 String readAsDataURL(ScriptState*, Blob*, ExceptionState&); | 65 String readAsDataURL(ScriptState*, Blob*, ExceptionState&); |
64 | 66 |
65 DEFINE_INLINE_TRACE() {} | 67 DEFINE_INLINE_TRACE() {} |
66 | 68 |
67 private: | 69 private: |
68 FileReaderSync(); | 70 explicit FileReaderSync(ExecutionContext*); |
69 | 71 |
70 void startLoading(ExecutionContext*, | 72 void startLoading(ExecutionContext*, |
71 FileReaderLoader&, | 73 FileReaderLoader&, |
72 const Blob&, | 74 const Blob&, |
73 ExceptionState&); | 75 ExceptionState&); |
74 }; | 76 }; |
75 | 77 |
76 } // namespace blink | 78 } // namespace blink |
77 | 79 |
78 #endif // FileReaderSync_h | 80 #endif // FileReaderSync_h |
OLD | NEW |