2611 rename fetch data (#2689)

* Replace fetch data with preload terminology
- Deprecate `-fetchData` and `-clearFetchedData` in favor of `-preload` and `-clearPreloadedData`
- Move `-setNeedsPreload`, `-recursivelyPreload` and `-recursivelyClearPreloadedData` to ASDisplayNode+FrameworkPrivate.h
- Update internal implementation, comments and tests

* Folllow up on #2642:
- Remove -preload and -clearPreloadedData in favor of -didEnterPreloadState and -didExitPreloadState.
- -didEnterPreloadState and -didExitPreloadState call the deprecated -fetchData and -clearFetchedData methods if they are overriden.

* Missed one in a test

* Get rid of behavior change for now.

* Revert more behavior changes, fix tests.

* Don't need these anymore.
This commit is contained in:
Garrett Moon
2016-12-01 13:41:22 -08:00
committed by Hannah Troisi
parent c7ea15a5e4
commit ba2268ac99
20 changed files with 151 additions and 167 deletions

View File

@@ -11,6 +11,7 @@
#import <AVFoundation/AVFoundation.h>
#import "ASDisplayNodeInternal.h"
#import "ASDisplayNode+Subclasses.h"
#import "ASDisplayNode+FrameworkPrivate.h"
#import "ASVideoNode.h"
#import "ASEqualityHelpers.h"
#import "ASInternalHelpers.h"
@@ -365,9 +366,9 @@ static NSString * const kRate = @"rate";
}
}
- (void)fetchData
- (void)didEnterPreloadState
{
[super fetchData];
[super didEnterPreloadState];
ASDN::MutexLocker l(__instanceLock__);
AVAsset *asset = self.asset;
@@ -405,9 +406,9 @@ static NSString * const kRate = @"rate";
}
}
- (void)clearFetchedData
- (void)didExitPreloadState
{
[super clearFetchedData];
[super didExitPreloadState];
{
ASDN::MutexLocker l(__instanceLock__);
@@ -505,10 +506,10 @@ static NSString * const kRate = @"rate";
- (void)_setAndFetchAsset:(AVAsset *)asset url:(NSURL *)assetURL
{
[self clearFetchedData];
[self didExitPreloadState];
_asset = asset;
_assetURL = assetURL;
[self setNeedsDataFetch];
[self setNeedsPreload];
}
- (void)setVideoComposition:(AVVideoComposition *)videoComposition
@@ -617,7 +618,7 @@ static NSString * const kRate = @"rate";
}
if (_player == nil) {
[self setNeedsDataFetch];
[self setNeedsPreload];
}
if (_playerNode == nil) {