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

Side by Side Diff: chrome/browser/android/customtabs/origin_verifier.h

Issue 2767333006: Add Digital Asset Links verification for postMessage API (Closed)
Patch Set: destructor Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_CUSTOMTABS_ORIGIN_VERIFIER_H_
6 #define CHROME_BROWSER_ANDROID_CUSTOMTABS_ORIGIN_VERIFIER_H_
7
8 #include "base/android/scoped_java_ref.h"
9 #include "net/url_request/url_fetcher.h"
10 #include "net/url_request/url_fetcher_delegate.h"
11 #include "net/url_request/url_request_context_getter.h"
12
13 namespace base {
14 class DictionaryValue;
15 }
16
17 namespace digital_asset_links {
18 class DigitalAssetLinksHandler;
19 }
20
21 namespace customtabs {
22
23 // JNI bridge for OriginVerifier.java
24 class OriginVerifier {
25 public:
26 OriginVerifier(JNIEnv* env, jobject obj, jobject jprofile);
27 ~OriginVerifier();
28
29 // Verify origin with the given parameters. No network requests can be made
30 // if the params are null.
31 bool VerifyOrigin(JNIEnv* env,
32 const base::android::JavaParamRef<jobject>& obj,
33 const base::android::JavaParamRef<jstring>& j_package_name,
34 const base::android::JavaParamRef<jstring>& j_fingerprint,
35 const base::android::JavaParamRef<jstring>& j_origin);
36
37 void Destroy(JNIEnv* env, const base::android::JavaRef<jobject>& obj);
38
39 private:
40 void OnRelationshipCheckComplete(
41 std::unique_ptr<base::DictionaryValue> response);
42
43 std::unique_ptr<digital_asset_links::DigitalAssetLinksHandler>
44 asset_link_handler_;
45
46 base::android::ScopedJavaGlobalRef<jobject> jobject_;
47
48 DISALLOW_COPY_AND_ASSIGN(OriginVerifier);
49 };
50
51 bool RegisterOriginVerifier(JNIEnv* env);
52 } // namespace customtabs
53
54 #endif // CHROME_BROWSER_ANDROID_CUSTOMTABS_ORIGIN_VERIFIER_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/customtabs/OWNERS ('k') | chrome/browser/android/customtabs/origin_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698