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

Unified Diff: content/browser/android/content_video_view.cc

Issue 1067023005: Null check ContentViewCore::GetJavaObject (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromecast build Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698