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

Side by Side Diff: net/android/gurl_utils.cc

Issue 2053413002: Roll base to ec59756cc1ad02cc835bcca10056a621c9eb346c. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « build/secondary/third_party/android_tools/BUILD.gn ('k') | net/cert/x509_util_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/android/gurl_utils.h" 5 #include "net/android/gurl_utils.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "jni/GURLUtils_jni.h" 8 #include "jni/GURLUtils_jni.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 jstring GetOrigin(JNIEnv* env, jclass clazz, jstring url) { 13 ScopedJavaLocalRef<jstring> GetOrigin(JNIEnv* env, jclass clazz, jstring url) {
14 GURL host(base::android::ConvertJavaStringToUTF16(env, url)); 14 GURL host(base::android::ConvertJavaStringToUTF16(env, url));
15 15
16 return base::android::ConvertUTF8ToJavaString(env, 16 return base::android::ConvertUTF8ToJavaString(env, host.GetOrigin().spec());
17 host.GetOrigin().spec()).Release();
18 } 17 }
19 18
20 jstring GetScheme(JNIEnv* env, jclass clazz, jstring url) { 19 ScopedJavaLocalRef<jstring> GetScheme(JNIEnv* env, jclass clazz, jstring url) {
21 GURL host(base::android::ConvertJavaStringToUTF16(env, url)); 20 GURL host(base::android::ConvertJavaStringToUTF16(env, url));
22 21
23 return base::android::ConvertUTF8ToJavaString(env, 22 return base::android::ConvertUTF8ToJavaString(env, host.scheme());
24 host.scheme()).Release();
25 } 23 }
26 24
27 bool RegisterGURLUtils(JNIEnv* env) { 25 bool RegisterGURLUtils(JNIEnv* env) {
28 return RegisterNativesImpl(env); 26 return RegisterNativesImpl(env);
29 } 27 }
30 28
31 } // net namespace 29 } // net namespace
OLDNEW
« no previous file with comments | « build/secondary/third_party/android_tools/BUILD.gn ('k') | net/cert/x509_util_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698