[WebLayer] Simplify PRService's init logic
Context: This CL is to simplify the PRService's init logic and the dependency relationship. Before the CL, * PRService creates MojoPRGateKeeper (in a static method) and MojoPRGateKeeper creates PRService (constructor). It formed a circular dependency loop. * PRService's init procedure is over complicated as it includes multiple similar methods which confused code readers as to where to put certain validation codes. The init procedure includes: - createPaymentRequest - createIfParamsValid - PaymentRequestService's constructor - initAndValidate After the CL, * CPRFactory & WLPRFactory creates MojoPRGateKeeper, and MojoPRGateKeeper creates PRService. PaymentRequestService delegates CPRFactory/WLPRFactory to create CPRServic/WLPRService. The dependency relationship becomes more clear. * PRService's init procedure get simplified, as it includes: - PaymentRequestService's constructor - init - initAndValidate (will be combined into init in follow-up CL) Bug: 1157847 Change-Id: I083e0e162085e27736577d433caf952c59592207 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2592190Reviewed-by:Rouslan Solomakhin <rouslan@chromium.org> Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org> Cr-Commit-Position: refs/heads/master@{#837184}
Showing
This diff is collapsed.
Please register or sign in to comment