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

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

Issue 10911244: Have a clearer error message for Android's GetMimeTypeFromExtension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 std::string* result) { 80 std::string* result) {
81 JNIEnv* env = AttachCurrentThread(); 81 JNIEnv* env = AttachCurrentThread();
82 82
83 ScopedJavaLocalRef<jstring> extension_string = 83 ScopedJavaLocalRef<jstring> extension_string =
84 ConvertUTF8ToJavaString(env, extension); 84 ConvertUTF8ToJavaString(env, extension);
85 ScopedJavaLocalRef<jstring> ret = 85 ScopedJavaLocalRef<jstring> ret =
86 Java_AndroidNetworkLibrary_getMimeTypeFromExtension( 86 Java_AndroidNetworkLibrary_getMimeTypeFromExtension(
87 env, extension_string.obj()); 87 env, extension_string.obj());
88 88
89 if (!ret.obj()) { 89 if (!ret.obj()) {
90 LOG(WARNING) << "Call to getMimeTypeFromExtension failed"; 90 LOG(WARNING) << "Call to getMimeTypeFromExtension failed for extension: "
91 << extension;
91 return false; 92 return false;
92 } 93 }
93 *result = ConvertJavaStringToUTF8(ret); 94 *result = ConvertJavaStringToUTF8(ret);
94 return true; 95 return true;
95 } 96 }
96 97
97 bool RegisterNetworkLibrary(JNIEnv* env) { 98 bool RegisterNetworkLibrary(JNIEnv* env) {
98 return RegisterNativesImpl(env); 99 return RegisterNativesImpl(env);
99 } 100 }
100 101
101 } // namespace android 102 } // namespace android
102 } // namespace net 103 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698