65 lines
1.6 KiB
Smali
65 lines
1.6 KiB
Smali
.class public Lorg/webrtc/RefCountDelegate;
|
|
.super Ljava/lang/Object;
|
|
.source "RefCountDelegate.java"
|
|
|
|
# interfaces
|
|
.implements Lorg/webrtc/RefCounted;
|
|
|
|
|
|
# instance fields
|
|
.field public final refCount:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
.field public final releaseCallback:Ljava/lang/Runnable;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Ljava/lang/Runnable;)V
|
|
.locals 2
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>(I)V
|
|
|
|
iput-object v0, p0, Lorg/webrtc/RefCountDelegate;->refCount:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
iput-object p1, p0, Lorg/webrtc/RefCountDelegate;->releaseCallback:Ljava/lang/Runnable;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public release()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lorg/webrtc/RefCountDelegate;->refCount:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->decrementAndGet()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lorg/webrtc/RefCountDelegate;->releaseCallback:Ljava/lang/Runnable;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {v0}, Ljava/lang/Runnable;->run()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public retain()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lorg/webrtc/RefCountDelegate;->refCount:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->incrementAndGet()I
|
|
|
|
return-void
|
|
.end method
|