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

Side by Side Diff: base/memory/ref_counted.h

Issue 1997153002: libchrome: Several upstreamable fixes from libchrome Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Also fix unit tests Created 4 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef BASE_MEMORY_REF_COUNTED_H_ 5 #ifndef BASE_MEMORY_REF_COUNTED_H_
6 #define BASE_MEMORY_REF_COUNTED_H_ 6 #define BASE_MEMORY_REF_COUNTED_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <cassert> 10 #include <cassert>
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 bool operator==(const scoped_refptr<T>& lhs, const U* rhs) { 418 bool operator==(const scoped_refptr<T>& lhs, const U* rhs) {
419 return lhs.get() == rhs; 419 return lhs.get() == rhs;
420 } 420 }
421 421
422 template <typename T, typename U> 422 template <typename T, typename U>
423 bool operator==(const T* lhs, const scoped_refptr<U>& rhs) { 423 bool operator==(const T* lhs, const scoped_refptr<U>& rhs) {
424 return lhs == rhs.get(); 424 return lhs == rhs.get();
425 } 425 }
426 426
427 template <typename T> 427 template <typename T>
428 bool operator==(const scoped_refptr<T>& lhs, std::nullptr_t null) { 428 bool operator==(const scoped_refptr<T>& lhs, std::nullptr_t /* null */) {
danakj 2016/05/23 02:59:54 delete the name
Luis Héctor Chávez 2016/05/24 15:27:53 Done.
429 return !static_cast<bool>(lhs); 429 return !static_cast<bool>(lhs);
430 } 430 }
431 431
432 template <typename T> 432 template <typename T>
433 bool operator==(std::nullptr_t null, const scoped_refptr<T>& rhs) { 433 bool operator==(std::nullptr_t /* null */, const scoped_refptr<T>& rhs) {
danakj 2016/05/23 02:59:54 delete
Luis Héctor Chávez 2016/05/24 15:27:53 Done.
434 return !static_cast<bool>(rhs); 434 return !static_cast<bool>(rhs);
435 } 435 }
436 436
437 template <typename T, typename U> 437 template <typename T, typename U>
438 bool operator!=(const scoped_refptr<T>& lhs, const U* rhs) { 438 bool operator!=(const scoped_refptr<T>& lhs, const U* rhs) {
439 return !operator==(lhs, rhs); 439 return !operator==(lhs, rhs);
440 } 440 }
441 441
442 template <typename T, typename U> 442 template <typename T, typename U>
443 bool operator!=(const T* lhs, const scoped_refptr<U>& rhs) { 443 bool operator!=(const T* lhs, const scoped_refptr<U>& rhs) {
444 return !operator==(lhs, rhs); 444 return !operator==(lhs, rhs);
445 } 445 }
446 446
447 template <typename T> 447 template <typename T>
448 bool operator!=(const scoped_refptr<T>& lhs, std::nullptr_t null) { 448 bool operator!=(const scoped_refptr<T>& lhs, std::nullptr_t null) {
449 return !operator==(lhs, null); 449 return !operator==(lhs, null);
450 } 450 }
451 451
452 template <typename T> 452 template <typename T>
453 bool operator!=(std::nullptr_t null, const scoped_refptr<T>& rhs) { 453 bool operator!=(std::nullptr_t null, const scoped_refptr<T>& rhs) {
454 return !operator==(null, rhs); 454 return !operator==(null, rhs);
455 } 455 }
456 456
457 template <typename T> 457 template <typename T>
458 std::ostream& operator<<(std::ostream& out, const scoped_refptr<T>& p) { 458 std::ostream& operator<<(std::ostream& out, const scoped_refptr<T>& p) {
459 return out << p.get(); 459 return out << p.get();
460 } 460 }
461 461
462 #endif // BASE_MEMORY_REF_COUNTED_H_ 462 #endif // BASE_MEMORY_REF_COUNTED_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698