| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 context), | 212 context), |
| 213 m_successCallback(successCallback), | 213 m_successCallback(successCallback), |
| 214 m_directoryReader(directoryReader), | 214 m_directoryReader(directoryReader), |
| 215 m_basePath(basePath) { | 215 m_basePath(basePath) { |
| 216 ASSERT(m_directoryReader); | 216 ASSERT(m_directoryReader); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void EntriesCallbacks::didReadDirectoryEntry(const String& name, | 219 void EntriesCallbacks::didReadDirectoryEntry(const String& name, |
| 220 bool isDirectory) { | 220 bool isDirectory) { |
| 221 if (isDirectory) | 221 if (isDirectory) |
| 222 m_entries.append( | 222 m_entries.push_back( |
| 223 DirectoryEntry::create(m_directoryReader->filesystem(), | 223 DirectoryEntry::create(m_directoryReader->filesystem(), |
| 224 DOMFilePath::append(m_basePath, name))); | 224 DOMFilePath::append(m_basePath, name))); |
| 225 else | 225 else |
| 226 m_entries.append(FileEntry::create(m_directoryReader->filesystem(), | 226 m_entries.push_back( |
| 227 DOMFilePath::append(m_basePath, name))); | 227 FileEntry::create(m_directoryReader->filesystem(), |
| 228 DOMFilePath::append(m_basePath, name))); |
| 228 } | 229 } |
| 229 | 230 |
| 230 void EntriesCallbacks::didReadDirectoryEntries(bool hasMore) { | 231 void EntriesCallbacks::didReadDirectoryEntries(bool hasMore) { |
| 231 m_directoryReader->setHasMoreEntries(hasMore); | 232 m_directoryReader->setHasMoreEntries(hasMore); |
| 232 EntryHeapVector entries; | 233 EntryHeapVector entries; |
| 233 entries.swap(m_entries); | 234 entries.swap(m_entries); |
| 234 // FIXME: delay the callback iff shouldScheduleCallback() is true. | 235 // FIXME: delay the callback iff shouldScheduleCallback() is true. |
| 235 if (m_successCallback) | 236 if (m_successCallback) |
| 236 m_successCallback->handleEvent(entries); | 237 m_successCallback->handleEvent(entries); |
| 237 } | 238 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 DOMFileSystemBase* fileSystem) | 419 DOMFileSystemBase* fileSystem) |
| 419 : FileSystemCallbacksBase(errorCallback, fileSystem, context), | 420 : FileSystemCallbacksBase(errorCallback, fileSystem, context), |
| 420 m_successCallback(successCallback) {} | 421 m_successCallback(successCallback) {} |
| 421 | 422 |
| 422 void VoidCallbacks::didSucceed() { | 423 void VoidCallbacks::didSucceed() { |
| 423 if (m_successCallback) | 424 if (m_successCallback) |
| 424 handleEventOrScheduleCallback(m_successCallback.release()); | 425 handleEventOrScheduleCallback(m_successCallback.release()); |
| 425 } | 426 } |
| 426 | 427 |
| 427 } // namespace blink | 428 } // namespace blink |
| OLD | NEW |