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

Side by Side Diff: chrome/browser/sync_file_system/local/local_file_sync_context.cc

Issue 2425553002: Remove FOR_EACH_OBSERVER macro usage in chrome/browser/sync_file_system (Closed)
Patch Set: Created 4 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/sync_file_system/local/local_file_sync_context.h" 5 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 base::Bind(&LocalFileSyncContext::NotifyAvailableChanges, 598 base::Bind(&LocalFileSyncContext::NotifyAvailableChanges,
599 this, origins_with_pending_changes_, 599 this, origins_with_pending_changes_,
600 completion_callbacks)); 600 completion_callbacks));
601 last_notified_changes_ = base::Time::Now(); 601 last_notified_changes_ = base::Time::Now();
602 origins_with_pending_changes_.clear(); 602 origins_with_pending_changes_.clear();
603 } 603 }
604 604
605 void LocalFileSyncContext::NotifyAvailableChanges( 605 void LocalFileSyncContext::NotifyAvailableChanges(
606 const std::set<GURL>& origins, 606 const std::set<GURL>& origins,
607 const std::vector<base::Closure>& callbacks) { 607 const std::vector<base::Closure>& callbacks) {
608 FOR_EACH_OBSERVER(LocalOriginChangeObserver, origin_change_observers_, 608 for (auto& observer : origin_change_observers_)
609 OnChangesAvailableInOrigins(origins)); 609 observer.OnChangesAvailableInOrigins(origins);
610 for (const auto& callback : callbacks) 610 for (const auto& callback : callbacks)
611 callback.Run(); 611 callback.Run();
612 } 612 }
613 613
614 void LocalFileSyncContext::ShutdownOnIOThread() { 614 void LocalFileSyncContext::ShutdownOnIOThread() {
615 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); 615 DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
616 shutdown_on_io_ = true; 616 shutdown_on_io_ = true;
617 operation_runner_.reset(); 617 operation_runner_.reset();
618 root_delete_helper_.reset(); 618 root_delete_helper_.reset();
619 sync_status_.reset(); 619 sync_status_.reset();
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 return; 1047 return;
1048 } 1048 }
1049 1049
1050 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( 1050 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync(
1051 file_system_context, dest_url); 1051 file_system_context, dest_url);
1052 file_system_context->operation_runner()->CopyInForeignFile( 1052 file_system_context->operation_runner()->CopyInForeignFile(
1053 local_path, url_for_sync, callback); 1053 local_path, url_for_sync, callback);
1054 } 1054 }
1055 1055
1056 } // namespace sync_file_system 1056 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698