| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 : public FileWriterBase | 53 : public FileWriterBase |
| 54 , public EventTargetWithInlineData | 54 , public EventTargetWithInlineData |
| 55 #endif | 55 #endif |
| 56 , public ActiveDOMObject | 56 , public ActiveDOMObject |
| 57 , public WebFileWriterClient { | 57 , public WebFileWriterClient { |
| 58 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(FileWriterBase); | 58 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(FileWriterBase); |
| 59 DEFINE_WRAPPERTYPEINFO(); | 59 DEFINE_WRAPPERTYPEINFO(); |
| 60 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FileWriter); | 60 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FileWriter); |
| 61 public: | 61 public: |
| 62 static FileWriter* create(ExecutionContext*); | 62 static FileWriter* create(ExecutionContext*); |
| 63 virtual ~FileWriter(); | 63 ~FileWriter() override; |
| 64 | 64 |
| 65 enum ReadyState { | 65 enum ReadyState { |
| 66 INIT = 0, | 66 INIT = 0, |
| 67 WRITING = 1, | 67 WRITING = 1, |
| 68 DONE = 2 | 68 DONE = 2 |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 void write(Blob*, ExceptionState&); | 71 void write(Blob*, ExceptionState&); |
| 72 void seek(long long position, ExceptionState&); | 72 void seek(long long position, ExceptionState&); |
| 73 void truncate(long long length, ExceptionState&); | 73 void truncate(long long length, ExceptionState&); |
| 74 void abort(ExceptionState&); | 74 void abort(ExceptionState&); |
| 75 ReadyState readyState() const { return m_readyState; } | 75 ReadyState readyState() const { return m_readyState; } |
| 76 FileError* error() const { return m_error.get(); } | 76 FileError* error() const { return m_error.get(); } |
| 77 | 77 |
| 78 // WebFileWriterClient | 78 // WebFileWriterClient |
| 79 virtual void didWrite(long long bytes, bool complete) override; | 79 void didWrite(long long bytes, bool complete) override; |
| 80 virtual void didTruncate() override; | 80 void didTruncate() override; |
| 81 virtual void didFail(WebFileError) override; | 81 void didFail(WebFileError) override; |
| 82 | 82 |
| 83 // ActiveDOMObject | 83 // ActiveDOMObject |
| 84 virtual void stop() override; | 84 void stop() override; |
| 85 virtual bool hasPendingActivity() const override; | 85 bool hasPendingActivity() const override; |
| 86 | 86 |
| 87 // EventTarget | 87 // EventTarget |
| 88 virtual const AtomicString& interfaceName() const override; | 88 const AtomicString& interfaceName() const override; |
| 89 virtual ExecutionContext* executionContext() const override { return ActiveD
OMObject::executionContext(); } | 89 ExecutionContext* executionContext() const override { return ActiveDOMObject
::executionContext(); } |
| 90 | 90 |
| 91 DEFINE_ATTRIBUTE_EVENT_LISTENER(writestart); | 91 DEFINE_ATTRIBUTE_EVENT_LISTENER(writestart); |
| 92 DEFINE_ATTRIBUTE_EVENT_LISTENER(progress); | 92 DEFINE_ATTRIBUTE_EVENT_LISTENER(progress); |
| 93 DEFINE_ATTRIBUTE_EVENT_LISTENER(write); | 93 DEFINE_ATTRIBUTE_EVENT_LISTENER(write); |
| 94 DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); | 94 DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); |
| 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(writeend); | 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(writeend); |
| 97 | 97 |
| 98 DECLARE_VIRTUAL_TRACE(); | 98 DECLARE_VIRTUAL_TRACE(); |
| 99 | 99 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 127 long long m_numAborts; | 127 long long m_numAborts; |
| 128 long long m_recursionDepth; | 128 long long m_recursionDepth; |
| 129 double m_lastProgressNotificationTimeMS; | 129 double m_lastProgressNotificationTimeMS; |
| 130 Member<Blob> m_blobBeingWritten; | 130 Member<Blob> m_blobBeingWritten; |
| 131 int m_asyncOperationId; | 131 int m_asyncOperationId; |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 } // namespace blink | 134 } // namespace blink |
| 135 | 135 |
| 136 #endif // FileWriter_h | 136 #endif // FileWriter_h |
| OLD | NEW |