Lines Matching refs:refs_

417 RefBase::RefBase() : refs_(new RefCounter())
419 refs_->IncRefCount();
420 refs_->SetCallback([this] { this->RefPtrCallback(); });
422 refs_->SetCanPromote([this] { return this->CanPromote(); });
428 refs_ = new (std::nothrow) RefCounter();
429 if (refs_ != nullptr) {
430 refs_->IncRefCount();
431 refs_->SetCallback([this] { this->RefPtrCallback(); });
433 refs_->SetCanPromote([this] { return this->CanPromote(); });
458 if (refs_ != nullptr) {
459 refs_->RemoveCallback();
460 refs_->DecRefCount();
463 refs_ = new (std::nothrow) RefCounter();
464 if (refs_ != nullptr) {
465 refs_->IncRefCount();
466 refs_->SetCallback([this] { this->RefPtrCallback(); });
468 refs_->SetCanPromote([this] { return this->CanPromote(); });
477 refs_ = other.refs_;
478 other.refs_ = nullptr;
483 if (refs_ == other.refs_) {
487 if (refs_ != nullptr) {
488 refs_->RemoveCallback();
489 refs_->DecRefCount();
492 refs_ = other.refs_;
493 other.refs_ = nullptr;
499 if (refs_ != nullptr) {
500 refs_->RemoveCallback();
501 if ((refs_->IsLifeTimeExtended() && refs_->GetWeakRefCount() == 0) ||
502 refs_->GetStrongRefCount() == INITIAL_PRIMARY_VALUE) {
503 refs_->DecRefCount();
505 refs_ = nullptr;
511 refs_->ExtendObjectLifetime();
516 if (refs_ == nullptr) {
521 const int curCount = refs_->IncStrongRefCount(objectId);
522 if (!refs_->IsLifeTimeExtended() && curCount == 0) {
532 if (refs_->IsAttemptAcquireSet()) {
533 refs_->ClearAttemptAcquire();
534 const int attemptCount = refs_->GetAttemptAcquire();
539 refs_->DecStrongRefCount(objectId);
540 refs_->DecWeakRefCount(objectId);
546 if (refs_ == nullptr) {
550 RefCounter * const refs = refs_;
570 if (refs_ == nullptr) {
573 return refs_->GetStrongRefCount();
578 if (refs_ != nullptr) {
579 return new WeakRefCounter(refs_, cookie);
586 if (refs_ != nullptr) {
587 refs_->IncWeakRefCount(objectId);
593 return refs_;
598 if (refs_ != nullptr) {
599 refs_->DecWeakRefCount(objectId);
605 if (refs_ == nullptr) {
608 return refs_->GetWeakRefCount();
613 if (refs_ == nullptr) {
618 if (refs_->AttemptIncStrongRef(objectId, count)) {
619 refs_->SetAttemptAcquire();
631 if ((refs_ != nullptr) && (OnAttemptPromoted(objectId))) {
633 bool ret = refs_->AttemptIncStrongRef(objectId, count);
645 if (refs_ == nullptr) {
648 if (refs_->AttemptIncStrong(objectId)) {
649 refs_->SetAttemptAcquire();
657 if (refs_ == nullptr) {
660 return refs_->IsAttemptAcquireSet();
665 if (refs_ == nullptr) {
668 return refs_->IsLifeTimeExtended();
688 refs_->EnableTracker();