Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Issue 2609103002: PaymentApp: Add PaymentAppProvider class. (Closed)

Created:
3 years, 11 months ago by zino
Modified:
3 years, 11 months ago
CC:
chromium-reviews, jam, wjmaclean, darin-cc_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PaymentApp: Add PaymentAppProvider class. The purpose of this class is to expose the following APIs to the chrome layer: - GetAllManifests(): query all stored payment app manifests. - InvokePaymentApp(): activate service worker and dispatch a payment event. This has several advantages. First, the role of each class will be clearer. After this patch, each role is as follows: - PaymentAppProvider: Expose the APIs for use in chrome layer. - PaymentAppContext: Manage requests coming from Blink and Chrome (PaymentAppManager and PaymentAppProvider) to store/query manifest data. - PaymentAppDatabase: It's owned by PaymentAppContext. Write or read the manifest data of payment app to associated service worker DB. Second, no longer consider to query each storage partition iteratively in the chrome layer. So, we can share the logic in all implementation. (e.g. android and desktop in chrome layer) This patch modified many files, but it can be summarized as follows: - Write a PaymentAppProvider class as singleton. - Move GetAllManifests() method from PaymentAppContext to PaymentAppProvider. - Move the logic that queries the manifest data from the payment app context per storage partition, from the chrome layer to content layer. - Rename payment_app_context_impl_unittest.cc with payment_app_provider_impl_unittest.cc BUG=661608 TEST=payment_app_provider_impl_unittest.cc Review-Url: https://codereview.chromium.org/2609103002 Cr-Commit-Position: refs/heads/master@{#441639} Committed: https://chromium.googlesource.com/chromium/src/+/ac34b3a3ff3cbe7b56d7e5b840eccf1efcb7ff2e

Patch Set 1 #

Patch Set 2 : fix the test #

Patch Set 3 : app_bridge.cc #

Patch Set 4 : fix bot error #

Patch Set 5 : PaymentApp: Add PaymentAppProvider class. #

Patch Set 6 : PaymentApp: Add PaymentAppProvider class. #

Total comments: 13

Patch Set 7 : addressed rouslan's comment #

Patch Set 8 : Remove override keyword #

Unified diffs Side-by-side diffs Delta from patch set Stats (+201 lines, -225 lines) Patch
M chrome/browser/android/payments/service_worker_payment_app_bridge.cc View 1 2 3 4 3 chunks +7 lines, -13 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover_unittest.cc View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/payments/payment_app_content_unittest_base.h View 1 2 3 4 5 6 3 chunks +5 lines, -5 lines 0 comments Download
M content/browser/payments/payment_app_content_unittest_base.cc View 1 2 3 4 5 6 4 chunks +21 lines, -16 lines 0 comments Download
M content/browser/payments/payment_app_context_impl.h View 7 4 chunks +2 lines, -12 lines 0 comments Download
M content/browser/payments/payment_app_context_impl.cc View 2 chunks +0 lines, -25 lines 0 comments Download
D content/browser/payments/payment_app_context_impl_unittest.cc View 1 chunk +0 lines, -104 lines 0 comments Download
A content/browser/payments/payment_app_provider_impl.h View 1 1 chunk +40 lines, -0 lines 0 comments Download
A content/browser/payments/payment_app_provider_impl.cc View 1 2 3 4 5 6 1 chunk +64 lines, -0 lines 0 comments Download
A + content/browser/payments/payment_app_provider_impl_unittest.cc View 1 4 chunks +12 lines, -12 lines 0 comments Download
M content/browser/storage_partition_impl.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
D content/public/browser/payment_app_context.h View 1 chunk +0 lines, -31 lines 0 comments Download
A content/public/browser/payment_app_provider.h View 1 2 3 4 5 6 1 chunk +45 lines, -0 lines 0 comments Download
M content/public/browser/storage_partition.h View 2 chunks +0 lines, -2 lines 0 comments Download
M content/test/BUILD.gn View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 46 (33 generated)
zino
PTAL rouslan@, tommyt@ for payments avi@ for content directory files. dfalcantara@ for chrome files.
3 years, 11 months ago (2017-01-04 16:05:43 UTC) #17
please use gerrit instead
https://codereview.chromium.org/2609103002/diff/100001/content/browser/payments/payment_app_content_unittest_base.h File content/browser/payments/payment_app_content_unittest_base.h (right): https://codereview.chromium.org/2609103002/diff/100001/content/browser/payments/payment_app_content_unittest_base.h#newcode47 content/browser/payments/payment_app_content_unittest_base.h:47: StoragePartitionImpl* storage_partition_impl_; Here and below: Raw pointers lead to ...
3 years, 11 months ago (2017-01-04 16:55:44 UTC) #20
zino
Thank you for review! https://codereview.chromium.org/2609103002/diff/100001/content/browser/payments/payment_app_content_unittest_base.h File content/browser/payments/payment_app_content_unittest_base.h (right): https://codereview.chromium.org/2609103002/diff/100001/content/browser/payments/payment_app_content_unittest_base.h#newcode47 content/browser/payments/payment_app_content_unittest_base.h:47: StoragePartitionImpl* storage_partition_impl_; On 2017/01/04 16:55:43, ...
3 years, 11 months ago (2017-01-04 17:30:00 UTC) #21
zino
+ Bernhard Bauer for chrome/browser/browsing_data/browsing_data_remover_unittest.cc (dfalcantara@ is not owner in the directory. :-) )
3 years, 11 months ago (2017-01-04 17:34:40 UTC) #23
please use gerrit instead
lgtm
3 years, 11 months ago (2017-01-04 18:03:28 UTC) #24
Avi (use Gerrit)
lgtm
3 years, 11 months ago (2017-01-04 19:20:11 UTC) #25
gone
chrome/ lgtm
3 years, 11 months ago (2017-01-04 19:58:43 UTC) #26
zino
rouslan@ I removed 'override' keyword in PaymentAppContextImpl class. There was no virtual destructor in parent ...
3 years, 11 months ago (2017-01-05 00:08:04 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2609103002/140001
3 years, 11 months ago (2017-01-05 02:50:01 UTC) #38
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/335223)
3 years, 11 months ago (2017-01-05 02:56:57 UTC) #40
Bernhard Bauer
browsing_data LGTM.
3 years, 11 months ago (2017-01-05 09:26:24 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2609103002/140001
3 years, 11 months ago (2017-01-05 12:26:11 UTC) #43
commit-bot: I haz the power
3 years, 11 months ago (2017-01-05 12:51:59 UTC) #46
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/ac34b3a3ff3cbe7b56d7e5b840ec...

Powered by Google App Engine
This is Rietveld 408576698