1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/sync_file_system/drive_backend/callback_tracker.h"
9 namespace sync_file_system
{
10 namespace drive_backend
{
12 CallbackTracker::CallbackTracker() {
15 CallbackTracker::~CallbackTracker() {
19 void CallbackTracker::AbortAll() {
20 AbortClosureByHelper helpers
;
21 std::swap(helpers
, helpers_
);
22 for (AbortClosureByHelper::iterator itr
= helpers
.begin();
23 itr
!= helpers
.end(); ++itr
) {
29 scoped_ptr
<internal::AbortHelper
> CallbackTracker::PassAbortHelper(
30 internal::AbortHelper
* helper
) {
31 if (helpers_
.erase(helper
) == 1)
32 return scoped_ptr
<internal::AbortHelper
>(helper
);
36 } // namespace drive_backend
37 } // namespace sync_file_system