Home | History | Annotate | Download | only in memory

Lines Matching defs:scoped_refptr

24 class scoped_refptr;
29 scoped_refptr<T> AdoptRef(T* t);
105 friend scoped_refptr<U> base::AdoptRef(U*);
152 friend scoped_refptr<U> base::AdoptRef(U*);
220 // If an object has start-from-one ref count, the first scoped_refptr need to be
342 // Creates a scoped_refptr from a raw pointer without incrementing the reference
346 scoped_refptr<T> AdoptRef(T* obj) {
354 return scoped_refptr<T>(obj, subtle::kAdoptRefTag);
360 scoped_refptr<T> AdoptRefIfNeeded(T* obj, StartRefCountFromZeroTag) {
361 return scoped_refptr<T>(obj);
365 scoped_refptr<T> AdoptRefIfNeeded(T* obj, StartRefCountFromOneTag) {
372 // object into a scoped_refptr.
374 scoped_refptr<T> MakeShared(Args&&... args) {
395 // scoped_refptr<MyFoo> foo = new MyFoo();
401 // scoped_refptr<MyFoo> foo = new MyFoo();
409 // The above examples show how scoped_refptr<T> acts like a pointer to T.
410 // Given two scoped_refptr<T> classes, it is also possible to exchange
414 // scoped_refptr<MyFoo> a = new MyFoo();
415 // scoped_refptr<MyFoo> b;
425 // scoped_refptr<MyFoo> a = new MyFoo();
426 // scoped_refptr<MyFoo> b;
433 class scoped_refptr {
437 scoped_refptr() {}
439 scoped_refptr(T* p) : ptr_(p) {
445 scoped_refptr(const scoped_refptr<T>& r) : ptr_(r.ptr_) {
454 scoped_refptr(const scoped_refptr<U>& r) : ptr_(r.get()) {
461 scoped_refptr(scoped_refptr&& r) : ptr_(r.get()) { r.ptr_ = nullptr; }
467 scoped_refptr(scoped_refptr<U>&& r) : ptr_(r.get()) {
471 ~scoped_refptr() {
488 scoped_refptr<T>& operator=(T* p) {
499 scoped_refptr<T>& operator=(const scoped_refptr<T>& r) {
504 scoped_refptr<T>& operator=(const scoped_refptr<U>& r) {
508 scoped_refptr<T>& operator=(scoped_refptr<T>&& r) {
509 scoped_refptr<T>(std::move(r)).swap(*this);
514 scoped_refptr<T>& operator=(scoped_refptr<U>&& r) {
515 scoped_refptr<T>(std::move(r)).swap(*this);
519 void swap(scoped_refptr<T>& r) {
528 bool operator==(const scoped_refptr<U>& rhs) const {
533 bool operator!=(const scoped_refptr<U>& rhs) const {
538 bool operator<(const scoped_refptr<U>& rhs) const {
547 friend scoped_refptr<U> base::AdoptRef(U*);
549 scoped_refptr(T* p, base::subtle::AdoptRefTag) : ptr_(p) {}
553 friend class scoped_refptr;
557 // extern template class scoped_refptr<Opaque>;
565 void scoped_refptr<T>::AddRef(T* ptr) {
571 void scoped_refptr<T>::Release(T* ptr) {
575 // Handy utility for creating a scoped_refptr<T> out of a T* explicitly without
578 scoped_refptr<T> make_scoped_refptr(T* t) {
579 return scoped_refptr<T>(t);
583 bool operator==(const scoped_refptr<T>& lhs, const U* rhs) {
588 bool operator==(const T* lhs, const scoped_refptr
593 bool operator==(const scoped_refptr<T>& lhs, std::nullptr_t null) {
598 bool operator==(std::nullptr_t null, const scoped_refptr<T>& rhs) {
603 bool operator!=(const scoped_refptr<T>& lhs, const U* rhs) {
608 bool operator!=(const T* lhs, const scoped_refptr<U>& rhs) {
613 bool operator!=(const scoped_refptr<T>& lhs, std::nullptr_t null) {
618 bool operator!=(std::nullptr_t null, const scoped_refptr<T>& rhs) {
623 std::ostream& operator<<(std::ostream& out, const scoped_refptr<T>& p) {