Repository navigation
feat: promisify dialog.showCertificateTrustDialog() - #17181
Merged
Merged
Conversation
codebytere
force-pushed
the
promisify-showcerttrust
branch
from
March 8, 2019 17:23
e0f6179 to
b25f303
Compare
codebytere
marked this pull request as ready for review
March 8, 2019 17:23
codebytere
force-pushed
the
promisify-showcerttrust
branch
from
March 8, 2019 18:45
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 🤔
codebytere
force-pushed
the
promisify-showcerttrust
branch
from
March 11, 2019 20:33
aff0bc2 to
defd7ae
Compare
zcbenz
reviewed
Mar 12, 2019
codebytere
force-pushed
the
promisify-showcerttrust
branch
3 times, most recently
from
March 12, 2019 18:08
7fda78f to
1e042da
Compare
codebytere
force-pushed
the
promisify-showcerttrust
branch
from
March 12, 2019 21:11
1e042da to
092b494
Compare
miniak
approved these changes
Mar 13, 2019
codebytere
force-pushed
the
promisify-showcerttrust
branch
from
March 13, 2019 20:47
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!
codebytere
force-pushed
the
promisify-showcerttrust
branch
from
March 14, 2019 19:10
a80719a to
21a6f45
Compare
codebytere
force-pushed
the
promisify-showcerttrust
branch
from
March 14, 2019 20:32
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.