feat: promisify dialog.showCertificateTrustDialog()#17181
Merged
Conversation
e0f6179 to
b25f303
Compare
b25f303 to
aff0bc2
Compare
| } | ||
|
|
||
| callback.Run(); | ||
| promise.Resolve(); |
Member
There was a problem hiding this comment.
Is this method is synchronous / blocking on windows? Might be worth documenting / possibly making async somehow 🤔
aff0bc2 to
defd7ae
Compare
zcbenz
reviewed
Mar 12, 2019
7fda78f to
1e042da
Compare
1e042da to
092b494
Compare
miniak
approved these changes
Mar 13, 2019
092b494 to
a80719a
Compare
zcbenz
approved these changes
Mar 14, 2019
| secPolicy:(SecPolicyRef)secPolicy { | ||
| if ((self = [super init])) { | ||
| callback_ = callback; | ||
| promise_.reset(new atom::util::Promise(std::move(promise))); |
Contributor
There was a problem hiding this comment.
There is no need keeping promise_ in a std::unique_ptr. It is only needed when the stored promise may be empty, but in this class since the promise is guaranteed to be always available, it can just be stored as normal value.
@interface TrustDelegate : NSObject {
@private
atom::util::Promise promise_;
}
promise_ = std::move(promise);
Contributor
There was a problem hiding this comment.
I just realized there is no constructor in objective-c classes so std::unique_ptr is the only way to go. This PR should be ready to go!
a80719a to
21a6f45
Compare
21a6f45 to
adfa72a
Compare
|
Release Notes Persisted
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of Change
Promisify
dialog.showCertificateTrustDialog().Checklist
npm testpassesRelease Notes
Notes: Converted
dialog.showCertificateTrustDialog()to return a Promise instead of taking a callback.