forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PRImpl] Gate-keeping the mojo PaymentRequest untrusted calls.
Change logic: * The untrusted PaymentRequest interface breaks apart from CPRImpl to become MojoPaymentRequestGateKeeper. The new class would be responsible for handling the untrusted mojo calls from the renderer. Doing that, it can ensure that CPRImpl receives no invalid calls from the renderer. * Establish the requirements for the users of CPRImpl that the CPRImpl instances should be set null after BPRImpl#close, CPRImpl#teardown and PRClient#close. For example, CPRImpl#OnClosedListener is provided for the callers to nullify the instances. Note that: * Although MPRGateKeeper and CPRImpl both have plumbings to pass PR calls, they are necessary, because going forwards, PRImpl will be diminished, and eventually the plumbings would only exist between MPRGateKeeper and CPRImpl. Code change highlights: * In CPRImpl#initAndValidate(), null-check the request's raw data before passing them into BPR, so that BPR doesn't need to add @nullable for them. * In MPRGateKeeper#init, discards CPRImpl (and its PRClient, BPR) when the raw data are invalid. * MPRGateKeeper plumbs the PR calls to CPRImpl, so that the calls are only passed to the CPRImpl when the PaymentRequest data are valid. Acronym: CPRImpl = ComponentPaymentRequestImpl BPR = BrowserPaymentRequest PRClient = PaymentRequestClient MPRGateKeeper = MojoPaymentRequestGateKeeper Bug: 1102522 Change-Id: Iab160b2c3e74608b9b19ba17e454dedf32411193 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346730 Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org> Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org> Reviewed-by: Danyao Wang <danyao@chromium.org> Cr-Commit-Position: refs/heads/master@{#797780}
- Loading branch information
Showing
6 changed files
with
350 additions
and
104 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.