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

Side by Side Diff: chromeos/disks/disk_mount_manager.cc

Issue 2413963002: Replace FOR_EACH_OBSERVER in chromeos/ with range-based for (Closed)
Patch Set: Run the script again with '/mg' 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 unified diff | Download patch
« no previous file with comments | « chromeos/dbus/update_engine_client.cc ('k') | chromeos/disks/mock_disk_mount_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/disks/disk_mount_manager.h" 5 #include "chromeos/disks/disk_mount_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 } 601 }
602 default: { 602 default: {
603 LOG(ERROR) << "Unknown event: " << event; 603 LOG(ERROR) << "Unknown event: " << event;
604 } 604 }
605 } 605 }
606 } 606 }
607 607
608 // Notifies all observers about disk status update. 608 // Notifies all observers about disk status update.
609 void NotifyDiskStatusUpdate(DiskEvent event, 609 void NotifyDiskStatusUpdate(DiskEvent event,
610 const Disk* disk) { 610 const Disk* disk) {
611 FOR_EACH_OBSERVER(Observer, observers_, OnDiskEvent(event, disk)); 611 for (auto& observer : observers_)
612 observer.OnDiskEvent(event, disk);
612 } 613 }
613 614
614 // Notifies all observers about device status update. 615 // Notifies all observers about device status update.
615 void NotifyDeviceStatusUpdate(DeviceEvent event, 616 void NotifyDeviceStatusUpdate(DeviceEvent event,
616 const std::string& device_path) { 617 const std::string& device_path) {
617 FOR_EACH_OBSERVER(Observer, observers_, OnDeviceEvent(event, device_path)); 618 for (auto& observer : observers_)
619 observer.OnDeviceEvent(event, device_path);
618 } 620 }
619 621
620 // Notifies all observers about mount completion. 622 // Notifies all observers about mount completion.
621 void NotifyMountStatusUpdate(MountEvent event, 623 void NotifyMountStatusUpdate(MountEvent event,
622 MountError error_code, 624 MountError error_code,
623 const MountPointInfo& mount_info) { 625 const MountPointInfo& mount_info) {
624 FOR_EACH_OBSERVER(Observer, observers_, 626 for (auto& observer : observers_)
625 OnMountEvent(event, error_code, mount_info)); 627 observer.OnMountEvent(event, error_code, mount_info);
626 } 628 }
627 629
628 void NotifyFormatStatusUpdate(FormatEvent event, 630 void NotifyFormatStatusUpdate(FormatEvent event,
629 FormatError error_code, 631 FormatError error_code,
630 const std::string& device_path) { 632 const std::string& device_path) {
631 FOR_EACH_OBSERVER(Observer, observers_, 633 for (auto& observer : observers_)
632 OnFormatEvent(event, error_code, device_path)); 634 observer.OnFormatEvent(event, error_code, device_path);
633 } 635 }
634 636
635 // Finds system path prefix from |system_path|. 637 // Finds system path prefix from |system_path|.
636 const std::string& FindSystemPathPrefix(const std::string& system_path) { 638 const std::string& FindSystemPathPrefix(const std::string& system_path) {
637 if (system_path.empty()) 639 if (system_path.empty())
638 return base::EmptyString(); 640 return base::EmptyString();
639 for (SystemPathPrefixSet::const_iterator it = system_path_prefixes_.begin(); 641 for (SystemPathPrefixSet::const_iterator it = system_path_prefixes_.begin();
640 it != system_path_prefixes_.end(); 642 it != system_path_prefixes_.end();
641 ++it) { 643 ++it) {
642 const std::string& prefix = *it; 644 const std::string& prefix = *it;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 VLOG(1) << "DiskMountManager Shutdown completed"; 794 VLOG(1) << "DiskMountManager Shutdown completed";
793 } 795 }
794 796
795 // static 797 // static
796 DiskMountManager* DiskMountManager::GetInstance() { 798 DiskMountManager* DiskMountManager::GetInstance() {
797 return g_disk_mount_manager; 799 return g_disk_mount_manager;
798 } 800 }
799 801
800 } // namespace disks 802 } // namespace disks
801 } // namespace chromeos 803 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/update_engine_client.cc ('k') | chromeos/disks/mock_disk_mount_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698