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

Side by Side Diff: android_webview/native/android_protocol_handler.cc

Issue 1288183004: jni_generator: Make all object-returning natives return ScopedJavaLocalRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add some newlines for readability Created 5 years, 4 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
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 "android_webview/native/android_protocol_handler.h" 5 #include "android_webview/native/android_protocol_handler.h"
6 6
7 #include "android_webview/browser/net/android_stream_reader_url_request_job.h" 7 #include "android_webview/browser/net/android_stream_reader_url_request_job.h"
8 #include "android_webview/browser/net/aw_url_request_job_factory.h" 8 #include "android_webview/browser/net/aw_url_request_job_factory.h"
9 #include "android_webview/common/url_constants.h" 9 #include "android_webview/common/url_constants.h"
10 #include "android_webview/native/input_stream_impl.h" 10 #include "android_webview/native/input_stream_impl.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 // the use of the standard application context. 274 // the use of the standard application context.
275 static void SetResourceContextForTesting(JNIEnv* env, jclass /*clazz*/, 275 static void SetResourceContextForTesting(JNIEnv* env, jclass /*clazz*/,
276 jobject context) { 276 jobject context) {
277 if (context) { 277 if (context) {
278 ResetResourceContext(new JavaObjectWeakGlobalRef(env, context)); 278 ResetResourceContext(new JavaObjectWeakGlobalRef(env, context));
279 } else { 279 } else {
280 ResetResourceContext(NULL); 280 ResetResourceContext(NULL);
281 } 281 }
282 } 282 }
283 283
284 static jstring GetAndroidAssetPath(JNIEnv* env, jclass /*clazz*/) { 284 static ScopedJavaLocalRef<jstring> GetAndroidAssetPath(JNIEnv* env,
285 // OK to release, JNI binding. 285 jclass /*clazz*/) {
286 return ConvertUTF8ToJavaString( 286 return ConvertUTF8ToJavaString(env, android_webview::kAndroidAssetPath);
287 env, android_webview::kAndroidAssetPath).Release();
288 } 287 }
289 288
290 static jstring GetAndroidResourcePath(JNIEnv* env, jclass /*clazz*/) { 289 static ScopedJavaLocalRef<jstring> GetAndroidResourcePath(JNIEnv* env,
291 // OK to release, JNI binding. 290 jclass /*clazz*/) {
292 return ConvertUTF8ToJavaString( 291 return ConvertUTF8ToJavaString(env, android_webview::kAndroidResourcePath);
293 env, android_webview::kAndroidResourcePath).Release();
294 } 292 }
295 293
296 } // namespace android_webview 294 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698