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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/callback_helper.h

Issue 506793002: Remove implicit conversions from scoped_refptr to T* in chrome/browser/sync_file_system/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/callback_helper_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // This file was GENERATED by command: 1 // This file was GENERATED by command:
2 // pump.py callback_helper.h.pump 2 // pump.py callback_helper.h.pump
3 // DO NOT EDIT BY HAND!!! 3 // DO NOT EDIT BY HAND!!!
4 4
5 5
6 // Copyright 2014 The Chromium Authors. All rights reserved. 6 // Copyright 2014 The Chromium Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style license that can be 7 // Use of this source code is governed by a BSD-style license that can be
8 // found in the LICENSE file. 8 // found in the LICENSE file.
9 9
10 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_HELPER_H_ 10 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_HELPER_H_
(...skipping 30 matching lines...) Expand all
41 41
42 template <typename T> 42 template <typename T>
43 class CallbackHolder { 43 class CallbackHolder {
44 public: 44 public:
45 CallbackHolder(base::SequencedTaskRunner* task_runner, 45 CallbackHolder(base::SequencedTaskRunner* task_runner,
46 const tracked_objects::Location& from_here, 46 const tracked_objects::Location& from_here,
47 const base::Callback<T>& callback) 47 const base::Callback<T>& callback)
48 : task_runner_(task_runner), 48 : task_runner_(task_runner),
49 from_here_(from_here), 49 from_here_(from_here),
50 callback_(new base::Callback<T>(callback)) { 50 callback_(new base::Callback<T>(callback)) {
51 DCHECK(task_runner_); 51 DCHECK(task_runner_.get());
52 } 52 }
53 53
54 ~CallbackHolder() { 54 ~CallbackHolder() {
55 base::Callback<T>* callback = callback_.release(); 55 base::Callback<T>* callback = callback_.release();
56 if (!task_runner_->DeleteSoon(from_here_, callback)) 56 if (!task_runner_->DeleteSoon(from_here_, callback))
57 delete callback; 57 delete callback;
58 } 58 }
59 59
60 base::SequencedTaskRunner* task_runner() const { return task_runner_; } 60 base::SequencedTaskRunner* task_runner() const { return task_runner_.get(); }
61 const tracked_objects::Location& from_here() const { return from_here_; } 61 const tracked_objects::Location& from_here() const { return from_here_; }
62 const base::Callback<T>& callback() const { return *callback_; } 62 const base::Callback<T>& callback() const { return *callback_; }
63 63
64 private: 64 private:
65 scoped_refptr<base::SequencedTaskRunner> task_runner_; 65 scoped_refptr<base::SequencedTaskRunner> task_runner_;
66 const tracked_objects::Location from_here_; 66 const tracked_objects::Location from_here_;
67 scoped_ptr<base::Callback<T> > callback_; 67 scoped_ptr<base::Callback<T> > callback_;
68 68
69 DISALLOW_COPY_AND_ASSIGN(CallbackHolder); 69 DISALLOW_COPY_AND_ASSIGN(CallbackHolder);
70 }; 70 };
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 const base::Callback<T>& callback) { 175 const base::Callback<T>& callback) {
176 return RelayCallbackToTaskRunner( 176 return RelayCallbackToTaskRunner(
177 base::ThreadTaskRunnerHandle::Get(), 177 base::ThreadTaskRunnerHandle::Get(),
178 from_here, callback); 178 from_here, callback);
179 } 179 }
180 180
181 } // namespace drive_backend 181 } // namespace drive_backend
182 } // namespace sync_file_system 182 } // namespace sync_file_system
183 183
184 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_HELPER_H_ 184 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CALLBACK_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/callback_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698