xref: /aosp_15_r20/external/cronet/url/android/gurl_android.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2019 The Chromium Authors
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 URL_ANDROID_GURL_ANDROID_H_
6 #define URL_ANDROID_GURL_ANDROID_H_
7 
8 #include "base/component_export.h"
9 #include "base/containers/span.h"
10 #include "third_party/jni_zero/jni_zero.h"
11 #include "url/gurl.h"
12 
13 namespace url {
14 
COMPONENT_EXPORT(URL)15 class COMPONENT_EXPORT(URL) GURLAndroid {
16  public:
17   static GURL ToNativeGURL(JNIEnv* env,
18                            const jni_zero::JavaRef<jobject>& j_gurl);
19   static jni_zero::ScopedJavaLocalRef<jobject> FromNativeGURL(JNIEnv* env,
20                                                               const GURL& gurl);
21   static jni_zero::ScopedJavaLocalRef<jobject> EmptyGURL(JNIEnv* env);
22 };
23 
24 }  // namespace url
25 
26 #endif  // URL_ANDROID_GURL_ANDROID_H_
27