| OLD | NEW |
| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 kBuildTimestampMapDelay); | 271 kBuildTimestampMapDelay); |
| 272 } else { | 272 } else { |
| 273 last_notify_time_ = base::TimeTicks::Now(); | 273 last_notify_time_ = base::TimeTicks::Now(); |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 | 276 |
| 277 void ArcDownloadsWatcherService::DownloadsWatcher::DelayBuildTimestampMap() { | 277 void ArcDownloadsWatcherService::DownloadsWatcher::DelayBuildTimestampMap() { |
| 278 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 278 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 279 DCHECK(outstanding_task_); | 279 DCHECK(outstanding_task_); |
| 280 base::PostTaskWithTraitsAndReplyWithResult( | 280 base::PostTaskWithTraitsAndReplyWithResult( |
| 281 FROM_HERE, base::TaskTraits().MayBlock(), | 281 FROM_HERE, {base::MayBlock()}, |
| 282 base::Bind(&BuildTimestampMapCallback, downloads_dir_), | 282 base::Bind(&BuildTimestampMapCallback, downloads_dir_), |
| 283 base::Bind(&DownloadsWatcher::OnBuildTimestampMap, | 283 base::Bind(&DownloadsWatcher::OnBuildTimestampMap, |
| 284 weak_ptr_factory_.GetWeakPtr())); | 284 weak_ptr_factory_.GetWeakPtr())); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void ArcDownloadsWatcherService::DownloadsWatcher::OnBuildTimestampMap( | 287 void ArcDownloadsWatcherService::DownloadsWatcher::OnBuildTimestampMap( |
| 288 std::pair<base::TimeTicks, TimestampMap> timestamp_and_map) { | 288 std::pair<base::TimeTicks, TimestampMap> timestamp_and_map) { |
| 289 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 289 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 290 DCHECK(outstanding_task_); | 290 DCHECK(outstanding_task_); |
| 291 base::TimeTicks snapshot_time = timestamp_and_map.first; | 291 base::TimeTicks snapshot_time = timestamp_and_map.first; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |