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

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

Issue 670183003: Update from chromium 62675d9fb31fb8cedc40f68e78e8445a74f362e7 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « net/android/network_library.h ('k') | net/base/net_util_posix.h » ('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/network_library.h" 5 #include "net/android/network_library.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Intentionally do not return 'ret', there is little the caller can 92 // Intentionally do not return 'ret', there is little the caller can
93 // do in case of failure (the CertInstaller itself will deal with 93 // do in case of failure (the CertInstaller itself will deal with
94 // incorrect data and display the appropriate toast). 94 // incorrect data and display the appropriate toast).
95 } 95 }
96 96
97 bool HaveOnlyLoopbackAddresses() { 97 bool HaveOnlyLoopbackAddresses() {
98 JNIEnv* env = AttachCurrentThread(); 98 JNIEnv* env = AttachCurrentThread();
99 return Java_AndroidNetworkLibrary_haveOnlyLoopbackAddresses(env); 99 return Java_AndroidNetworkLibrary_haveOnlyLoopbackAddresses(env);
100 } 100 }
101 101
102 std::string GetNetworkList() {
103 JNIEnv* env = AttachCurrentThread();
104 ScopedJavaLocalRef<jstring> ret =
105 Java_AndroidNetworkLibrary_getNetworkList(env);
106 return ConvertJavaStringToUTF8(ret);
107 }
108
109 bool GetMimeTypeFromExtension(const std::string& extension, 102 bool GetMimeTypeFromExtension(const std::string& extension,
110 std::string* result) { 103 std::string* result) {
111 JNIEnv* env = AttachCurrentThread(); 104 JNIEnv* env = AttachCurrentThread();
112 105
113 ScopedJavaLocalRef<jstring> extension_string = 106 ScopedJavaLocalRef<jstring> extension_string =
114 ConvertUTF8ToJavaString(env, extension); 107 ConvertUTF8ToJavaString(env, extension);
115 ScopedJavaLocalRef<jstring> ret = 108 ScopedJavaLocalRef<jstring> ret =
116 Java_AndroidNetworkLibrary_getMimeTypeFromExtension( 109 Java_AndroidNetworkLibrary_getMimeTypeFromExtension(
117 env, extension_string.obj()); 110 env, extension_string.obj());
118 111
(...skipping 16 matching lines...) Expand all
135 base::android::AttachCurrentThread(), 128 base::android::AttachCurrentThread(),
136 base::android::GetApplicationContext())); 129 base::android::GetApplicationContext()));
137 } 130 }
138 131
139 bool RegisterNetworkLibrary(JNIEnv* env) { 132 bool RegisterNetworkLibrary(JNIEnv* env) {
140 return RegisterNativesImpl(env); 133 return RegisterNativesImpl(env);
141 } 134 }
142 135
143 } // namespace android 136 } // namespace android
144 } // namespace net 137 } // namespace net
OLDNEW
« no previous file with comments | « net/android/network_library.h ('k') | net/base/net_util_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698