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_internal.h"
7 #include "chrome/browser/sync_file_system/drive_backend/callback_tracker.h"
9 namespace sync_file_system
{
10 namespace drive_backend
{
13 AbortHelper::AbortHelper(CallbackTracker
* tracker
)
14 : tracker_(tracker
), weak_ptr_factory_(this) {
17 AbortHelper::~AbortHelper() {}
19 base::WeakPtr
<AbortHelper
> AbortHelper::AsWeakPtr() {
20 return weak_ptr_factory_
.GetWeakPtr();
24 scoped_ptr
<AbortHelper
> AbortHelper::TakeOwnership(
25 const base::WeakPtr
<AbortHelper
>& abort_helper
) {
28 scoped_ptr
<AbortHelper
> result
=
29 abort_helper
->tracker_
->PassAbortHelper(abort_helper
.get());
30 abort_helper
->weak_ptr_factory_
.InvalidateWeakPtrs();
34 } // namespace internal
35 } // namespace drive_backend
36 } // namespace sync_file_system