| 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 29 matching lines...) Expand all Loading... |
| 40 #include "wtf/Forward.h" | 40 #include "wtf/Forward.h" |
| 41 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
| 42 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class Blob; | 46 class Blob; |
| 47 class ExceptionState; | 47 class ExceptionState; |
| 48 class ExecutionContext; | 48 class ExecutionContext; |
| 49 | 49 |
| 50 class FileReader FINAL : public RefCountedGarbageCollectedWillBeGarbageCollected
Finalized<FileReader>, public ActiveDOMObject, public FileReaderLoaderClient, pu
blic EventTargetWithInlineData { | 50 class FileReader final : public RefCountedGarbageCollectedWillBeGarbageCollected
Finalized<FileReader>, public ActiveDOMObject, public FileReaderLoaderClient, pu
blic EventTargetWithInlineData { |
| 51 DEFINE_WRAPPERTYPEINFO(); | 51 DEFINE_WRAPPERTYPEINFO(); |
| 52 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<F
ileReader>); | 52 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<F
ileReader>); |
| 53 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FileReader); | 53 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FileReader); |
| 54 public: | 54 public: |
| 55 static FileReader* create(ExecutionContext*); | 55 static FileReader* create(ExecutionContext*); |
| 56 | 56 |
| 57 virtual ~FileReader(); | 57 virtual ~FileReader(); |
| 58 | 58 |
| 59 enum ReadyState { | 59 enum ReadyState { |
| 60 EMPTY = 0, | 60 EMPTY = 0, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 71 | 71 |
| 72 void doAbort(); | 72 void doAbort(); |
| 73 | 73 |
| 74 ReadyState readyState() const { return m_state; } | 74 ReadyState readyState() const { return m_state; } |
| 75 FileError* error() { return m_error; } | 75 FileError* error() { return m_error; } |
| 76 FileReaderLoader::ReadType readType() const { return m_readType; } | 76 FileReaderLoader::ReadType readType() const { return m_readType; } |
| 77 PassRefPtr<ArrayBuffer> arrayBufferResult() const; | 77 PassRefPtr<ArrayBuffer> arrayBufferResult() const; |
| 78 String stringResult(); | 78 String stringResult(); |
| 79 | 79 |
| 80 // ActiveDOMObject | 80 // ActiveDOMObject |
| 81 virtual void stop() OVERRIDE; | 81 virtual void stop() override; |
| 82 virtual bool hasPendingActivity() const OVERRIDE; | 82 virtual bool hasPendingActivity() const override; |
| 83 | 83 |
| 84 // EventTarget | 84 // EventTarget |
| 85 virtual const AtomicString& interfaceName() const OVERRIDE; | 85 virtual const AtomicString& interfaceName() const override; |
| 86 virtual ExecutionContext* executionContext() const OVERRIDE { return ActiveD
OMObject::executionContext(); } | 86 virtual ExecutionContext* executionContext() const override { return ActiveD
OMObject::executionContext(); } |
| 87 | 87 |
| 88 // FileReaderLoaderClient | 88 // FileReaderLoaderClient |
| 89 virtual void didStartLoading() OVERRIDE; | 89 virtual void didStartLoading() override; |
| 90 virtual void didReceiveData() OVERRIDE; | 90 virtual void didReceiveData() override; |
| 91 virtual void didFinishLoading() OVERRIDE; | 91 virtual void didFinishLoading() override; |
| 92 virtual void didFail(FileError::ErrorCode) OVERRIDE; | 92 virtual void didFail(FileError::ErrorCode) override; |
| 93 | 93 |
| 94 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadstart); | 94 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadstart); |
| 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(progress); | 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(progress); |
| 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(load); | 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(load); |
| 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); | 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); |
| 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 99 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadend); | 99 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadend); |
| 100 | 100 |
| 101 virtual void trace(Visitor*) OVERRIDE; | 101 virtual void trace(Visitor*) override; |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 explicit FileReader(ExecutionContext*); | 104 explicit FileReader(ExecutionContext*); |
| 105 | 105 |
| 106 class ThrottlingController; | 106 class ThrottlingController; |
| 107 | 107 |
| 108 void terminate(); | 108 void terminate(); |
| 109 void readInternal(Blob*, FileReaderLoader::ReadType, ExceptionState&); | 109 void readInternal(Blob*, FileReaderLoader::ReadType, ExceptionState&); |
| 110 void fireEvent(const AtomicString& type); | 110 void fireEvent(const AtomicString& type); |
| 111 | 111 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 130 | 130 |
| 131 OwnPtr<FileReaderLoader> m_loader; | 131 OwnPtr<FileReaderLoader> m_loader; |
| 132 Member<FileError> m_error; | 132 Member<FileError> m_error; |
| 133 double m_lastProgressNotificationTimeMS; | 133 double m_lastProgressNotificationTimeMS; |
| 134 int m_asyncOperationId; | 134 int m_asyncOperationId; |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 } // namespace blink | 137 } // namespace blink |
| 138 | 138 |
| 139 #endif // FileReader_h | 139 #endif // FileReader_h |
| OLD | NEW |