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(adoptRefWillBeRefCountedGarbageCol
lected(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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 return m_loader->arrayBufferResult(); | 397 return m_loader->arrayBufferResult(); |
398 } | 398 } |
399 | 399 |
400 String FileReader::stringResult() | 400 String FileReader::stringResult() |
401 { | 401 { |
402 if (!m_loader || m_error) | 402 if (!m_loader || m_error) |
403 return String(); | 403 return String(); |
404 return m_loader->stringResult(); | 404 return m_loader->stringResult(); |
405 } | 405 } |
406 | 406 |
| 407 void FileReader::trace(Visitor* visitor) |
| 408 { |
| 409 visitor->trace(m_error); |
| 410 } |
| 411 |
407 } // namespace WebCore | 412 } // namespace WebCore |
OLD | NEW |