Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef mozilla_dom_PaymentRequestChild_h
8 : #define mozilla_dom_PaymentRequestChild_h
9 :
10 : #include "mozilla/dom/PPaymentRequestChild.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 : class PaymentRequestChild final : public PPaymentRequestChild
16 : {
17 0 : NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PaymentRequestChild);
18 : public:
19 : PaymentRequestChild();
20 :
21 : void MaybeDelete();
22 :
23 : nsresult RequestPayment(const IPCPaymentActionRequest& aAction);
24 :
25 : protected:
26 : mozilla::ipc::IPCResult
27 : RecvRespondPayment(const IPCPaymentActionResponse& aResponse) override;
28 :
29 : mozilla::ipc::IPCResult
30 : RecvChangeShippingAddress(const nsString& aRequestId,
31 : const IPCPaymentAddress& aAddress) override;
32 :
33 : mozilla::ipc::IPCResult
34 : RecvChangeShippingOption(const nsString& aRequestId,
35 : const nsString& aOption) override;
36 :
37 : void ActorDestroy(ActorDestroyReason aWhy) override;
38 :
39 : private:
40 0 : ~PaymentRequestChild() = default;
41 :
42 : bool SendRequestPayment(const IPCPaymentActionRequest& aAction);
43 :
44 : bool mActorAlive;
45 : };
46 :
47 : } // end of namespace dom
48 : } // end of namespace mozilla
49 :
50 : #endif
|