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

Unified Diff: chrome/browser/android/customtabs/origin_verifier.h

Issue 2767333006: Add Digital Asset Links verification for postMessage API (Closed)
Patch Set: fix hex conversion logic Created 3 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
Index: chrome/browser/android/customtabs/origin_verifier.h
diff --git a/chrome/browser/android/customtabs/origin_verifier.h b/chrome/browser/android/customtabs/origin_verifier.h
new file mode 100644
index 0000000000000000000000000000000000000000..22d283b5577294190c48a23c02f899e3a6e79b2c
--- /dev/null
+++ b/chrome/browser/android/customtabs/origin_verifier.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2017 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.
+
+#ifndef CHROME_BROWSER_ANDROID_CUSTOMTABS_ORIGIN_VERIFIER_H_
+#define CHROME_BROWSER_ANDROID_CUSTOMTABS_ORIGIN_VERIFIER_H_
+
+#include "base/android/jni_weak_ref.h"
+#include "chrome/browser/android/digital_asset_links/digital_asset_links_handler.h"
+#include "net/url_request/url_fetcher.h"
+#include "net/url_request/url_fetcher_delegate.h"
+#include "net/url_request/url_request_context_getter.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace customtabs {
+
+class OriginVerifier {
+ public:
+ OriginVerifier(JNIEnv* env, jobject obj);
+ ~OriginVerifier();
+
+ void VerifyOrigin(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ const base::android::JavaParamRef<jstring>& j_package_name,
+ const base::android::JavaParamRef<jstring>& j_fingerprint,
+ const base::android::JavaParamRef<jstring>& j_origin);
+ void Destroy(JNIEnv* env, const base::android::JavaRef<jobject>& obj);
+
+ void OnRelationshipCheckComplete(
+ std::unique_ptr<base::DictionaryValue> response);
+
+ private:
+ std::unique_ptr<digital_asset_links::DigitalAssetLinksHandler>
+ asset_link_handler_;
+
+ base::android::ScopedJavaGlobalRef<jobject> jobject_;
+
+ DISALLOW_COPY_AND_ASSIGN(OriginVerifier);
+};
+
+bool RegisterOriginVerifier(JNIEnv* env);
+} // namespace customtabs
+
+#endif // CHROME_BROWSER_ANDROID_CUSTOMTABS_ORIGIN_VERIFIER_H_

Powered by Google App Engine
This is Rietveld 408576698