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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/callback_tracker_internal.cc

Issue 608133002: [SyncFS] Use nullptr for scoped_ptr initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nullptr
Patch Set: Created 6 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 2014 The Chromium Authors. All rights reserved. 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 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/drive_backend/callback_tracker_interna l.h" 5 #include "chrome/browser/sync_file_system/drive_backend/callback_tracker_interna l.h"
6 6
7 #include "chrome/browser/sync_file_system/drive_backend/callback_tracker.h" 7 #include "chrome/browser/sync_file_system/drive_backend/callback_tracker.h"
8 8
9 namespace sync_file_system { 9 namespace sync_file_system {
10 namespace drive_backend { 10 namespace drive_backend {
11 namespace internal { 11 namespace internal {
12 12
13 AbortHelper::AbortHelper(CallbackTracker* tracker) 13 AbortHelper::AbortHelper(CallbackTracker* tracker)
14 : tracker_(tracker), weak_ptr_factory_(this) { 14 : tracker_(tracker), weak_ptr_factory_(this) {
15 } 15 }
16 16
17 AbortHelper::~AbortHelper() {} 17 AbortHelper::~AbortHelper() {}
18 18
19 base::WeakPtr<AbortHelper> AbortHelper::AsWeakPtr() { 19 base::WeakPtr<AbortHelper> AbortHelper::AsWeakPtr() {
20 return weak_ptr_factory_.GetWeakPtr(); 20 return weak_ptr_factory_.GetWeakPtr();
21 } 21 }
22 22
23 // static 23 // static
24 scoped_ptr<AbortHelper> AbortHelper::TakeOwnership( 24 scoped_ptr<AbortHelper> AbortHelper::TakeOwnership(
25 const base::WeakPtr<AbortHelper>& abort_helper) { 25 const base::WeakPtr<AbortHelper>& abort_helper) {
26 if (!abort_helper) 26 if (!abort_helper)
27 return scoped_ptr<AbortHelper>(); 27 return nullptr;
28 scoped_ptr<AbortHelper> result = 28 scoped_ptr<AbortHelper> result =
29 abort_helper->tracker_->PassAbortHelper(abort_helper.get()); 29 abort_helper->tracker_->PassAbortHelper(abort_helper.get());
30 abort_helper->weak_ptr_factory_.InvalidateWeakPtrs(); 30 abort_helper->weak_ptr_factory_.InvalidateWeakPtrs();
31 return result.Pass(); 31 return result.Pass();
32 } 32 }
33 33
34 } // namespace internal 34 } // namespace internal
35 } // namespace drive_backend 35 } // namespace drive_backend
36 } // namespace sync_file_system 36 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698