BufferedDiskCache.smali
.class public Lcom/facebook/imagepipeline/cache/BufferedDiskCache;
.super Ljava/lang/Object;
.source "BufferedDiskCache.java"
# static fields
.field private static final TAG:Ljava/lang/Class;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Class<",
"*>;"
}
.end annotation
.end field
# instance fields
.field private final mFileCache:Lcom/facebook/cache/disk/FileCache;
.field private final mImageCacheStatsTracker:Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
.field private final mPooledByteBufferFactory:Lcom/facebook/common/memory/PooledByteBufferFactory;
.field private final mPooledByteStreams:Lcom/facebook/common/memory/PooledByteStreams;
.field private final mReadExecutor:Ljava/util/concurrent/Executor;
.field private final mStagingArea:Lcom/facebook/imagepipeline/cache/StagingArea;
.field private final mWriteExecutor:Ljava/util/concurrent/Executor;
# direct methods
.method static constructor <clinit>()V
.registers 1
.line 40
const-class v0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;
sput-object v0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
return-void
.end method
.method public constructor <init>(Lcom/facebook/cache/disk/FileCache;Lcom/facebook/common/memory/PooledByteBufferFactory;Lcom/facebook/common/memory/PooledByteStreams;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;)V
.registers 7
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x0,
0x0,
0x0,
0x0,
0x0,
0x0
}
names = {
"fileCache",
"pooledByteBufferFactory",
"pooledByteStreams",
"readExecutor",
"writeExecutor",
"imageCacheStatsTracker"
}
.end annotation
.line 56
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 57
iput-object p1, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mFileCache:Lcom/facebook/cache/disk/FileCache;
.line 58
iput-object p2, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mPooledByteBufferFactory:Lcom/facebook/common/memory/PooledByteBufferFactory;
.line 59
iput-object p3, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mPooledByteStreams:Lcom/facebook/common/memory/PooledByteStreams;
.line 60
iput-object p4, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mReadExecutor:Ljava/util/concurrent/Executor;
.line 61
iput-object p5, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mWriteExecutor:Ljava/util/concurrent/Executor;
.line 62
iput-object p6, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mImageCacheStatsTracker:Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
.line 63
invoke-static {}, Lcom/facebook/imagepipeline/cache/StagingArea;->getInstance()Lcom/facebook/imagepipeline/cache/StagingArea;
move-result-object p1
iput-object p1, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mStagingArea:Lcom/facebook/imagepipeline/cache/StagingArea;
return-void
.end method
.method static synthetic access$000(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;Lcom/facebook/cache/common/CacheKey;)Z
.registers 2
.line 39
invoke-direct {p0, p1}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->checkInStagingAreaAndFileCache(Lcom/facebook/cache/common/CacheKey;)Z
move-result p0
return p0
.end method
.method static synthetic access$100(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;)Lcom/facebook/cache/disk/FileCache;
.registers 1
.line 39
iget-object p0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mFileCache:Lcom/facebook/cache/disk/FileCache;
return-object p0
.end method
.method static synthetic access$200(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;)Lcom/facebook/imagepipeline/cache/StagingArea;
.registers 1
.line 39
iget-object p0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mStagingArea:Lcom/facebook/imagepipeline/cache/StagingArea;
return-object p0
.end method
.method static synthetic access$300()Ljava/lang/Class;
.registers 1
.line 39
sget-object v0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
return-object v0
.end method
.method static synthetic access$400(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;)Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
.registers 1
.line 39
iget-object p0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mImageCacheStatsTracker:Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
return-object p0
.end method
.method static synthetic access$500(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;Lcom/facebook/cache/common/CacheKey;)Lcom/facebook/common/memory/PooledByteBuffer;
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 39
invoke-direct {p0, p1}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->readFromDiskCache(Lcom/facebook/cache/common/CacheKey;)Lcom/facebook/common/memory/PooledByteBuffer;
move-result-object p0
return-object p0
.end method
.method static synthetic access$600(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;Lcom/facebook/cache/common/CacheKey;Lcom/facebook/imagepipeline/image/EncodedImage;)V
.registers 3
.line 39
invoke-direct {p0, p1, p2}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->writeToDiskCache(Lcom/facebook/cache/common/CacheKey;Lcom/facebook/imagepipeline/image/EncodedImage;)V
return-void
.end method
.method static synthetic access$700(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;)Lcom/facebook/common/memory/PooledByteStreams;
.registers 1
.line 39
iget-object p0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mPooledByteStreams:Lcom/facebook/common/memory/PooledByteStreams;
return-object p0
.end method
.method private checkInStagingAreaAndFileCache(Lcom/facebook/cache/common/CacheKey;)Z
.registers 5
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10
}
names = {
"key"
}
.end annotation
.line 202
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mStagingArea:Lcom/facebook/imagepipeline/cache/StagingArea;
invoke-virtual {v0, p1}, Lcom/facebook/imagepipeline/cache/StagingArea;->get(Lcom/facebook/cache/common/CacheKey;)Lcom/facebook/imagepipeline/image/EncodedImage;
move-result-object v0
if-eqz v0, :cond_1d
.line 204
invoke-virtual {v0}, Lcom/facebook/imagepipeline/image/EncodedImage;->close()V
.line 205
sget-object v0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v1
const-string v2, "Found image for %s in staging area"
invoke-static {v0, v2, v1}, Lcom/facebook/common/logging/FLog;->v(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
.line 206
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mImageCacheStatsTracker:Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
invoke-interface {v0, p1}, Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;->onStagingAreaHit(Lcom/facebook/cache/common/CacheKey;)V
const/4 p1, 0x1
return p1
.line 209
:cond_1d
sget-object v0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v1
const-string v2, "Did not find image for %s in staging area"
invoke-static {v0, v2, v1}, Lcom/facebook/common/logging/FLog;->v(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
.line 210
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mImageCacheStatsTracker:Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
invoke-interface {v0, p1}, Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;->onStagingAreaMiss(Lcom/facebook/cache/common/CacheKey;)V
.line 212
:try_start_2d
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mFileCache:Lcom/facebook/cache/disk/FileCache;
invoke-interface {v0, p1}, Lcom/facebook/cache/disk/FileCache;->hasKey(Lcom/facebook/cache/common/CacheKey;)Z
move-result p1
:try_end_33
.catch Ljava/lang/Exception; {:try_start_2d .. :try_end_33} :catch_34
return p1
:catch_34
const/4 p1, 0x0
return p1
.end method
.method private containsAsync(Lcom/facebook/cache/common/CacheKey;)Lbolts/Task;
.registers 6
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10
}
names = {
"key"
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/facebook/cache/common/CacheKey;",
")",
"Lbolts/Task<",
"Ljava/lang/Boolean;",
">;"
}
.end annotation
:try_start_0
const-string v0, "BufferedDiskCache_containsAsync"
.line 95
invoke-static {v0}, Lcom/facebook/imagepipeline/instrumentation/FrescoInstrumenter;->onBeforeSubmitWork(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
.line 96
new-instance v1, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$1;
invoke-direct {v1, p0, v0, p1}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$1;-><init>(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;Ljava/lang/Object;Lcom/facebook/cache/common/CacheKey;)V
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mReadExecutor:Ljava/util/concurrent/Executor;
invoke-static {v1, v0}, Lbolts/Task;->call(Ljava/util/concurrent/Callable;Ljava/util/concurrent/Executor;)Lbolts/Task;
move-result-object p1
:try_end_11
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_11} :catch_12
return-object p1
:catch_12
move-exception v0
.line 115
sget-object v1, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
const/4 v2, 0x1
new-array v2, v2, [Ljava/lang/Object;
const/4 v3, 0x0
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object p1
aput-object p1, v2, v3
const-string p1, "Failed to schedule disk-cache read for %s"
invoke-static {v1, v0, p1, v2}, Lcom/facebook/common/logging/FLog;->w(Ljava/lang/Class;Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V
.line 116
invoke-static {v0}, Lbolts/Task;->forError(Ljava/lang/Exception;)Lbolts/Task;
move-result-object p1
return-object p1
.end method
.method private foundPinnedImage(Lcom/facebook/cache/common/CacheKey;Lcom/facebook/imagepipeline/image/EncodedImage;)Lbolts/Task;
.registers 6
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x0,
0x0
}
names = {
"key",
"pinnedImage"
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/facebook/cache/common/CacheKey;",
"Lcom/facebook/imagepipeline/image/EncodedImage;",
")",
"Lbolts/Task<",
"Lcom/facebook/imagepipeline/image/EncodedImage;",
">;"
}
.end annotation
.line 401
sget-object v0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v1
const-string v2, "Found image for %s in staging area"
invoke-static {v0, v2, v1}, Lcom/facebook/common/logging/FLog;->v(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
.line 402
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mImageCacheStatsTracker:Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
invoke-interface {v0, p1}, Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;->onStagingAreaHit(Lcom/facebook/cache/common/CacheKey;)V
.line 403
invoke-static {p2}, Lbolts/Task;->forResult(Ljava/lang/Object;)Lbolts/Task;
move-result-object p1
return-object p1
.end method
.method private getAsync(Lcom/facebook/cache/common/CacheKey;Ljava/util/concurrent/atomic/AtomicBoolean;)Lbolts/Task;
.registers 6
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10,
0x10
}
names = {
"key",
"isCancelled"
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/facebook/cache/common/CacheKey;",
"Ljava/util/concurrent/atomic/AtomicBoolean;",
")",
"Lbolts/Task<",
"Lcom/facebook/imagepipeline/image/EncodedImage;",
">;"
}
.end annotation
:try_start_0
const-string v0, "BufferedDiskCache_getAsync"
.line 221
invoke-static {v0}, Lcom/facebook/imagepipeline/instrumentation/FrescoInstrumenter;->onBeforeSubmitWork(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
.line 222
new-instance v1, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$3;
invoke-direct {v1, p0, v0, p2, p1}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$3;-><init>(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicBoolean;Lcom/facebook/cache/common/CacheKey;)V
iget-object p2, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mReadExecutor:Ljava/util/concurrent/Executor;
invoke-static {v1, p2}, Lbolts/Task;->call(Ljava/util/concurrent/Callable;Ljava/util/concurrent/Executor;)Lbolts/Task;
move-result-object p1
:try_end_11
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_11} :catch_12
return-object p1
:catch_12
move-exception p2
.line 276
sget-object v0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
const/4 v1, 0x1
new-array v1, v1, [Ljava/lang/Object;
const/4 v2, 0x0
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object p1
aput-object p1, v1, v2
const-string p1, "Failed to schedule disk-cache read for %s"
invoke-static {v0, p2, p1, v1}, Lcom/facebook/common/logging/FLog;->w(Ljava/lang/Class;Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V
.line 277
invoke-static {p2}, Lbolts/Task;->forError(Ljava/lang/Exception;)Lbolts/Task;
move-result-object p1
return-object p1
.end method
.method private readFromDiskCache(Lcom/facebook/cache/common/CacheKey;)Lcom/facebook/common/memory/PooledByteBuffer;
.registers 8
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10
}
names = {
"key"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.line 409
:try_start_0
sget-object v0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
const-string v1, "Disk cache read for %s"
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v2
invoke-static {v0, v1, v2}, Lcom/facebook/common/logging/FLog;->v(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
.line 411
iget-object v1, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mFileCache:Lcom/facebook/cache/disk/FileCache;
invoke-interface {v1, p1}, Lcom/facebook/cache/disk/FileCache;->getResource(Lcom/facebook/cache/common/CacheKey;)Lcom/facebook/binaryresource/BinaryResource;
move-result-object v1
if-nez v1, :cond_23
const-string v1, "Disk cache miss for %s"
.line 413
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v2
invoke-static {v0, v1, v2}, Lcom/facebook/common/logging/FLog;->v(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
.line 414
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mImageCacheStatsTracker:Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
invoke-interface {v0, p1}, Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;->onDiskCacheMiss(Lcom/facebook/cache/common/CacheKey;)V
const/4 p1, 0x0
return-object p1
:cond_23
const-string v2, "Found entry in disk cache for %s"
.line 417
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v3
invoke-static {v0, v2, v3}, Lcom/facebook/common/logging/FLog;->v(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
.line 418
iget-object v2, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mImageCacheStatsTracker:Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
invoke-interface {v2, p1}, Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;->onDiskCacheHit(Lcom/facebook/cache/common/CacheKey;)V
.line 422
invoke-interface {v1}, Lcom/facebook/binaryresource/BinaryResource;->openStream()Ljava/io/InputStream;
move-result-object v2
:try_end_35
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_35} :catch_52
.line 424
:try_start_35
iget-object v3, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mPooledByteBufferFactory:Lcom/facebook/common/memory/PooledByteBufferFactory;
invoke-interface {v1}, Lcom/facebook/binaryresource/BinaryResource;->size()J
move-result-wide v4
long-to-int v1, v4
invoke-interface {v3, v2, v1}, Lcom/facebook/common/memory/PooledByteBufferFactory;->newByteBuffer(Ljava/io/InputStream;I)Lcom/facebook/common/memory/PooledByteBuffer;
move-result-object v1
:try_end_40
.catchall {:try_start_35 .. :try_end_40} :catchall_4d
.line 426
:try_start_40
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
const-string v2, "Successful read from disk cache for %s"
.line 429
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v3
invoke-static {v0, v2, v3}, Lcom/facebook/common/logging/FLog;->v(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
return-object v1
:catchall_4d
move-exception v0
.line 426
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
.line 427
throw v0
:try_end_52
.catch Ljava/io/IOException; {:try_start_40 .. :try_end_52} :catch_52
:catch_52
move-exception v0
.line 435
sget-object v1, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
const/4 v2, 0x1
new-array v2, v2, [Ljava/lang/Object;
const/4 v3, 0x0
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v4
aput-object v4, v2, v3
const-string v3, "Exception reading from cache for %s"
invoke-static {v1, v0, v3, v2}, Lcom/facebook/common/logging/FLog;->w(Ljava/lang/Class;Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V
.line 436
iget-object v1, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mImageCacheStatsTracker:Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
invoke-interface {v1, p1}, Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;->onDiskCacheGetFail(Lcom/facebook/cache/common/CacheKey;)V
.line 437
throw v0
.end method
.method private writeToDiskCache(Lcom/facebook/cache/common/CacheKey;Lcom/facebook/imagepipeline/image/EncodedImage;)V
.registers 6
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10,
0x10
}
names = {
"key",
"encodedImage"
}
.end annotation
.line 447
sget-object v0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v1
const-string v2, "About to write to disk-cache for key %s"
invoke-static {v0, v2, v1}, Lcom/facebook/common/logging/FLog;->v(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
.line 449
:try_start_b
iget-object v1, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mFileCache:Lcom/facebook/cache/disk/FileCache;
new-instance v2, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$7;
invoke-direct {v2, p0, p2}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$7;-><init>(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;Lcom/facebook/imagepipeline/image/EncodedImage;)V
invoke-interface {v1, p1, v2}, Lcom/facebook/cache/disk/FileCache;->insert(Lcom/facebook/cache/common/CacheKey;Lcom/facebook/cache/common/WriterCallback;)Lcom/facebook/binaryresource/BinaryResource;
.line 459
iget-object p2, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mImageCacheStatsTracker:Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;
invoke-interface {p2, p1}, Lcom/facebook/imagepipeline/cache/ImageCacheStatsTracker;->onDiskCachePut(Lcom/facebook/cache/common/CacheKey;)V
const-string p2, "Successful disk-cache write for key %s"
.line 460
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, p2, v1}, Lcom/facebook/common/logging/FLog;->v(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
:try_end_23
.catch Ljava/io/IOException; {:try_start_b .. :try_end_23} :catch_24
goto :goto_36
:catch_24
move-exception p2
.line 464
sget-object v0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
const/4 v1, 0x1
new-array v1, v1, [Ljava/lang/Object;
const/4 v2, 0x0
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object p1
aput-object p1, v1, v2
const-string p1, "Failed to write to disk-cache for key %s"
invoke-static {v0, p2, p1, v1}, Lcom/facebook/common/logging/FLog;->w(Ljava/lang/Class;Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V
:goto_36
return-void
.end method
# virtual methods
.method public addKeyForAsyncProbing(Lcom/facebook/cache/common/CacheKey;)V
.registers 3
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10
}
names = {
"key"
}
.end annotation
.line 190
invoke-static {p1}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 191
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mFileCache:Lcom/facebook/cache/disk/FileCache;
invoke-interface {v0, p1}, Lcom/facebook/cache/disk/FileCache;->probe(Lcom/facebook/cache/common/CacheKey;)Z
return-void
.end method
.method public clearAll()Lbolts/Task;
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lbolts/Task<",
"Ljava/lang/Void;",
">;"
}
.end annotation
.line 367
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mStagingArea:Lcom/facebook/imagepipeline/cache/StagingArea;
invoke-virtual {v0}, Lcom/facebook/imagepipeline/cache/StagingArea;->clearAll()V
const-string v0, "BufferedDiskCache_clearAll"
.line 368
invoke-static {v0}, Lcom/facebook/imagepipeline/instrumentation/FrescoInstrumenter;->onBeforeSubmitWork(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
.line 370
:try_start_b
new-instance v1, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$6;
invoke-direct {v1, p0, v0}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$6;-><init>(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;Ljava/lang/Object;)V
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mWriteExecutor:Ljava/util/concurrent/Executor;
invoke-static {v1, v0}, Lbolts/Task;->call(Ljava/util/concurrent/Callable;Ljava/util/concurrent/Executor;)Lbolts/Task;
move-result-object v0
:try_end_16
.catch Ljava/lang/Exception; {:try_start_b .. :try_end_16} :catch_17
return-object v0
:catch_17
move-exception v0
.line 391
sget-object v1, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
const/4 v2, 0x0
new-array v2, v2, [Ljava/lang/Object;
const-string v3, "Failed to schedule disk-cache clear"
invoke-static {v1, v0, v3, v2}, Lcom/facebook/common/logging/FLog;->w(Ljava/lang/Class;Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V
.line 392
invoke-static {v0}, Lbolts/Task;->forError(Ljava/lang/Exception;)Lbolts/Task;
move-result-object v0
return-object v0
.end method
.method public contains(Lcom/facebook/cache/common/CacheKey;)Lbolts/Task;
.registers 3
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10
}
names = {
"key"
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/facebook/cache/common/CacheKey;",
")",
"Lbolts/Task<",
"Ljava/lang/Boolean;",
">;"
}
.end annotation
.line 87
invoke-virtual {p0, p1}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->containsSync(Lcom/facebook/cache/common/CacheKey;)Z
move-result v0
if-eqz v0, :cond_10
const/4 p1, 0x1
.line 88
invoke-static {p1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object p1
invoke-static {p1}, Lbolts/Task;->forResult(Ljava/lang/Object;)Lbolts/Task;
move-result-object p1
return-object p1
.line 90
:cond_10
invoke-direct {p0, p1}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->containsAsync(Lcom/facebook/cache/common/CacheKey;)Lbolts/Task;
move-result-object p1
return-object p1
.end method
.method public containsSync(Lcom/facebook/cache/common/CacheKey;)Z
.registers 3
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x0
}
names = {
"key"
}
.end annotation
.line 75
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mStagingArea:Lcom/facebook/imagepipeline/cache/StagingArea;
invoke-virtual {v0, p1}, Lcom/facebook/imagepipeline/cache/StagingArea;->containsKey(Lcom/facebook/cache/common/CacheKey;)Z
move-result v0
if-nez v0, :cond_13
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mFileCache:Lcom/facebook/cache/disk/FileCache;
invoke-interface {v0, p1}, Lcom/facebook/cache/disk/FileCache;->hasKeySync(Lcom/facebook/cache/common/CacheKey;)Z
move-result p1
if-eqz p1, :cond_11
goto :goto_13
:cond_11
const/4 p1, 0x0
goto :goto_14
:cond_13
:goto_13
const/4 p1, 0x1
:goto_14
return p1
.end method
.method public diskCheckSync(Lcom/facebook/cache/common/CacheKey;)Z
.registers 3
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10
}
names = {
"key"
}
.end annotation
.line 127
invoke-virtual {p0, p1}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->containsSync(Lcom/facebook/cache/common/CacheKey;)Z
move-result v0
if-eqz v0, :cond_8
const/4 p1, 0x1
return p1
.line 130
:cond_8
invoke-direct {p0, p1}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->checkInStagingAreaAndFileCache(Lcom/facebook/cache/common/CacheKey;)Z
move-result p1
return p1
.end method
.method public get(Lcom/facebook/cache/common/CacheKey;Ljava/util/concurrent/atomic/AtomicBoolean;)Lbolts/Task;
.registers 4
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x0,
0x0
}
names = {
"key",
"isCancelled"
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/facebook/cache/common/CacheKey;",
"Ljava/util/concurrent/atomic/AtomicBoolean;",
")",
"Lbolts/Task<",
"Lcom/facebook/imagepipeline/image/EncodedImage;",
">;"
}
.end annotation
.line 144
:try_start_0
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->isTracing()Z
move-result v0
if-eqz v0, :cond_b
const-string v0, "BufferedDiskCache#get"
.line 145
invoke-static {v0}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->beginSection(Ljava/lang/String;)V
.line 147
:cond_b
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mStagingArea:Lcom/facebook/imagepipeline/cache/StagingArea;
invoke-virtual {v0, p1}, Lcom/facebook/imagepipeline/cache/StagingArea;->get(Lcom/facebook/cache/common/CacheKey;)Lcom/facebook/imagepipeline/image/EncodedImage;
move-result-object v0
if-eqz v0, :cond_21
.line 149
invoke-direct {p0, p1, v0}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->foundPinnedImage(Lcom/facebook/cache/common/CacheKey;Lcom/facebook/imagepipeline/image/EncodedImage;)Lbolts/Task;
move-result-object p1
:try_end_17
.catchall {:try_start_0 .. :try_end_17} :catchall_2f
.line 153
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->isTracing()Z
move-result p2
if-eqz p2, :cond_20
.line 154
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->endSection()V
:cond_20
return-object p1
.line 151
:cond_21
:try_start_21
invoke-direct {p0, p1, p2}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->getAsync(Lcom/facebook/cache/common/CacheKey;Ljava/util/concurrent/atomic/AtomicBoolean;)Lbolts/Task;
move-result-object p1
:try_end_25
.catchall {:try_start_21 .. :try_end_25} :catchall_2f
.line 153
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->isTracing()Z
move-result p2
if-eqz p2, :cond_2e
.line 154
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->endSection()V
:cond_2e
return-object p1
:catchall_2f
move-exception p1
.line 153
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->isTracing()Z
move-result p2
if-eqz p2, :cond_39
.line 154
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->endSection()V
.line 156
:cond_39
throw p1
.end method
.method public getSize()J
.registers 3
.line 397
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mFileCache:Lcom/facebook/cache/disk/FileCache;
invoke-interface {v0}, Lcom/facebook/cache/disk/FileCache;->getSize()J
move-result-wide v0
return-wide v0
.end method
.method public probe(Lcom/facebook/cache/common/CacheKey;)Lbolts/Task;
.registers 6
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10
}
names = {
"key"
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/facebook/cache/common/CacheKey;",
")",
"Lbolts/Task<",
"Ljava/lang/Void;",
">;"
}
.end annotation
.line 166
invoke-static {p1}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
:try_start_3
const-string v0, "BufferedDiskCache_probe"
.line 168
invoke-static {v0}, Lcom/facebook/imagepipeline/instrumentation/FrescoInstrumenter;->onBeforeSubmitWork(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
.line 169
new-instance v1, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$2;
invoke-direct {v1, p0, v0, p1}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$2;-><init>(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;Ljava/lang/Object;Lcom/facebook/cache/common/CacheKey;)V
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mWriteExecutor:Ljava/util/concurrent/Executor;
invoke-static {v1, v0}, Lbolts/Task;->call(Ljava/util/concurrent/Callable;Ljava/util/concurrent/Executor;)Lbolts/Task;
move-result-object p1
:try_end_14
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_14} :catch_15
return-object p1
:catch_15
move-exception v0
.line 184
sget-object v1, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
const/4 v2, 0x1
new-array v2, v2, [Ljava/lang/Object;
const/4 v3, 0x0
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object p1
aput-object p1, v2, v3
const-string p1, "Failed to schedule disk-cache probe for %s"
invoke-static {v1, v0, p1, v2}, Lcom/facebook/common/logging/FLog;->w(Ljava/lang/Class;Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V
.line 185
invoke-static {v0}, Lbolts/Task;->forError(Ljava/lang/Exception;)Lbolts/Task;
move-result-object p1
return-object p1
.end method
.method public put(Lcom/facebook/cache/common/CacheKey;Lcom/facebook/imagepipeline/image/EncodedImage;)V
.registers 10
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10,
0x0
}
names = {
"key",
"encodedImage"
}
.end annotation
.line 287
:try_start_0
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->isTracing()Z
move-result v0
if-eqz v0, :cond_b
const-string v0, "BufferedDiskCache#put"
.line 288
invoke-static {v0}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->beginSection(Ljava/lang/String;)V
.line 290
:cond_b
invoke-static {p1}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 291
invoke-static {p2}, Lcom/facebook/imagepipeline/image/EncodedImage;->isValid(Lcom/facebook/imagepipeline/image/EncodedImage;)Z
move-result v0
invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v0
invoke-static {v0}, Lcom/facebook/common/internal/Preconditions;->checkArgument(Ljava/lang/Boolean;)V
.line 294
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mStagingArea:Lcom/facebook/imagepipeline/cache/StagingArea;
invoke-virtual {v0, p1, p2}, Lcom/facebook/imagepipeline/cache/StagingArea;->put(Lcom/facebook/cache/common/CacheKey;Lcom/facebook/imagepipeline/image/EncodedImage;)V
.line 299
invoke-static {p2}, Lcom/facebook/imagepipeline/image/EncodedImage;->cloneOrNull(Lcom/facebook/imagepipeline/image/EncodedImage;)Lcom/facebook/imagepipeline/image/EncodedImage;
move-result-object v0
:try_end_22
.catchall {:try_start_0 .. :try_end_22} :catchall_57
:try_start_22
const-string v1, "BufferedDiskCache_putAsync"
.line 301
invoke-static {v1}, Lcom/facebook/imagepipeline/instrumentation/FrescoInstrumenter;->onBeforeSubmitWork(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
.line 302
iget-object v2, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mWriteExecutor:Ljava/util/concurrent/Executor;
new-instance v3, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$4;
invoke-direct {v3, p0, v1, p1, v0}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$4;-><init>(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;Ljava/lang/Object;Lcom/facebook/cache/common/CacheKey;Lcom/facebook/imagepipeline/image/EncodedImage;)V
invoke-interface {v2, v3}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
:try_end_32
.catch Ljava/lang/Exception; {:try_start_22 .. :try_end_32} :catch_33
.catchall {:try_start_22 .. :try_end_32} :catchall_57
goto :goto_4d
:catch_33
move-exception v1
.line 322
:try_start_34
sget-object v2, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
const-string v3, "Failed to schedule disk-cache write for %s"
const/4 v4, 0x1
new-array v4, v4, [Ljava/lang/Object;
const/4 v5, 0x0
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object v6
aput-object v6, v4, v5
invoke-static {v2, v1, v3, v4}, Lcom/facebook/common/logging/FLog;->w(Ljava/lang/Class;Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V
.line 323
iget-object v1, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mStagingArea:Lcom/facebook/imagepipeline/cache/StagingArea;
invoke-virtual {v1, p1, p2}, Lcom/facebook/imagepipeline/cache/StagingArea;->remove(Lcom/facebook/cache/common/CacheKey;Lcom/facebook/imagepipeline/image/EncodedImage;)Z
.line 324
invoke-static {v0}, Lcom/facebook/imagepipeline/image/EncodedImage;->closeSafely(Lcom/facebook/imagepipeline/image/EncodedImage;)V
:try_end_4d
.catchall {:try_start_34 .. :try_end_4d} :catchall_57
.line 327
:goto_4d
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->isTracing()Z
move-result p1
if-eqz p1, :cond_56
.line 328
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->endSection()V
:cond_56
return-void
:catchall_57
move-exception p1
.line 327
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->isTracing()Z
move-result p2
if-eqz p2, :cond_61
.line 328
invoke-static {}, Lcom/facebook/imagepipeline/systrace/FrescoSystrace;->endSection()V
.line 330
:cond_61
throw p1
.end method
.method public remove(Lcom/facebook/cache/common/CacheKey;)Lbolts/Task;
.registers 6
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x10
}
names = {
"key"
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/facebook/cache/common/CacheKey;",
")",
"Lbolts/Task<",
"Ljava/lang/Void;",
">;"
}
.end annotation
.line 335
invoke-static {p1}, Lcom/facebook/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 336
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mStagingArea:Lcom/facebook/imagepipeline/cache/StagingArea;
invoke-virtual {v0, p1}, Lcom/facebook/imagepipeline/cache/StagingArea;->remove(Lcom/facebook/cache/common/CacheKey;)Z
:try_start_8
const-string v0, "BufferedDiskCache_remove"
.line 338
invoke-static {v0}, Lcom/facebook/imagepipeline/instrumentation/FrescoInstrumenter;->onBeforeSubmitWork(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
.line 339
new-instance v1, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$5;
invoke-direct {v1, p0, v0, p1}, Lcom/facebook/imagepipeline/cache/BufferedDiskCache$5;-><init>(Lcom/facebook/imagepipeline/cache/BufferedDiskCache;Ljava/lang/Object;Lcom/facebook/cache/common/CacheKey;)V
iget-object v0, p0, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->mWriteExecutor:Ljava/util/concurrent/Executor;
invoke-static {v1, v0}, Lbolts/Task;->call(Ljava/util/concurrent/Callable;Ljava/util/concurrent/Executor;)Lbolts/Task;
move-result-object p1
:try_end_19
.catch Ljava/lang/Exception; {:try_start_8 .. :try_end_19} :catch_1a
return-object p1
:catch_1a
move-exception v0
.line 360
sget-object v1, Lcom/facebook/imagepipeline/cache/BufferedDiskCache;->TAG:Ljava/lang/Class;
const/4 v2, 0x1
new-array v2, v2, [Ljava/lang/Object;
const/4 v3, 0x0
invoke-interface {p1}, Lcom/facebook/cache/common/CacheKey;->getUriString()Ljava/lang/String;
move-result-object p1
aput-object p1, v2, v3
const-string p1, "Failed to schedule disk-cache remove for %s"
invoke-static {v1, v0, p1, v2}, Lcom/facebook/common/logging/FLog;->w(Ljava/lang/Class;Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V
.line 361
invoke-static {v0}, Lbolts/Task;->forError(Ljava/lang/Exception;)Lbolts/Task;
move-result-object p1
return-object p1
.end method