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

Side by Side Diff: base/bind_helpers.h

Issue 1816713002: base: Remove scoped_refptr unwrapping for Bind arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | base/bind_internal.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This defines a set of argument wrappers and related factory methods that 5 // This defines a set of argument wrappers and related factory methods that
6 // can be used specify the refcounting and reference semantics of arguments 6 // can be used specify the refcounting and reference semantics of arguments
7 // that are bound by the Bind() function in base/bind.h. 7 // that are bound by the Bind() function in base/bind.h.
8 // 8 //
9 // It also defines a set of simple functions and utilities that people want 9 // It also defines a set of simple functions and utilities that people want
10 // when using Callback<> and Bind(). 10 // when using Callback<> and Bind().
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 T* Unwrap(UnretainedWrapper<T> unretained) { 424 T* Unwrap(UnretainedWrapper<T> unretained) {
425 return unretained.get(); 425 return unretained.get();
426 } 426 }
427 427
428 template <typename T> 428 template <typename T>
429 const T& Unwrap(ConstRefWrapper<T> const_ref) { 429 const T& Unwrap(ConstRefWrapper<T> const_ref) {
430 return const_ref.get(); 430 return const_ref.get();
431 } 431 }
432 432
433 template <typename T> 433 template <typename T>
434 T* Unwrap(const scoped_refptr<T>& o) {
435 return o.get();
436 }
437
438 template <typename T>
439 T* Unwrap(const RetainedRefWrapper<T>& o) { 434 T* Unwrap(const RetainedRefWrapper<T>& o) {
440 return o.get(); 435 return o.get();
441 } 436 }
442 437
443 template <typename T> 438 template <typename T>
444 const WeakPtr<T>& Unwrap(const WeakPtr<T>& o) { 439 const WeakPtr<T>& Unwrap(const WeakPtr<T>& o) {
445 return o; 440 return o;
446 } 441 }
447 442
448 template <typename T> 443 template <typename T>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 BASE_EXPORT void DoNothing(); 622 BASE_EXPORT void DoNothing();
628 623
629 template<typename T> 624 template<typename T>
630 void DeletePointer(T* obj) { 625 void DeletePointer(T* obj) {
631 delete obj; 626 delete obj;
632 } 627 }
633 628
634 } // namespace base 629 } // namespace base
635 630
636 #endif // BASE_BIND_HELPERS_H_ 631 #endif // BASE_BIND_HELPERS_H_
OLDNEW
« no previous file with comments | « no previous file | base/bind_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698