Cache$CacheRequestImpl.smali 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. .class final Lokhttp3/Cache$CacheRequestImpl;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Lokhttp3/internal/cache/CacheRequest;
  6. # annotations
  7. .annotation system Ldalvik/annotation/EnclosingClass;
  8. value = Lokhttp3/Cache;
  9. .end annotation
  10. .annotation system Ldalvik/annotation/InnerClass;
  11. accessFlags = 0x12
  12. name = "CacheRequestImpl"
  13. .end annotation
  14. # instance fields
  15. .field private body:Lokio/Sink;
  16. .field private cacheOut:Lokio/Sink;
  17. .field done:Z
  18. .field private final editor:Lokhttp3/internal/cache/DiskLruCache$Editor;
  19. .field final synthetic this$0:Lokhttp3/Cache;
  20. # direct methods
  21. .method constructor <init>(Lokhttp3/Cache;Lokhttp3/internal/cache/DiskLruCache$Editor;)V
  22. .locals 2
  23. iput-object p1, p0, Lokhttp3/Cache$CacheRequestImpl;->this$0:Lokhttp3/Cache;
  24. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  25. iput-object p2, p0, Lokhttp3/Cache$CacheRequestImpl;->editor:Lokhttp3/internal/cache/DiskLruCache$Editor;
  26. const/4 v0, 0x1
  27. invoke-virtual {p2, v0}, Lokhttp3/internal/cache/DiskLruCache$Editor;->newSink(I)Lokio/Sink;
  28. move-result-object v0
  29. iput-object v0, p0, Lokhttp3/Cache$CacheRequestImpl;->cacheOut:Lokio/Sink;
  30. new-instance v0, Lokhttp3/Cache$CacheRequestImpl$1;
  31. iget-object v1, p0, Lokhttp3/Cache$CacheRequestImpl;->cacheOut:Lokio/Sink;
  32. invoke-direct {v0, p0, v1, p1, p2}, Lokhttp3/Cache$CacheRequestImpl$1;-><init>(Lokhttp3/Cache$CacheRequestImpl;Lokio/Sink;Lokhttp3/Cache;Lokhttp3/internal/cache/DiskLruCache$Editor;)V
  33. iput-object v0, p0, Lokhttp3/Cache$CacheRequestImpl;->body:Lokio/Sink;
  34. return-void
  35. .end method
  36. # virtual methods
  37. .method public abort()V
  38. .locals 4
  39. iget-object v0, p0, Lokhttp3/Cache$CacheRequestImpl;->this$0:Lokhttp3/Cache;
  40. monitor-enter v0
  41. :try_start_0
  42. iget-boolean v1, p0, Lokhttp3/Cache$CacheRequestImpl;->done:Z
  43. if-eqz v1, :cond_0
  44. monitor-exit v0
  45. return-void
  46. :cond_0
  47. const/4 v1, 0x1
  48. iput-boolean v1, p0, Lokhttp3/Cache$CacheRequestImpl;->done:Z
  49. iget-object v2, p0, Lokhttp3/Cache$CacheRequestImpl;->this$0:Lokhttp3/Cache;
  50. iget v3, v2, Lokhttp3/Cache;->writeAbortCount:I
  51. add-int/2addr v3, v1
  52. iput v3, v2, Lokhttp3/Cache;->writeAbortCount:I
  53. monitor-exit v0
  54. :try_end_0
  55. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  56. iget-object v0, p0, Lokhttp3/Cache$CacheRequestImpl;->cacheOut:Lokio/Sink;
  57. invoke-static {v0}, Lokhttp3/internal/Util;->closeQuietly(Ljava/io/Closeable;)V
  58. :try_start_1
  59. iget-object v0, p0, Lokhttp3/Cache$CacheRequestImpl;->editor:Lokhttp3/internal/cache/DiskLruCache$Editor;
  60. invoke-virtual {v0}, Lokhttp3/internal/cache/DiskLruCache$Editor;->abort()V
  61. :try_end_1
  62. .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
  63. :catch_0
  64. return-void
  65. :catchall_0
  66. move-exception v1
  67. :try_start_2
  68. monitor-exit v0
  69. :try_end_2
  70. .catchall {:try_start_2 .. :try_end_2} :catchall_0
  71. throw v1
  72. .end method
  73. .method public body()Lokio/Sink;
  74. .locals 1
  75. iget-object v0, p0, Lokhttp3/Cache$CacheRequestImpl;->body:Lokio/Sink;
  76. return-object v0
  77. .end method