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

Side by Side Diff: base/bind_helpers.h

Issue 2103883002: Remove an unused Unwrap overload and HasNonConstReferenceItem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 const T& Unwrap(const ConstRefWrapper<T>& const_ref) { 434 const T& Unwrap(const ConstRefWrapper<T>& const_ref) {
435 return const_ref.get(); 435 return const_ref.get();
436 } 436 }
437 437
438 template <typename T> 438 template <typename T>
439 T* Unwrap(const RetainedRefWrapper<T>& o) { 439 T* Unwrap(const RetainedRefWrapper<T>& o) {
440 return o.get(); 440 return o.get();
441 } 441 }
442 442
443 template <typename T> 443 template <typename T>
444 const WeakPtr<T>& Unwrap(const WeakPtr<T>& o) {
445 return o;
446 }
447
448 template <typename T>
449 T* Unwrap(const OwnedWrapper<T>& o) { 444 T* Unwrap(const OwnedWrapper<T>& o) {
450 return o.get(); 445 return o.get();
451 } 446 }
452 447
453 template <typename T> 448 template <typename T>
454 T Unwrap(const PassedWrapper<T>& o) { 449 T Unwrap(const PassedWrapper<T>& o) {
455 return o.Take(); 450 return o.Take();
456 } 451 }
457 452
458 // IsWeakMethod is a helper that determine if we are binding a WeakPtr<> to a 453 // IsWeakMethod is a helper that determine if we are binding a WeakPtr<> to a
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 643
649 template <typename T> 644 template <typename T>
650 struct IsWeakReceiver<internal::ConstRefWrapper<T>> : IsWeakReceiver<T> {}; 645 struct IsWeakReceiver<internal::ConstRefWrapper<T>> : IsWeakReceiver<T> {};
651 646
652 template <typename T> 647 template <typename T>
653 struct IsWeakReceiver<WeakPtr<T>> : std::true_type {}; 648 struct IsWeakReceiver<WeakPtr<T>> : std::true_type {};
654 649
655 } // namespace base 650 } // namespace base
656 651
657 #endif // BASE_BIND_HELPERS_H_ 652 #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