Chromium Code Reviews| Index: content/browser/android/content_video_view.cc |
| diff --git a/content/browser/android/content_video_view.cc b/content/browser/android/content_video_view.cc |
| index 1081bd64d090709bcd225cc99a87429a79644bc7..2a5ce048b55ae8bc045d361cf7687b3f780228d4 100644 |
| --- a/content/browser/android/content_video_view.cc |
| +++ b/content/browser/android/content_video_view.cc |
| @@ -198,11 +198,17 @@ ScopedJavaLocalRef<jobject> ContentVideoView::GetJavaObject(JNIEnv* env) { |
| JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() { |
|
Ted C
2015/04/08 15:59:36
do the callers of this properly null check?
boliu
2015/04/08 16:04:29
Yes. See content_video_view.is_null() throughout t
Ted C
2015/04/08 17:13:50
They are all pretty gross. I don't really have a
|
| ContentViewCore* content_view_core = manager_->GetContentViewCore(); |
| JNIEnv* env = AttachCurrentThread(); |
| + |
| + base::android::ScopedJavaLocalRef<jobject> j_content_view_core = |
| + content_view_core->GetJavaObject(); |
| + if (j_content_view_core.is_null()) |
| + return JavaObjectWeakGlobalRef(env, nullptr); |
| + |
| return JavaObjectWeakGlobalRef( |
| env, |
| Java_ContentVideoView_createContentVideoView( |
| env, |
| - content_view_core->GetJavaObject().obj(), |
| + j_content_view_core.obj(), |
| reinterpret_cast<intptr_t>(this)).obj()); |
| } |
| } // namespace content |