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

Side by Side Diff: components/payments/android/payment_manifest_web_data_service.h

Issue 2838433002: [Payments] Cache payment manifests. (Closed)
Patch Set: address comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_PAYMENTS_ANDROID_PAYMENT_MANIFEST_WEB_DATA_SERVICE_H_
6 #define COMPONENTS_PAYMENTS_ANDROID_PAYMENT_MANIFEST_WEB_DATA_SERVICE_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "components/payments/android/payment_method_manifest_table.h"
10 #include "components/payments/android/web_app_manifest_section_table.h"
11 #include "components/webdata/common/web_data_results.h"
12 #include "components/webdata/common/web_data_service_base.h"
13 #include "components/webdata/common/web_data_service_consumer.h"
14 #include "components/webdata/common/web_database_service.h"
15
16 namespace payments {
17
18 // Web data service to read/write data in WebAppManifestSectionTable and
19 // PaymentMethodManifestTable.
20 class PaymentManifestWebDataService : public WebDataServiceBase {
21 public:
22 PaymentManifestWebDataService(
23 scoped_refptr<WebDatabaseService> wdbs,
24 const ProfileErrorCallback& callback,
25 const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread);
26
27 // Adds the web app |manifest|.
28 void AddPaymentWebAppManifest(
29 std::vector<mojom::WebAppManifestSectionPtr> manifest);
please use gerrit instead 2017/04/26 15:00:44 Good that you've removed const-ref here, because m
gogerald1 2017/04/26 17:30:31 Acknowledged.
30
31 // Adds the |payment_method|'s manifest.
32 void AddPaymentMethodManifest(const std::string& payment_method,
33 std::vector<std::string> apps_package_names);
please use gerrit instead 2017/04/26 15:00:44 Please use const-ref for apps_package_names, other
gogerald1 2017/04/26 17:30:31 There is no copy here since I used std::move when
34
35 // Gets the |web_app|'s manifest.
36 WebDataServiceBase::Handle GetPaymentWebAppManifest(
37 const std::string& web_app,
38 WebDataServiceConsumer* consumer);
39
40 // Gets the |payment_method|'s manifest.
41 WebDataServiceBase::Handle GetPaymentMethodManifest(
42 const std::string& payment_method,
43 WebDataServiceConsumer* consumer);
44
45 private:
46 ~PaymentManifestWebDataService() override;
47
48 WebDatabase::State AddPaymentWebAppManifestImpl(
49 const std::vector<mojom::WebAppManifestSectionPtr>& manifest,
50 WebDatabase* db);
51 WebDatabase::State AddPaymentMethodManifestImpl(
52 const std::string& payment_method,
53 const std::vector<std::string>& apps_package_names,
54 WebDatabase* db);
55
56 std::unique_ptr<WDTypedResult> GetPaymentWebAppManifestImpl(
57 const std::string& web_app,
58 WebDatabase* db);
59 std::unique_ptr<WDTypedResult> GetPaymentMethodManifestImpl(
60 const std::string& payment_method,
61 WebDatabase* db);
62
63 DISALLOW_COPY_AND_ASSIGN(PaymentManifestWebDataService);
64 };
65
66 } // namespace payments
67
68 #endif // COMPONENTS_PAYMENTS_ANDROID_PAYMENT_MANIFEST_WEB_DATA_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698