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

Side by Side Diff: chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service.cc

Issue 2721553004: Remove auto raw pointer deduction from non-linux specific code. (Closed)
Patch Set: rebase Created 3 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_se rvice.h" 5 #include "chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_se rvice.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } // namespace 167 } // namespace
168 168
169 bool HasAndroidSupportedMediaExtension(const base::FilePath& path) { 169 bool HasAndroidSupportedMediaExtension(const base::FilePath& path) {
170 const std::string extension = base::ToLowerASCII(path.Extension()); 170 const std::string extension = base::ToLowerASCII(path.Extension());
171 const auto less_comparator = [](const char* a, const char* b) { 171 const auto less_comparator = [](const char* a, const char* b) {
172 return strcmp(a, b) < 0; 172 return strcmp(a, b) < 0;
173 }; 173 };
174 DCHECK(std::is_sorted(std::begin(kAndroidSupportedMediaExtensions), 174 DCHECK(std::is_sorted(std::begin(kAndroidSupportedMediaExtensions),
175 std::end(kAndroidSupportedMediaExtensions), 175 std::end(kAndroidSupportedMediaExtensions),
176 less_comparator)); 176 less_comparator));
177 auto iter = std::lower_bound(std::begin(kAndroidSupportedMediaExtensions), 177 auto** iter = std::lower_bound(std::begin(kAndroidSupportedMediaExtensions),
178 std::end(kAndroidSupportedMediaExtensions), 178 std::end(kAndroidSupportedMediaExtensions),
179 extension.c_str(), less_comparator); 179 extension.c_str(), less_comparator);
180 return iter != std::end(kAndroidSupportedMediaExtensions) && 180 return iter != std::end(kAndroidSupportedMediaExtensions) &&
181 strcmp(*iter, extension.c_str()) == 0; 181 strcmp(*iter, extension.c_str()) == 0;
182 } 182 }
183 183
184 // The core part of ArcDownloadsWatcherService to watch for file changes in 184 // The core part of ArcDownloadsWatcherService to watch for file changes in
185 // Downloads directory. 185 // Downloads directory.
186 class ArcDownloadsWatcherService::DownloadsWatcher { 186 class ArcDownloadsWatcherService::DownloadsWatcher {
187 public: 187 public:
188 using Callback = base::Callback<void(const std::vector<std::string>& paths)>; 188 using Callback = base::Callback<void(const std::vector<std::string>& paths)>;
189 189
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 DCHECK_CURRENTLY_ON(BrowserThread::UI); 357 DCHECK_CURRENTLY_ON(BrowserThread::UI);
358 358
359 auto* instance = ARC_GET_INSTANCE_FOR_METHOD( 359 auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
360 arc_bridge_service()->file_system(), RequestMediaScan); 360 arc_bridge_service()->file_system(), RequestMediaScan);
361 if (!instance) 361 if (!instance)
362 return; 362 return;
363 instance->RequestMediaScan(paths); 363 instance->RequestMediaScan(paths);
364 } 364 }
365 365
366 } // namespace arc 366 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698