| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 filesystem()->readDirectory(this, m_fullPath, new EntriesCallbackHelper(
this), new ErrorCallbackHelper(this)); | 100 filesystem()->readDirectory(this, m_fullPath, new EntriesCallbackHelper(
this), new ErrorCallbackHelper(this)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 if (m_error) { | 103 if (m_error) { |
| 104 filesystem()->reportError(ScriptErrorCallback::wrap(errorCallback), m_er
ror); | 104 filesystem()->reportError(ScriptErrorCallback::wrap(errorCallback), m_er
ror); |
| 105 return; | 105 return; |
| 106 } | 106 } |
| 107 | 107 |
| 108 if (m_entriesCallback) { | 108 if (m_entriesCallback) { |
| 109 // Non-null m_entriesCallback means multiple readEntries() calls are mad
e concurrently. We don't allow doing it. | 109 // Non-null m_entriesCallback means multiple readEntries() calls are mad
e concurrently. We don't allow doing it. |
| 110 filesystem()->reportError(ScriptErrorCallback::wrap(errorCallback), File
Error::INVALID_STATE_ERR); | 110 filesystem()->reportError(ScriptErrorCallback::wrap(errorCallback), File
Error::kInvalidStateErr); |
| 111 return; | 111 return; |
| 112 } | 112 } |
| 113 | 113 |
| 114 if (!m_hasMoreEntries || !m_entries.isEmpty()) { | 114 if (!m_hasMoreEntries || !m_entries.isEmpty()) { |
| 115 if (entriesCallback) | 115 if (entriesCallback) |
| 116 DOMFileSystem::scheduleCallback(filesystem()->getExecutionContext(),
createSameThreadTask(&EntriesCallback::handleEvent, wrapPersistent(entriesCallb
ack), PersistentHeapVector<Member<Entry>>(m_entries))); | 116 DOMFileSystem::scheduleCallback(filesystem()->getExecutionContext(),
createSameThreadTask(&EntriesCallback::handleEvent, wrapPersistent(entriesCallb
ack), PersistentHeapVector<Member<Entry>>(m_entries))); |
| 117 m_entries.clear(); | 117 m_entries.clear(); |
| 118 return; | 118 return; |
| 119 } | 119 } |
| 120 | 120 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 144 | 144 |
| 145 DEFINE_TRACE(DirectoryReader) | 145 DEFINE_TRACE(DirectoryReader) |
| 146 { | 146 { |
| 147 visitor->trace(m_entries); | 147 visitor->trace(m_entries); |
| 148 visitor->trace(m_entriesCallback); | 148 visitor->trace(m_entriesCallback); |
| 149 visitor->trace(m_errorCallback); | 149 visitor->trace(m_errorCallback); |
| 150 DirectoryReaderBase::trace(visitor); | 150 DirectoryReaderBase::trace(visitor); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace blink | 153 } // namespace blink |
| OLD | NEW |