Index: content/shell/browser/shell_android.cc |
diff --git a/content/shell/browser/shell_android.cc b/content/shell/browser/shell_android.cc |
index b11ba37abaa1d3c7eba35fbc76ddf17159853ba2..80a653e41b2b07f144703c390b787564a5cb1105 100644 |
--- a/content/shell/browser/shell_android.cc |
+++ b/content/shell/browser/shell_android.cc |
@@ -30,6 +30,10 @@ void Shell::PlatformExit() { |
} |
void Shell::PlatformCleanUp() { |
+ JNIEnv* env = AttachCurrentThread(); |
+ if (java_object_.is_null()) |
+ return; |
+ Java_Shell_onNativeDestroyed(env, java_object_.obj()); |
} |
void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) { |
@@ -83,8 +87,7 @@ bool Shell::PlatformIsFullscreenForTabOrPending( |
} |
void Shell::Close() { |
- CloseShellView(java_object_.obj()); |
- java_object_.Reset(); |
+ RemoveShellView(java_object_.obj()); |
delete this; |
} |
@@ -93,4 +96,10 @@ bool Shell::Register(JNIEnv* env) { |
return RegisterNativesImpl(env); |
} |
+// static |
+void CloseShell(JNIEnv* env, jclass clazz, jlong shellPtr) { |
+ Shell* shell = reinterpret_cast<Shell*>(shellPtr); |
+ shell->Close(); |
+} |
+ |
} // namespace content |