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

Unified Diff: chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/webrtc_log_uploader_unittest.cc ('k') | chrome/browser/metrics/thread_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc
diff --git a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc
index ba914a3488be6f339ef468e127071deb1050399f..01f9a6e05905c8c3e7369efe7feb783b5417cbbf 100644
--- a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc
+++ b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc
@@ -1832,8 +1832,8 @@ base::FilePath MTPDeviceDelegateImplLinux::NextUncachedPathComponent(
std::string device_relpath = GetDeviceRelativePath(device_path_, path);
if (!device_relpath.empty() && device_relpath != kRootPath) {
uncached_path = device_path_;
- std::vector<std::string> device_relpath_components;
- base::SplitString(device_relpath, '/', &device_relpath_components);
+ std::vector<std::string> device_relpath_components = base::SplitString(
+ device_relpath, "/", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
DCHECK(!device_relpath_components.empty());
bool all_components_cached = true;
const MTPFileNode* current_node = root_node_.get();
@@ -1879,8 +1879,10 @@ bool MTPDeviceDelegateImplLinux::CachedPathToId(const base::FilePath& path,
if (device_relpath.empty())
return false;
std::vector<std::string> device_relpath_components;
- if (device_relpath != kRootPath)
- base::SplitString(device_relpath, '/', &device_relpath_components);
+ if (device_relpath != kRootPath) {
+ device_relpath_components = base::SplitString(
+ device_relpath, "/", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ }
const MTPFileNode* current_node = root_node_.get();
for (size_t i = 0; i < device_relpath_components.size(); ++i) {
current_node = current_node->GetChild(device_relpath_components[i]);
« no previous file with comments | « chrome/browser/media/webrtc_log_uploader_unittest.cc ('k') | chrome/browser/metrics/thread_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698