123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
-
-
-
-
-
-
-
-
-
- #import "GTMSessionFetcher.h"
-
- GTM_ASSUME_NONNULL_BEGIN
-
-
-
-
-
-
-
-
- extern NSString *const kGTMSessionFetcherServiceSessionBecameInvalidNotification;
- extern NSString *const kGTMSessionFetcherServiceSessionKey;
-
- @interface GTMSessionFetcherService : NSObject<GTMSessionFetcherServiceProtocol>
-
-
-
- @property(atomic, strong, readonly, GTM_NULLABLE) GTM_NSDictionaryOf(NSString *, NSArray *) *delayedFetchersByHost;
- @property(atomic, strong, readonly, GTM_NULLABLE) GTM_NSDictionaryOf(NSString *, NSArray *) *runningFetchersByHost;
-
-
-
-
-
- @property(atomic, assign) NSUInteger maxRunningFetchersPerHost;
-
-
- @property(atomic, strong, GTM_NULLABLE) NSURLSessionConfiguration *configuration;
- @property(atomic, copy, GTM_NULLABLE) GTMSessionFetcherConfigurationBlock configurationBlock;
- @property(atomic, strong, GTM_NULLABLE) NSHTTPCookieStorage *cookieStorage;
- @property(atomic, strong, GTM_NULL_RESETTABLE) dispatch_queue_t callbackQueue;
- @property(atomic, copy, GTM_NULLABLE) GTMSessionFetcherChallengeBlock challengeBlock;
- @property(atomic, strong, GTM_NULLABLE) NSURLCredential *credential;
- @property(atomic, strong) NSURLCredential *proxyCredential;
- @property(atomic, copy, GTM_NULLABLE) GTM_NSArrayOf(NSString *) *allowedInsecureSchemes;
- @property(atomic, assign) BOOL allowLocalhostRequest;
- @property(atomic, assign) BOOL allowInvalidServerCertificates;
- @property(atomic, assign, getter=isRetryEnabled) BOOL retryEnabled;
- @property(atomic, copy, GTM_NULLABLE) GTMSessionFetcherRetryBlock retryBlock;
- @property(atomic, assign) NSTimeInterval maxRetryInterval;
- @property(atomic, assign) NSTimeInterval minRetryInterval;
- @property(atomic, copy, GTM_NULLABLE) GTM_NSDictionaryOf(NSString *, id) *properties;
-
- #if GTM_BACKGROUND_TASK_FETCHING
- @property(atomic, assign) BOOL skipBackgroundTask;
- #endif
-
-
-
-
-
-
- @property(atomic, copy, GTM_NULLABLE) NSString *userAgent;
-
-
-
-
- @property(atomic, strong, GTM_NULLABLE) id<GTMFetcherAuthorizationProtocol> authorizer;
-
-
-
-
- @property(atomic, strong, GTM_NULL_RESETTABLE) NSOperationQueue *sessionDelegateQueue;
-
-
-
-
- @property(atomic, assign) BOOL reuseSession;
-
-
-
-
-
-
-
- @property(atomic, assign) NSTimeInterval unusedSessionTimeout;
-
-
-
- - (void)resetSession;
-
-
-
-
-
-
-
- - (GTMSessionFetcher *)fetcherWithRequest:(NSURLRequest *)request;
- - (GTMSessionFetcher *)fetcherWithURL:(NSURL *)requestURL;
- - (GTMSessionFetcher *)fetcherWithURLString:(NSString *)requestURLString;
-
-
-
-
-
-
- - (id)fetcherWithRequest:(NSURLRequest *)request
- fetcherClass:(Class)fetcherClass;
-
- - (BOOL)isDelayingFetcher:(GTMSessionFetcher *)fetcher;
-
- - (NSUInteger)numberOfFetchers;
- - (NSUInteger)numberOfRunningFetchers;
- - (NSUInteger)numberOfDelayedFetchers;
-
-
-
-
-
- - (GTM_NULLABLE GTM_NSArrayOf(GTMSessionFetcher *) *)issuedFetchers;
-
-
-
-
- - (GTM_NULLABLE GTM_NSArrayOf(GTMSessionFetcher *) *)issuedFetchersWithRequestURL:(NSURL *)requestURL;
-
- - (void)stopAllFetchers;
-
-
- - (GTM_NULLABLE NSURLSession *)session;
- - (GTM_NULLABLE NSURLSession *)sessionForFetcherCreation;
- - (GTM_NULLABLE id<NSURLSessionDelegate>)sessionDelegate;
- - (GTM_NULLABLE NSDate *)stoppedAllFetchersDate;
-
-
-
- @property(atomic, copy, GTM_NULLABLE) GTMSessionFetcherTestBlock testBlock;
-
- @end
-
- @interface GTMSessionFetcherService (TestingSupport)
-
-
-
-
-
-
-
-
-
-
-
- + (instancetype)mockFetcherServiceWithFakedData:(GTM_NULLABLE NSData *)fakedDataOrNil
- fakedError:(GTM_NULLABLE NSError *)fakedErrorOrNil;
- + (instancetype)mockFetcherServiceWithFakedData:(GTM_NULLABLE NSData *)fakedDataOrNil
- fakedResponse:(NSHTTPURLResponse *)fakedResponse
- fakedError:(GTM_NULLABLE NSError *)fakedErrorOrNil;
-
-
-
-
-
-
-
-
-
-
- - (BOOL)waitForCompletionOfAllFetchersWithTimeout:(NSTimeInterval)timeoutInSeconds;
-
- @end
-
- @interface GTMSessionFetcherService (BackwardsCompatibilityOnly)
-
-
-
- @property(atomic, assign) NSInteger cookieStorageMethod;
-
- @end
-
- GTM_ASSUME_NONNULL_END
|