Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: Source/modules/filesystem/FileSystemCallbacks.cpp

Issue 178333009: Handle has_more correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unneeded space Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 { 120 {
121 if (isDirectory) 121 if (isDirectory)
122 m_entries.append(DirectoryEntry::create(m_directoryReader->filesystem(), DOMFilePath::append(m_basePath, name))); 122 m_entries.append(DirectoryEntry::create(m_directoryReader->filesystem(), DOMFilePath::append(m_basePath, name)));
123 else 123 else
124 m_entries.append(FileEntry::create(m_directoryReader->filesystem(), DOMF ilePath::append(m_basePath, name))); 124 m_entries.append(FileEntry::create(m_directoryReader->filesystem(), DOMF ilePath::append(m_basePath, name)));
125 } 125 }
126 126
127 void EntriesCallbacks::didReadDirectoryEntries(bool hasMore) 127 void EntriesCallbacks::didReadDirectoryEntries(bool hasMore)
128 { 128 {
129 m_directoryReader->setHasMoreEntries(hasMore); 129 m_directoryReader->setHasMoreEntries(hasMore);
130 EntryVector entries;
131 entries.swap(m_entries);
130 if (m_successCallback) 132 if (m_successCallback)
131 m_successCallback->handleEvent(m_entries); 133 m_successCallback->handleEvent(entries);
132 } 134 }
133 135
134 // FileSystemCallbacks -------------------------------------------------------- 136 // FileSystemCallbacks --------------------------------------------------------
135 137
136 PassOwnPtr<AsyncFileSystemCallbacks> FileSystemCallbacks::create(PassOwnPtr<File SystemCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, Execut ionContext* executionContext, FileSystemType type) 138 PassOwnPtr<AsyncFileSystemCallbacks> FileSystemCallbacks::create(PassOwnPtr<File SystemCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, Execut ionContext* executionContext, FileSystemType type)
137 { 139 {
138 return adoptPtr(new FileSystemCallbacks(successCallback, errorCallback, exec utionContext, type)); 140 return adoptPtr(new FileSystemCallbacks(successCallback, errorCallback, exec utionContext, type));
139 } 141 }
140 142
141 FileSystemCallbacks::FileSystemCallbacks(PassOwnPtr<FileSystemCallback> successC allback, PassOwnPtr<ErrorCallback> errorCallback, ExecutionContext* context, Fil eSystemType type) 143 FileSystemCallbacks::FileSystemCallbacks(PassOwnPtr<FileSystemCallback> successC allback, PassOwnPtr<ErrorCallback> errorCallback, ExecutionContext* context, Fil eSystemType type)
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 247 }
246 248
247 void VoidCallbacks::didSucceed() 249 void VoidCallbacks::didSucceed()
248 { 250 {
249 if (m_successCallback) 251 if (m_successCallback)
250 m_successCallback->handleEvent(); 252 m_successCallback->handleEvent();
251 m_successCallback.clear(); 253 m_successCallback.clear();
252 } 254 }
253 255
254 } // namespace 256 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698