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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 reader->executePendingRead(); | 117 reader->executePendingRead(); |
118 m_runningReaders.add(reader); | 118 m_runningReaders.add(reader); |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 const size_t m_maxRunningReaders; | 122 const size_t m_maxRunningReaders; |
123 Deque<FileReader*> m_pendingReaders; | 123 Deque<FileReader*> m_pendingReaders; |
124 HashSet<FileReader*> m_runningReaders; | 124 HashSet<FileReader*> m_runningReaders; |
125 }; | 125 }; |
126 | 126 |
127 PassRefPtr<FileReader> FileReader::create(ExecutionContext* context) | 127 DEFINE_GC_INFO(FileReader); |
| 128 |
| 129 PassRefPtrWillBeRawPtr<FileReader> FileReader::create(ExecutionContext* context) |
128 { | 130 { |
129 RefPtr<FileReader> fileReader(adoptRef(new FileReader(context))); | 131 RefPtrWillBeRawPtr<FileReader> fileReader(adoptRefCountedWillBeRefCountedGar
bageCollected(new FileReader(context))); |
130 fileReader->suspendIfNeeded(); | 132 fileReader->suspendIfNeeded(); |
131 return fileReader.release(); | 133 return fileReader.release(); |
132 } | 134 } |
133 | 135 |
134 FileReader::FileReader(ExecutionContext* context) | 136 FileReader::FileReader(ExecutionContext* context) |
135 : ActiveDOMObject(context) | 137 : ActiveDOMObject(context) |
136 , m_state(EMPTY) | 138 , m_state(EMPTY) |
137 , m_loadingState(LoadingStateNone) | 139 , m_loadingState(LoadingStateNone) |
138 , m_readType(FileReaderLoader::ReadAsBinaryString) | 140 , m_readType(FileReaderLoader::ReadAsBinaryString) |
139 , m_lastProgressNotificationTimeMS(0) | 141 , m_lastProgressNotificationTimeMS(0) |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 return m_loader->arrayBufferResult(); | 371 return m_loader->arrayBufferResult(); |
370 } | 372 } |
371 | 373 |
372 String FileReader::stringResult() | 374 String FileReader::stringResult() |
373 { | 375 { |
374 if (!m_loader || m_error) | 376 if (!m_loader || m_error) |
375 return String(); | 377 return String(); |
376 return m_loader->stringResult(); | 378 return m_loader->stringResult(); |
377 } | 379 } |
378 | 380 |
| 381 void FileReader::trace(Visitor* visitor) |
| 382 { |
| 383 visitor->trace(m_blob); |
| 384 visitor->trace(m_error); |
| 385 } |
| 386 |
379 } // namespace WebCore | 387 } // namespace WebCore |
OLD | NEW |