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

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

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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/session_manager_client.cc ('k') | chromeos/settings/cros_settings_provider.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 <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 // |mount_path|. 269 // |mount_path|.
270 void UnmountChildMounts(const std::string& mount_path_in) { 270 void UnmountChildMounts(const std::string& mount_path_in) {
271 std::string mount_path = mount_path_in; 271 std::string mount_path = mount_path_in;
272 // Let's make sure mount path has trailing slash. 272 // Let's make sure mount path has trailing slash.
273 if (mount_path[mount_path.length() - 1] != '/') 273 if (mount_path[mount_path.length() - 1] != '/')
274 mount_path += '/'; 274 mount_path += '/';
275 275
276 for (MountPointMap::iterator it = mount_points_.begin(); 276 for (MountPointMap::iterator it = mount_points_.begin();
277 it != mount_points_.end(); 277 it != mount_points_.end();
278 ++it) { 278 ++it) {
279 if (base::StartsWithASCII(it->second.source_path, mount_path, 279 if (base::StartsWith(it->second.source_path, mount_path,
280 true /*case sensitive*/)) { 280 base::CompareCase::SENSITIVE)) {
281 // TODO(tbarzic): Handle the case where this fails. 281 // TODO(tbarzic): Handle the case where this fails.
282 UnmountPath(it->second.mount_path, 282 UnmountPath(it->second.mount_path,
283 UNMOUNT_OPTIONS_NONE, 283 UNMOUNT_OPTIONS_NONE,
284 UnmountPathCallback()); 284 UnmountPathCallback());
285 } 285 }
286 } 286 }
287 } 287 }
288 288
289 // Callback for UnmountDeviceRecursively. 289 // Callback for UnmountDeviceRecursively.
290 void OnUnmountDeviceRecursively( 290 void OnUnmountDeviceRecursively(
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 } 599 }
600 600
601 // Finds system path prefix from |system_path|. 601 // Finds system path prefix from |system_path|.
602 const std::string& FindSystemPathPrefix(const std::string& system_path) { 602 const std::string& FindSystemPathPrefix(const std::string& system_path) {
603 if (system_path.empty()) 603 if (system_path.empty())
604 return base::EmptyString(); 604 return base::EmptyString();
605 for (SystemPathPrefixSet::const_iterator it = system_path_prefixes_.begin(); 605 for (SystemPathPrefixSet::const_iterator it = system_path_prefixes_.begin();
606 it != system_path_prefixes_.end(); 606 it != system_path_prefixes_.end();
607 ++it) { 607 ++it) {
608 const std::string& prefix = *it; 608 const std::string& prefix = *it;
609 if (base::StartsWithASCII(system_path, prefix, true)) 609 if (base::StartsWith(system_path, prefix, base::CompareCase::SENSITIVE))
610 return prefix; 610 return prefix;
611 } 611 }
612 return base::EmptyString(); 612 return base::EmptyString();
613 } 613 }
614 614
615 // Mount event change observers. 615 // Mount event change observers.
616 base::ObserverList<Observer> observers_; 616 base::ObserverList<Observer> observers_;
617 617
618 CrosDisksClient* cros_disks_client_; 618 CrosDisksClient* cros_disks_client_;
619 619
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 VLOG(1) << "DiskMountManager Shutdown completed"; 752 VLOG(1) << "DiskMountManager Shutdown completed";
753 } 753 }
754 754
755 // static 755 // static
756 DiskMountManager* DiskMountManager::GetInstance() { 756 DiskMountManager* DiskMountManager::GetInstance() {
757 return g_disk_mount_manager; 757 return g_disk_mount_manager;
758 } 758 }
759 759
760 } // namespace disks 760 } // namespace disks
761 } // namespace chromeos 761 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/session_manager_client.cc ('k') | chromeos/settings/cros_settings_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698