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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 reader->executePendingRead(); | 125 reader->executePendingRead(); |
126 m_runningReaders.add(reader); | 126 m_runningReaders.add(reader); |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 const size_t m_maxRunningReaders; | 130 const size_t m_maxRunningReaders; |
131 Deque<FileReader*> m_pendingReaders; | 131 Deque<FileReader*> m_pendingReaders; |
132 HashSet<FileReader*> m_runningReaders; | 132 HashSet<FileReader*> m_runningReaders; |
133 }; | 133 }; |
134 | 134 |
135 PassRefPtr<FileReader> FileReader::create(ExecutionContext* context) | 135 PassRefPtrWillBeRawPtr<FileReader> FileReader::create(ExecutionContext* context) |
136 { | 136 { |
137 RefPtr<FileReader> fileReader(adoptRef(new FileReader(context))); | 137 RefPtrWillBeRawPtr<FileReader> fileReader(adoptRefCountedWillBeRefCountedGar
bageCollected(new FileReader(context))); |
138 fileReader->suspendIfNeeded(); | 138 fileReader->suspendIfNeeded(); |
139 return fileReader.release(); | 139 return fileReader.release(); |
140 } | 140 } |
141 | 141 |
142 FileReader::FileReader(ExecutionContext* context) | 142 FileReader::FileReader(ExecutionContext* context) |
143 : ActiveDOMObject(context) | 143 : ActiveDOMObject(context) |
144 , m_state(EMPTY) | 144 , m_state(EMPTY) |
145 , m_loadingState(LoadingStateNone) | 145 , m_loadingState(LoadingStateNone) |
146 , m_readType(FileReaderLoader::ReadAsBinaryString) | 146 , m_readType(FileReaderLoader::ReadAsBinaryString) |
147 , m_lastProgressNotificationTimeMS(0) | 147 , m_lastProgressNotificationTimeMS(0) |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 return m_loader->arrayBufferResult(); | 387 return m_loader->arrayBufferResult(); |
388 } | 388 } |
389 | 389 |
390 String FileReader::stringResult() | 390 String FileReader::stringResult() |
391 { | 391 { |
392 if (!m_loader || m_error) | 392 if (!m_loader || m_error) |
393 return String(); | 393 return String(); |
394 return m_loader->stringResult(); | 394 return m_loader->stringResult(); |
395 } | 395 } |
396 | 396 |
| 397 void FileReader::trace(Visitor* visitor) |
| 398 { |
| 399 visitor->trace(m_blob); |
| 400 visitor->trace(m_error); |
| 401 } |
| 402 |
397 } // namespace WebCore | 403 } // namespace WebCore |
OLD | NEW |