Files
PINRemoteImage/Pod/Classes/PINRemoteImageDownloadTask.h
Garrett Moon 29b0b4ac65 Fixes a crash in task callbacks
While all methods on tasks are called within the manager's lock,
dispatching to another queue obviously means the manager may not
be locked anymore.

I also moved calling progress download callbacks to the download
task so it's similar to progress image.

Hopefully these issues have been fixed, but it leads me to believe
a better architecture would be to make the tasks immutable by the
manager and have the tasks manage a lock on themselves. I'll need
to think about that more.
2016-02-23 11:01:56 -08:00

25 lines
852 B
Objective-C

//
// PINRemoteImageDownloadTask.h
// Pods
//
// Created by Garrett Moon on 3/9/15.
//
//
#import "PINRemoteImageTask.h"
#import "PINProgressiveImage.h"
#import "PINDataTaskOperation.h"
@interface PINRemoteImageDownloadTask : PINRemoteImageTask
@property (nonatomic, strong, nullable) PINDataTaskOperation *urlSessionTaskOperation;
@property (nonatomic, assign) CFTimeInterval sessionTaskStartTime;
@property (nonatomic, assign) CFTimeInterval sessionTaskEndTime;
@property (nonatomic, assign) BOOL hasProgressBlocks;
@property (nonatomic, strong, nullable) PINProgressiveImage *progressImage;
- (void)callProgressDownloadWithQueue:(nonnull dispatch_queue_t)queue completedBytes:(int64_t)completedBytes totalBytes:(int64_t)totalBytes;
- (void)callProgressImageWithQueue:(nonnull dispatch_queue_t)queue withImage:(nonnull PINImage *)image;
@end