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

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

Issue 2496973002: arc: Partially migrate mojo types (Closed)
Patch Set: Fixed nit 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..ea12672b39f40ff8159b651790085e0237f2789a 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,13 +294,13 @@ 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> string_paths(changed_paths.size());
for (size_t i = 0; i < changed_paths.size(); ++i) {
- mojo_paths[i] = changed_paths[i].value();
+ string_paths[i] = changed_paths[i].value();
}
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(callback_, base::Passed(std::move(mojo_paths))));
+ base::Bind(callback_, base::Passed(std::move(string_paths))));
if (last_notify_time_ > snapshot_time) {
base::PostTaskAndReplyWithResult(
BrowserThread::GetBlockingPool(), FROM_HERE,
@@ -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