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

Unified Diff: ios/chrome/browser/payments/js_payment_request_manager.mm

Issue 2632463003: Add a timeout if the page doesn't call complete() in a timely fashion. (Closed)
Patch Set: Fix comment. 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
Index: ios/chrome/browser/payments/js_payment_request_manager.mm
diff --git a/ios/chrome/browser/payments/js_payment_request_manager.mm b/ios/chrome/browser/payments/js_payment_request_manager.mm
index 83d0ce0b5437f19c19a9fa42cab5d05f2115ff6f..ca70a47559e3027d25a51c81376fc0446db51a5a 100644
--- a/ios/chrome/browser/payments/js_payment_request_manager.mm
+++ b/ios/chrome/browser/payments/js_payment_request_manager.mm
@@ -6,7 +6,6 @@
#include "base/json/json_writer.h"
#include "base/json/string_escape.h"
-#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
#include "ios/web/public/payments/payment_request.h"
@@ -34,6 +33,10 @@ NSString* JSONEscape(NSString* JSON) {
@implementation JSPaymentRequestManager
+- (void)executeNoop {
+ [self executeScript:@"Function.prototype()" completionHandler:nil];
+}
+
- (void)resolveRequestPromise:(const web::PaymentResponse&)paymentResponse
completionHandler:(void (^)(BOOL))completionHandler {
std::unique_ptr<base::DictionaryValue> paymentResponseData =
@@ -62,15 +65,6 @@ NSString* JSONEscape(NSString* JSON) {
[self executeScript:script completionHandler:completionHandler];
}
-- (void)rejectResponsePromise:(NSString*)errorMessage
- completionHandler:(void (^)(BOOL))completionHandler {
- NSString* script = [NSString
- stringWithFormat:
- @"__gCrWeb['paymentRequestManager'].pendingResponse.reject(%@)",
- JSONEscape(errorMessage)];
- [self executeScript:script completionHandler:completionHandler];
-}
-
- (void)executeScript:(NSString*)script
completionHandler:(void (^)(BOOL))completionHandler {
[self executeJavaScript:script
« no previous file with comments | « ios/chrome/browser/payments/js_payment_request_manager.h ('k') | ios/chrome/browser/payments/payment_request_manager.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698