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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.h

Issue 1863053005: PaymentRequest should be a ContextLifecycleObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@frame-service
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/payments/PaymentRequest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/payments/PaymentRequest.h
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.h b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
index 3d6647d4334fe4ee138d9f4b8cc4454353f52dc6..400eea39206d235ac67c9617f2748393f6251aa0 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.h
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
@@ -8,6 +8,7 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptValue.h"
#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/dom/ContextLifecycleObserver.h"
#include "core/events/EventTarget.h"
#include "modules/ModulesExport.h"
#include "modules/payments/PaymentCompleter.h"
@@ -29,7 +30,7 @@ class ScriptPromiseResolver;
class ScriptState;
class ShippingAddress;
-class MODULES_EXPORT PaymentRequest final : public RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest>, WTF_NON_EXPORTED_BASE(public mojom::wtf::PaymentRequestClient), public PaymentCompleter {
+class MODULES_EXPORT PaymentRequest final : public RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest>, WTF_NON_EXPORTED_BASE(public mojom::wtf::PaymentRequestClient), public PaymentCompleter, public ContextLifecycleObserver {
DEFINE_WRAPPERTYPEINFO();
REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PaymentRequest);
USING_GARBAGE_COLLECTED_MIXIN(PaymentRequest)
@@ -55,14 +56,17 @@ public:
const AtomicString& interfaceName() const override;
ExecutionContext* getExecutionContext() const override;
- // PaymentCompleter:
- ScriptPromise complete(ScriptState*, bool success) override;
-
DECLARE_TRACE();
private:
PaymentRequest(ScriptState*, const Vector<String>& supportedMethods, const PaymentDetails&, const PaymentOptions&, const ScriptValue& data, ExceptionState&);
+ // PaymentCompleter:
+ ScriptPromise complete(ScriptState*, bool success) override;
+
+ // LifecycleObserver:
+ void contextDestroyed() override;
+
// mojom::wtf::PaymentRequestClient:
void OnShippingAddressChange(mojom::wtf::ShippingAddressPtr) override;
void OnShippingOptionChange(const String& shippingOptionId) override;
@@ -73,7 +77,6 @@ private:
// Clears the promise resolvers and closes the Mojo connection.
void cleanUp();
- RefPtr<ScriptState> m_scriptState;
Vector<String> m_supportedMethods;
PaymentDetails m_details;
PaymentOptions m_options;
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/payments/PaymentRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698