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

Side by Side Diff: chromecast/browser/android/cast_window_manager.cc

Issue 1326763009: jni: Forbid inappropriate JNI parameter conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN-only mojo, and chromecast Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/browser/android/cast_window_manager.h" 5 #include "chromecast/browser/android/cast_window_manager.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 // Register native methods 50 // Register native methods
51 bool RegisterCastWindowManager(JNIEnv* env) { 51 bool RegisterCastWindowManager(JNIEnv* env) {
52 return RegisterNativesImpl(env); 52 return RegisterNativesImpl(env);
53 } 53 }
54 54
55 void Init(JNIEnv* env, 55 void Init(JNIEnv* env,
56 const JavaParamRef<jclass>& clazz, 56 const JavaParamRef<jclass>& clazz,
57 const JavaParamRef<jobject>& obj) { 57 const JavaParamRef<jobject>& obj) {
58 g_window_manager.Get().Reset( 58 g_window_manager.Get().Reset(obj);
59 base::android::ScopedJavaLocalRef<jobject>(env, obj));
60 } 59 }
61 60
62 jlong LaunchCastWindow(JNIEnv* env, 61 jlong LaunchCastWindow(JNIEnv* env,
63 const JavaParamRef<jclass>& clazz, 62 const JavaParamRef<jclass>& clazz,
64 const JavaParamRef<jstring>& jurl) { 63 const JavaParamRef<jstring>& jurl) {
65 GURL url(base::android::ConvertJavaStringToUTF8(env, jurl)); 64 GURL url(base::android::ConvertJavaStringToUTF8(env, jurl));
66 return reinterpret_cast<jlong>( 65 return reinterpret_cast<jlong>(
67 CastWindowAndroid::CreateNewWindow( 66 CastWindowAndroid::CreateNewWindow(
68 CastBrowserProcess::GetInstance()->browser_context(), 67 CastBrowserProcess::GetInstance()->browser_context(),
69 url)); 68 url));
(...skipping 15 matching lines...) Expand all
85 void EnableDevTools(JNIEnv* env, 84 void EnableDevTools(JNIEnv* env,
86 const JavaParamRef<jclass>& clazz, 85 const JavaParamRef<jclass>& clazz,
87 jboolean enable) { 86 jboolean enable) {
88 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 87 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
89 CastBrowserProcess::GetInstance()->pref_service()->SetBoolean( 88 CastBrowserProcess::GetInstance()->pref_service()->SetBoolean(
90 prefs::kEnableRemoteDebugging, enable); 89 prefs::kEnableRemoteDebugging, enable);
91 } 90 }
92 91
93 } // namespace shell 92 } // namespace shell
94 } // namespace chromecast 93 } // namespace chromecast
OLDNEW
« no previous file with comments | « chrome/browser/android/preferences/website_preference_bridge.cc ('k') | components/cronet/android/cronet_library_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698