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

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

Issue 2541663003: Remove [ConstructorCallWith=ScriptState] from Payments (Closed)
Patch Set: temp Created 4 years 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: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
index 239a7a141f3943039499fae90d7a3a1cc29a8151..e718699da61ac9fdd37b3b0d12078c1d5797ac08 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -496,21 +496,21 @@ bool allowedToUsePaymentRequest(const Frame* frame) {
} // namespace
PaymentRequest* PaymentRequest::create(
- ScriptState* scriptState,
+ Document& document,
const HeapVector<PaymentMethodData>& methodData,
const PaymentDetails& details,
ExceptionState& exceptionState) {
- return new PaymentRequest(scriptState, methodData, details, PaymentOptions(),
+ return new PaymentRequest(document, methodData, details, PaymentOptions(),
exceptionState);
}
PaymentRequest* PaymentRequest::create(
- ScriptState* scriptState,
+ Document& document,
const HeapVector<PaymentMethodData>& methodData,
const PaymentDetails& details,
const PaymentOptions& options,
ExceptionState& exceptionState) {
- return new PaymentRequest(scriptState, methodData, details, options,
+ return new PaymentRequest(document, methodData, details, options,
exceptionState);
}
@@ -663,12 +663,12 @@ void PaymentRequest::onCompleteTimeoutForTesting() {
onCompleteTimeout(0);
}
-PaymentRequest::PaymentRequest(ScriptState* scriptState,
+PaymentRequest::PaymentRequest(Document& document,
const HeapVector<PaymentMethodData>& methodData,
const PaymentDetails& details,
const PaymentOptions& options,
ExceptionState& exceptionState)
- : ContextLifecycleObserver(scriptState->getExecutionContext()),
+ : ContextLifecycleObserver(&document),
ActiveScriptWrappable(this),
m_options(options),
m_clientBinding(this),
@@ -679,12 +679,12 @@ PaymentRequest::PaymentRequest(ScriptState* scriptState,
if (exceptionState.hadException())
return;
- if (!scriptState->getExecutionContext()->isSecureContext()) {
+ if (!document.isSecureContext()) {
exceptionState.throwSecurityError("Must be in a secure context");
return;
}
- if (!allowedToUsePaymentRequest(scriptState->domWindow()->frame())) {
+ if (!allowedToUsePaymentRequest(document.frame())) {
exceptionState.throwSecurityError(
RuntimeEnabledFeatures::paymentRequestIFrameEnabled()
? "Must be in a top-level browsing context or an iframe needs to "
@@ -709,7 +709,7 @@ PaymentRequest::PaymentRequest(ScriptState* scriptState,
if (m_options.requestShipping())
m_shippingType = getValidShippingType(m_options.shippingType());
- scriptState->domWindow()->frame()->interfaceProvider()->getInterface(
+ document.frame()->interfaceProvider()->getInterface(
mojo::GetProxy(&m_paymentProvider));
m_paymentProvider.set_connection_error_handler(convertToBaseCallback(
WTF::bind(&PaymentRequest::OnError, wrapWeakPersistent(this),

Powered by Google App Engine
This is Rietveld 408576698