Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / sync_file_system / drive_backend / callback_tracker_internal.cc
blob96276a991235347213b9d9ab25243675e8db238a
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 {
11 namespace internal {
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();
23 // static
24 scoped_ptr<AbortHelper> AbortHelper::TakeOwnership(
25 const base::WeakPtr<AbortHelper>& abort_helper) {
26 if (!abort_helper)
27 return nullptr;
28 scoped_ptr<AbortHelper> result =
29 abort_helper->tracker_->PassAbortHelper(abort_helper.get());
30 abort_helper->weak_ptr_factory_.InvalidateWeakPtrs();
31 return result.Pass();
34 } // namespace internal
35 } // namespace drive_backend
36 } // namespace sync_file_system