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

Side by Side Diff: content/shell/browser/shell_android.cc

Issue 1294333002: Fix wrong usages of ScopedJavaLocalRef::Release(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment to Release() explaining it should not be used to call java methods 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
« no previous file with comments | « content/shell/android/shell_manager.cc ('k') | ui/base/clipboard/clipboard_android.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell.h" 5 #include "content/shell/browser/shell.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); 46 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec());
47 Java_Shell_onUpdateUrl(env, java_object_.obj(), j_url.obj()); 47 Java_Shell_onUpdateUrl(env, java_object_.obj(), j_url.obj());
48 } 48 }
49 49
50 void Shell::PlatformSetIsLoading(bool loading) { 50 void Shell::PlatformSetIsLoading(bool loading) {
51 JNIEnv* env = AttachCurrentThread(); 51 JNIEnv* env = AttachCurrentThread();
52 Java_Shell_setIsLoading(env, java_object_.obj(), loading); 52 Java_Shell_setIsLoading(env, java_object_.obj(), loading);
53 } 53 }
54 54
55 void Shell::PlatformCreateWindow(int width, int height) { 55 void Shell::PlatformCreateWindow(int width, int height) {
56 java_object_.Reset(AttachCurrentThread(), CreateShellView(this)); 56 java_object_.Reset(CreateShellView(this));
57 } 57 }
58 58
59 void Shell::PlatformSetContents() { 59 void Shell::PlatformSetContents() {
60 JNIEnv* env = AttachCurrentThread(); 60 JNIEnv* env = AttachCurrentThread();
61 Java_Shell_initFromNativeTabContents( 61 Java_Shell_initFromNativeTabContents(
62 env, java_object_.obj(), web_contents()->GetJavaWebContents().obj()); 62 env, java_object_.obj(), web_contents()->GetJavaWebContents().obj());
63 } 63 }
64 64
65 void Shell::PlatformResizeSubViews() { 65 void Shell::PlatformResizeSubViews() {
66 // Not needed; subviews are bound. 66 // Not needed; subviews are bound.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 return RegisterNativesImpl(env); 103 return RegisterNativesImpl(env);
104 } 104 }
105 105
106 // static 106 // static
107 void CloseShell(JNIEnv* env, jclass clazz, jlong shellPtr) { 107 void CloseShell(JNIEnv* env, jclass clazz, jlong shellPtr) {
108 Shell* shell = reinterpret_cast<Shell*>(shellPtr); 108 Shell* shell = reinterpret_cast<Shell*>(shellPtr);
109 shell->Close(); 109 shell->Close();
110 } 110 }
111 111
112 } // namespace content 112 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/android/shell_manager.cc ('k') | ui/base/clipboard/clipboard_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698