[PRImpl] PaymentRequestImpl retains the values it needs
Context: CL[1] moved some PRImpl's parameters it needed into CPRImpl, and retrieved them from CPRImpl when PRImpl needs it. This is problematic, because PRImpl could outlive CPRImpl, and so doing it could cause NullPointerError (see the bug). This CL partially reverts CL[1] but keeps the changes of the constructor signature because this is more succinct than passing each one of the parameters. Since CPRImpl would take over the PRImpl logic going forwards, passing only CPRImpl would avoid the frequent change of the PRImpl constructor's signature. [1] https://chromium-review.googlesource.com/c/chromium/src/+/2357630 Change: * Before: CPRImpl retains the values that PRImpl need; after: PRImpl keeps a reference of the value that itself needs * Added a few null check or assert for mComponentPaymentRequestImpl in case it's used after release. Bug: 1122148 Change-Id: I00ac6e4ca3fccccd114132209465757f52fa0dc9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2378538Reviewed-by:Danyao Wang <danyao@chromium.org> Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org> Cr-Commit-Position: refs/heads/master@{#803902}
Showing
Please register or sign in to comment