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

Unified Diff: chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service.cc

Issue 2496973002: arc: Partially migrate mojo types (Closed)
Patch Set: Use references instead of copying std::vector Created 4 years, 1 month 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
Index: chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service.cc
diff --git a/chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service.cc b/chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service.cc
index 21d5f69720639e416502ab9fb20ec7fb770507e2..e3e98befa97280f1833945f49a6b9702a501a2e5 100644
--- a/chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service.cc
+++ b/chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service.cc
@@ -10,9 +10,7 @@
#include <iterator>
#include <map>
#include <memory>
-#include <string>
#include <utility>
-#include <vector>
#include "base/callback.h"
#include "base/files/file_enumerator.h"
@@ -186,7 +184,7 @@ bool HasAndroidSupportedMediaExtension(const base::FilePath& path) {
// Downloads directory.
class ArcDownloadsWatcherService::DownloadsWatcher {
public:
- using Callback = base::Callback<void(mojo::Array<mojo::String> paths)>;
+ using Callback = base::Callback<void(const std::vector<std::string>& paths)>;
explicit DownloadsWatcher(const Callback& callback);
~DownloadsWatcher();
@@ -296,7 +294,7 @@ void ArcDownloadsWatcherService::DownloadsWatcher::OnBuildTimestampMap(
last_timestamp_map_ = std::move(current_timestamp_map);
- mojo::Array<mojo::String> mojo_paths(changed_paths.size());
+ std::vector<std::string> mojo_paths(changed_paths.size());
Yusuke Sato 2016/11/11 22:12:08 nit: s/mojo_// or s/mojo_/string_/ ?
Luis Héctor Chávez 2016/11/11 22:19:21 Chose the latter.
for (size_t i = 0; i < changed_paths.size(); ++i) {
mojo_paths[i] = changed_paths[i].value();
}
@@ -359,14 +357,14 @@ void ArcDownloadsWatcherService::StopWatchingDownloads() {
}
void ArcDownloadsWatcherService::OnDownloadsChanged(
- mojo::Array<mojo::String> paths) {
+ const std::vector<std::string>& paths) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto* instance = arc_bridge_service()->file_system()->GetInstanceForMethod(
"RequestMediaScan");
if (!instance)
return;
- instance->RequestMediaScan(std::move(paths));
+ instance->RequestMediaScan(paths);
}
} // namespace arc
« no previous file with comments | « chrome/browser/chromeos/arc/downloads_watcher/arc_downloads_watcher_service.h ('k') | components/arc/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698