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

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

Issue 11293101: Stop emitting warnings for mime types not recognized by Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 bool GetMimeTypeFromExtension(const std::string& extension, 74 bool GetMimeTypeFromExtension(const std::string& extension,
75 std::string* result) { 75 std::string* result) {
76 JNIEnv* env = AttachCurrentThread(); 76 JNIEnv* env = AttachCurrentThread();
77 77
78 ScopedJavaLocalRef<jstring> extension_string = 78 ScopedJavaLocalRef<jstring> extension_string =
79 ConvertUTF8ToJavaString(env, extension); 79 ConvertUTF8ToJavaString(env, extension);
80 ScopedJavaLocalRef<jstring> ret = 80 ScopedJavaLocalRef<jstring> ret =
81 Java_AndroidNetworkLibrary_getMimeTypeFromExtension( 81 Java_AndroidNetworkLibrary_getMimeTypeFromExtension(
82 env, extension_string.obj()); 82 env, extension_string.obj());
83 83
84 if (!ret.obj()) { 84 if (!ret.obj())
85 LOG(WARNING) << "Call to getMimeTypeFromExtension failed for extension: "
86 << extension;
87 return false; 85 return false;
88 }
89 *result = ConvertJavaStringToUTF8(ret); 86 *result = ConvertJavaStringToUTF8(ret);
90 return true; 87 return true;
91 } 88 }
92 89
93 bool RegisterNetworkLibrary(JNIEnv* env) { 90 bool RegisterNetworkLibrary(JNIEnv* env) {
94 return RegisterNativesImpl(env); 91 return RegisterNativesImpl(env);
95 } 92 }
96 93
97 } // namespace android 94 } // namespace android
98 } // namespace net 95 } // 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