Skip to content

Commit

Permalink
Launches switching ASNetworkImageNode callbacks to global queue. (Tex…
Browse files Browse the repository at this point in the history
…tureGroup#1369)

* Launches switching ASNetworkImageNode callbacks to global queue.

* Good catch configuration tests!
  • Loading branch information
garrettmoon authored and hebertialmeida committed May 10, 2019
1 parent 1a2e397 commit 9d633d5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 24 deletions.
1 change: 0 additions & 1 deletion Schemas/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"exp_interface_state_coalesce",
"exp_unfair_lock",
"exp_infer_layer_defaults",
"exp_network_image_queue",
"exp_collection_teardown",
"exp_framesetter_cache",
"exp_skip_clear_data",
Expand Down
17 changes: 8 additions & 9 deletions Source/ASExperimentalFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) {
ASExperimentalInterfaceStateCoalescing = 1 << 2, // exp_interface_state_coalesce
ASExperimentalUnfairLock = 1 << 3, // exp_unfair_lock
ASExperimentalLayerDefaults = 1 << 4, // exp_infer_layer_defaults
ASExperimentalNetworkImageQueue = 1 << 5, // exp_network_image_queue
ASExperimentalCollectionTeardown = 1 << 6, // exp_collection_teardown
ASExperimentalFramesetterCache = 1 << 7, // exp_framesetter_cache
ASExperimentalSkipClearData = 1 << 8, // exp_skip_clear_data
ASExperimentalDidEnterPreloadSkipASMLayout = 1 << 9, // exp_did_enter_preload_skip_asm_layout
ASExperimentalDisableAccessibilityCache = 1 << 10, // exp_disable_a11y_cache
ASExperimentalSkipAccessibilityWait = 1 << 11, // exp_skip_a11y_wait
ASExperimentalNewDefaultCellLayoutMode = 1 << 12, // exp_new_default_cell_layout_mode
ASExperimentalDispatchApply = 1 << 13, // exp_dispatch_apply
ASExperimentalCollectionTeardown = 1 << 5, // exp_collection_teardown
ASExperimentalFramesetterCache = 1 << 6, // exp_framesetter_cache
ASExperimentalSkipClearData = 1 << 7, // exp_skip_clear_data
ASExperimentalDidEnterPreloadSkipASMLayout = 1 << 8, // exp_did_enter_preload_skip_asm_layout
ASExperimentalDisableAccessibilityCache = 1 << 9, // exp_disable_a11y_cache
ASExperimentalSkipAccessibilityWait = 1 << 10, // exp_skip_a11y_wait
ASExperimentalNewDefaultCellLayoutMode = 1 << 11, // exp_new_default_cell_layout_mode
ASExperimentalDispatchApply = 1 << 12, // exp_dispatch_apply
ASExperimentalFeatureAll = 0xFFFFFFFF
};

Expand Down
1 change: 0 additions & 1 deletion Source/ASExperimentalFeatures.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
@"exp_interface_state_coalesce",
@"exp_unfair_lock",
@"exp_infer_layer_defaults",
@"exp_network_image_queue",
@"exp_collection_teardown",
@"exp_framesetter_cache",
@"exp_skip_clear_data",
Expand Down
11 changes: 1 addition & 10 deletions Source/ASNetworkImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,7 @@ - (void)dealloc

- (dispatch_queue_t)callbackQueue
{
static dispatch_once_t onceToken;
static dispatch_queue_t callbackQueue;
dispatch_once(&onceToken, ^{
if (ASActivateExperimentalFeature(ASExperimentalNetworkImageQueue)) {
callbackQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
} else {
callbackQueue = dispatch_get_main_queue();
}
});
return callbackQueue;
return dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
}

#pragma mark - Public methods -- must lock
Expand Down
2 changes: 0 additions & 2 deletions Tests/ASConfigurationTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
ASExperimentalInterfaceStateCoalescing,
ASExperimentalUnfairLock,
ASExperimentalLayerDefaults,
ASExperimentalNetworkImageQueue,
ASExperimentalCollectionTeardown,
ASExperimentalFramesetterCache,
ASExperimentalSkipClearData,
Expand All @@ -49,7 +48,6 @@ + (NSArray *)names {
@"exp_interface_state_coalesce",
@"exp_unfair_lock",
@"exp_infer_layer_defaults",
@"exp_network_image_queue",
@"exp_collection_teardown",
@"exp_framesetter_cache",
@"exp_skip_clear_data",
Expand Down
1 change: 0 additions & 1 deletion Tests/ASNetworkImageNodeTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ @implementation ASTestImageCache

- (void)cachedImageWithURL:(NSURL *)URL callbackQueue:(dispatch_queue_t)callbackQueue completion:(ASImageCacherCompletion)completion
{
ASDisplayNodeAssert(callbackQueue == dispatch_get_main_queue(), @"ASTestImageCache expects main queue for callback.");
completion(nil);
}

Expand Down

0 comments on commit 9d633d5

Please sign in to comment.