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 21 matching lines...) Expand all Loading... |
32 #define FileReader_h | 32 #define FileReader_h |
33 | 33 |
34 #include "core/dom/ActiveDOMObject.h" | 34 #include "core/dom/ActiveDOMObject.h" |
35 #include "core/events/EventTarget.h" | 35 #include "core/events/EventTarget.h" |
36 #include "core/fileapi/FileError.h" | 36 #include "core/fileapi/FileError.h" |
37 #include "core/fileapi/FileReaderLoader.h" | 37 #include "core/fileapi/FileReaderLoader.h" |
38 #include "core/fileapi/FileReaderLoaderClient.h" | 38 #include "core/fileapi/FileReaderLoaderClient.h" |
39 #include "platform/heap/Handle.h" | 39 #include "platform/heap/Handle.h" |
40 #include "wtf/Forward.h" | 40 #include "wtf/Forward.h" |
41 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
42 #include "wtf/ThreadSpecific.h" | |
43 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
44 | 43 |
45 namespace WebCore { | 44 namespace WebCore { |
46 | 45 |
47 class Blob; | 46 class Blob; |
48 class ExceptionState; | 47 class ExceptionState; |
49 class ExecutionContext; | 48 class ExecutionContext; |
50 | 49 |
51 class FileReader FINAL : public RefCountedWillBeGarbageCollectedFinalized<FileRe
ader>, public ActiveDOMObject, public FileReaderLoaderClient, public EventTarget
WithInlineData { | 50 class FileReader FINAL : public RefCountedWillBeGarbageCollectedFinalized<FileRe
ader>, public ActiveDOMObject, public FileReaderLoaderClient, public EventTarget
WithInlineData { |
52 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCounted<FileReader>); | 51 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCounted<FileReader>); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 private: | 102 private: |
104 class ThrottlingController; | 103 class ThrottlingController; |
105 | 104 |
106 FileReader(ExecutionContext*); | 105 FileReader(ExecutionContext*); |
107 | 106 |
108 void terminate(); | 107 void terminate(); |
109 void readInternal(Blob*, FileReaderLoader::ReadType, ExceptionState&); | 108 void readInternal(Blob*, FileReaderLoader::ReadType, ExceptionState&); |
110 void fireErrorEvent(int httpStatusCode); | 109 void fireErrorEvent(int httpStatusCode); |
111 void fireEvent(const AtomicString& type); | 110 void fireEvent(const AtomicString& type); |
112 | 111 |
113 static ThreadSpecific<ThrottlingController>& throttlingController(); | 112 ThrottlingController* throttlingController(); |
114 void executePendingRead(); | 113 void executePendingRead(); |
115 | 114 |
116 ReadyState m_state; | 115 ReadyState m_state; |
117 | 116 |
118 // Internal loading state, which could differ from ReadyState as it's | 117 // Internal loading state, which could differ from ReadyState as it's |
119 // for script-visible state while this one's for internal state. | 118 // for script-visible state while this one's for internal state. |
120 enum LoadingState { | 119 enum LoadingState { |
121 LoadingStateNone, | 120 LoadingStateNone, |
122 LoadingStatePending, | 121 LoadingStatePending, |
123 LoadingStateLoading, | 122 LoadingStateLoading, |
124 LoadingStateAborted | 123 LoadingStateAborted |
125 }; | 124 }; |
126 LoadingState m_loadingState; | 125 LoadingState m_loadingState; |
127 | 126 |
128 String m_blobType; | 127 String m_blobType; |
129 RefPtr<BlobDataHandle> m_blobDataHandle; | 128 RefPtr<BlobDataHandle> m_blobDataHandle; |
130 FileReaderLoader::ReadType m_readType; | 129 FileReaderLoader::ReadType m_readType; |
131 String m_encoding; | 130 String m_encoding; |
132 | 131 |
133 OwnPtr<FileReaderLoader> m_loader; | 132 OwnPtr<FileReaderLoader> m_loader; |
134 RefPtrWillBeMember<FileError> m_error; | 133 RefPtrWillBeMember<FileError> m_error; |
135 double m_lastProgressNotificationTimeMS; | 134 double m_lastProgressNotificationTimeMS; |
136 }; | 135 }; |
137 | 136 |
138 } // namespace WebCore | 137 } // namespace WebCore |
139 | 138 |
140 #endif // FileReader_h | 139 #endif // FileReader_h |
OLD | NEW |