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

Unified Diff: components/drive/chromeos/file_system.cc

Issue 2421083002: Replace FOR_EACH_OBSERVER in components/drive with range-based for (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/drive/chromeos/directory_loader.cc ('k') | components/drive/drive_app_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/drive/chromeos/file_system.cc
diff --git a/components/drive/chromeos/file_system.cc b/components/drive/chromeos/file_system.cc
index 0ec7d38fb35cf7cd90df29754866a5e13720cbb5..b04a84b1e86c7ea5c93678a0336df3925cbba8dc 100644
--- a/components/drive/chromeos/file_system.cc
+++ b/components/drive/chromeos/file_system.cc
@@ -824,8 +824,8 @@ void FileSystem::SearchByHashes(const std::set<std::string>& hashes,
void FileSystem::OnFileChangedByOperation(const FileChange& changed_files) {
DCHECK(thread_checker_.CalledOnValidThread());
- FOR_EACH_OBSERVER(
- FileSystemObserver, observers_, OnFileChanged(changed_files));
+ for (auto& observer : observers_)
+ observer.OnFileChanged(changed_files);
}
void FileSystem::OnEntryUpdatedByOperation(const ClientContext& context,
@@ -855,9 +855,8 @@ void FileSystem::OnDriveSyncErrorAfterGetFilePath(
FileError error) {
if (error != FILE_ERROR_OK)
return;
- FOR_EACH_OBSERVER(FileSystemObserver,
- observers_,
- OnDriveSyncError(type, *file_path));
+ for (auto& observer : observers_)
+ observer.OnDriveSyncError(type, *file_path);
}
bool FileSystem::WaitForSyncComplete(const std::string& local_id,
@@ -868,15 +867,15 @@ bool FileSystem::WaitForSyncComplete(const std::string& local_id,
void FileSystem::OnDirectoryReloaded(const base::FilePath& directory_path) {
DCHECK(thread_checker_.CalledOnValidThread());
- FOR_EACH_OBSERVER(
- FileSystemObserver, observers_, OnDirectoryChanged(directory_path));
+ for (auto& observer : observers_)
+ observer.OnDirectoryChanged(directory_path);
}
void FileSystem::OnFileChanged(const FileChange& changed_files) {
DCHECK(thread_checker_.CalledOnValidThread());
- FOR_EACH_OBSERVER(
- FileSystemObserver, observers_, OnFileChanged(changed_files));
+ for (auto& observer : observers_)
+ observer.OnFileChanged(changed_files);
}
void FileSystem::OnLoadFromServerComplete() {
« no previous file with comments | « components/drive/chromeos/directory_loader.cc ('k') | components/drive/drive_app_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698