This repository was archived by the owner on Feb 22, 2023. It is now read-only.
[camera]remove QueueHelper class#4983
Merged
fluttergithubbot merged 1 commit intoflutter:mainfrom Mar 7, 2022
Merged
Conversation
af203f4 to
20d5fa6
Compare
jmagman
reviewed
Mar 3, 2022
jmagman
reviewed
Mar 4, 2022
| - (void)setStreamHandler:(NSObject<FlutterStreamHandler> *)handler | ||
| completion:(void (^)(void))completion { | ||
| FLTEnsureToRunOnMainQueue(^{ | ||
| dispatch_block_t block = ^{ |
Member
There was a problem hiding this comment.
I can see why you found this pattern tedious, Objective-C needs so much boilerplate to do something trivial:
if (!NSThread.isMainThread) {
[NSOperationQueue.mainQueue addOperationWithBlock:^{
[self setStreamHandler:handler completion:completion];
}];
return;
}
[self.channel setStreamHandler:handler];
completion();or
void (^block)(void) = ^{ // or typedef
[self.channel setStreamHandler:handler];
completion();
};
if (NSThread.isMainThread) {
block();
} else {
[NSOperationQueue.mainQueue addOperationWithBlock:block];
}I guess the utility function was better... 😞
Contributor
Author
There was a problem hiding this comment.
reverted to the original commit
cyanglaz
reviewed
Mar 4, 2022
Contributor
cyanglaz
left a comment
There was a problem hiding this comment.
What was the motivation to do this? I thought the existing code was cleaner?
e2b4157 to
20d5fa6
Compare
Contributor
Author
jmagman
approved these changes
Mar 4, 2022
cyanglaz
approved these changes
Mar 7, 2022
|
|
||
| /// A class that contains dispatch queue related helper functions. | ||
| @interface QueueHelper : NSObject | ||
| extern const char* FLTCaptureSessionQueueSpecific; |
Contributor
Author
There was a problem hiding this comment.
Yep. This is used to verify if an operation is on capture session queue.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Mar 8, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes QueueHelper class and use function instead.
Also renamed file to
QueueUtilsto be consistent withCameraTestUtilsList which issues are fixed by this PR. You must list at least one issue.
NA
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
No version change: just minor code cleanup.
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.