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

Unified Diff: components/payments/android/payments_jni_registrar.cc

Issue 2645813006: Download web payment manifests. (Closed)
Patch Set: WIP Downloader tests - do not review 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: components/payments/android/payments_jni_registrar.cc
diff --git a/components/payments/android/payments_jni_registrar.cc b/components/payments/android/payments_jni_registrar.cc
deleted file mode 100644
index 1a80ed181a58b907566385b8b9ac352388ebacbe..0000000000000000000000000000000000000000
--- a/components/payments/android/payments_jni_registrar.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/payments/android/payments_jni_registrar.h"
-
-#include <string>
-#include <utility>
-
-#include "components/payments/payment_details_validation.h"
-#include "components/payments/payment_request.mojom.h"
-#include "jni/PaymentValidator_jni.h"
-
-namespace payments {
-
-jboolean ValidatePaymentDetails(
- JNIEnv* env,
- const base::android::JavaParamRef<jclass>& jcaller,
- const base::android::JavaParamRef<jobject>& buffer) {
- jbyte* buf_in = static_cast<jbyte*>(env->GetDirectBufferAddress(buffer));
- jlong buf_size = env->GetDirectBufferCapacity(buffer);
- std::vector<uint8_t> mojo_buffer(buf_size);
- memcpy(&mojo_buffer[0], buf_in, buf_size);
- mojom::PaymentDetailsPtr details;
- if (!mojom::PaymentDetails::Deserialize(std::move(mojo_buffer), &details))
- return false;
- std::string unused_error_message;
- return payments::validatePaymentDetails(details, &unused_error_message);
-}
-
-} // namespace payments
-
-bool RegisterPaymentValidator(JNIEnv* env) {
- return payments::RegisterNativesImpl(env);
-}

Powered by Google App Engine
This is Rietveld 408576698