| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 m_runningReaders.insert(reader); | 137 m_runningReaders.insert(reader); |
| 138 return; | 138 return; |
| 139 } | 139 } |
| 140 m_pendingReaders.append(reader); | 140 m_pendingReaders.append(reader); |
| 141 executeReaders(); | 141 executeReaders(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 FinishReaderType removeReader(FileReader* reader) { | 144 FinishReaderType removeReader(FileReader* reader) { |
| 145 FileReaderHashSet::const_iterator hashIter = m_runningReaders.find(reader); | 145 FileReaderHashSet::const_iterator hashIter = m_runningReaders.find(reader); |
| 146 if (hashIter != m_runningReaders.end()) { | 146 if (hashIter != m_runningReaders.end()) { |
| 147 m_runningReaders.remove(hashIter); | 147 m_runningReaders.erase(hashIter); |
| 148 return RunPendingReaders; | 148 return RunPendingReaders; |
| 149 } | 149 } |
| 150 FileReaderDeque::const_iterator dequeEnd = m_pendingReaders.end(); | 150 FileReaderDeque::const_iterator dequeEnd = m_pendingReaders.end(); |
| 151 for (FileReaderDeque::const_iterator it = m_pendingReaders.begin(); | 151 for (FileReaderDeque::const_iterator it = m_pendingReaders.begin(); |
| 152 it != dequeEnd; ++it) { | 152 it != dequeEnd; ++it) { |
| 153 if (*it == reader) { | 153 if (*it == reader) { |
| 154 m_pendingReaders.remove(it); | 154 m_pendingReaders.remove(it); |
| 155 break; | 155 break; |
| 156 } | 156 } |
| 157 } | 157 } |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 ProgressEvent::create(type, false, m_loader->bytesLoaded(), 0)); | 467 ProgressEvent::create(type, false, m_loader->bytesLoaded(), 0)); |
| 468 } | 468 } |
| 469 | 469 |
| 470 DEFINE_TRACE(FileReader) { | 470 DEFINE_TRACE(FileReader) { |
| 471 visitor->trace(m_error); | 471 visitor->trace(m_error); |
| 472 EventTargetWithInlineData::trace(visitor); | 472 EventTargetWithInlineData::trace(visitor); |
| 473 ContextLifecycleObserver::trace(visitor); | 473 ContextLifecycleObserver::trace(visitor); |
| 474 } | 474 } |
| 475 | 475 |
| 476 } // namespace blink | 476 } // namespace blink |
| OLD | NEW |