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

Unified Diff: components/payments/android/payment_manifest_web_data_service.cc

Issue 2845753003: [Payments] Set cached manifest expiration date (Closed)
Patch Set: address comments Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/payments/android/payment_manifest_web_data_service.cc
diff --git a/components/payments/android/payment_manifest_web_data_service.cc b/components/payments/android/payment_manifest_web_data_service.cc
index 3646ab5f0712b8e0b66b471837092a04722db79e..b217c3d0e3373d062b630b68ac1d6b52f744d34d 100644
--- a/components/payments/android/payment_manifest_web_data_service.cc
+++ b/components/payments/android/payment_manifest_web_data_service.cc
@@ -72,6 +72,7 @@ std::unique_ptr<WDTypedResult>
PaymentManifestWebDataService::GetPaymentWebAppManifestImpl(
const std::string& web_app,
WebDatabase* db) {
+ RemoveExpiredData(db);
return base::MakeUnique<
WDResult<std::vector<mojom::WebAppManifestSectionPtr>>>(
PAYMENT_WEB_APP_MANIFEST,
@@ -94,10 +95,16 @@ std::unique_ptr<WDTypedResult>
PaymentManifestWebDataService::GetPaymentMethodManifestImpl(
const std::string& payment_method,
WebDatabase* db) {
+ RemoveExpiredData(db);
return base::MakeUnique<WDResult<std::vector<std::string>>>(
PAYMENT_METHOD_MANIFEST,
PaymentMethodManifestTable::FromWebDatabase(db)->GetManifest(
payment_method));
}
+void PaymentManifestWebDataService::RemoveExpiredData(WebDatabase* db) {
+ PaymentMethodManifestTable::FromWebDatabase(db)->RemoveExpiredData();
+ WebAppManifestSectionTable::FromWebDatabase(db)->RemoveExpiredData();
+}
+
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698