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

Unified Diff: components/payments/payment_request.h

Issue 2611253004: [Payment Request] Change the lifetime management of PaymentRequestImpl (Closed)
Patch Set: PaymentRequestImpl -> PaymentRequest Created 3 years, 11 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
« no previous file with comments | « components/payments/DEPS ('k') | components/payments/payment_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/payment_request.h
diff --git a/chrome/browser/payments/payment_request_impl.h b/components/payments/payment_request.h
similarity index 69%
rename from chrome/browser/payments/payment_request_impl.h
rename to components/payments/payment_request.h
index d87d8bee3ec6c8b6875ebe07b8b7b12334f2d246..cbd0e246ab9d79a501faffb3ef718c34844a093b 100644
--- a/chrome/browser/payments/payment_request_impl.h
+++ b/components/payments/payment_request.h
@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_IMPL_H_
-#define CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_IMPL_H_
+#ifndef COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_
+#define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_
+
+#include <memory>
#include "components/payments/payment_request.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
@@ -14,12 +16,17 @@ class WebContents;
namespace payments {
-class PaymentRequestImpl : payments::mojom::PaymentRequest,
- public base::RefCounted<PaymentRequestImpl> {
+class PaymentRequestDelegate;
+class PaymentRequestWebContentsManager;
+
+class PaymentRequest : payments::mojom::PaymentRequest {
public:
- PaymentRequestImpl(
+ PaymentRequest(
content::WebContents* web_contents,
+ std::unique_ptr<PaymentRequestDelegate> delegate,
+ PaymentRequestWebContentsManager* manager,
mojo::InterfaceRequest<payments::mojom::PaymentRequest> request);
+ ~PaymentRequest() override;
// payments::mojom::PaymentRequest "stub"
void Init(payments::mojom::PaymentRequestClientPtr client,
@@ -39,21 +46,17 @@ class PaymentRequestImpl : payments::mojom::PaymentRequest,
content::WebContents* web_contents() { return web_contents_; }
private:
- friend class base::RefCounted<PaymentRequestImpl>;
- ~PaymentRequestImpl() override;
-
content::WebContents* web_contents_;
+ std::unique_ptr<PaymentRequestDelegate> delegate_;
+ // |manager_| owns this PaymentRequest.
+ PaymentRequestWebContentsManager* manager_;
mojo::Binding<payments::mojom::PaymentRequest> binding_;
payments::mojom::PaymentRequestClientPtr client_;
payments::mojom::PaymentDetailsPtr details_;
- DISALLOW_COPY_AND_ASSIGN(PaymentRequestImpl);
+ DISALLOW_COPY_AND_ASSIGN(PaymentRequest);
};
} // namespace payments
-void CreatePaymentRequestHandler(
- content::WebContents* web_contents,
- mojo::InterfaceRequest<payments::mojom::PaymentRequest> request);
-
-#endif // CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_IMPL_H_
+#endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_
« no previous file with comments | « components/payments/DEPS ('k') | components/payments/payment_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698