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

Issue 1067023005: Null check ContentViewCore::GetJavaObject (Closed)

Created:
5 years, 8 months ago by boliu
Modified:
5 years, 8 months ago
Reviewers:
Ted C, gunsch
CC:
chromium-reviews, darin-cc_chromium.org, jam, android-webview-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Null check ContentViewCore::GetJavaObject ContentViewCoreImpl holds a weak reference to the java peer. This means reference returned by GetJavaObject may be null. Go through all callers of this API and make sure they correctly handle null reference. BUG=469803 Committed: https://crrev.com/684ba03ae718cb7ffa9dc0720d011f941c084da3 Cr-Commit-Position: refs/heads/master@{#324243}

Patch Set 1 #

Patch Set 2 : chromecast #

Patch Set 3 : fix chromecast build #

Total comments: 3

Messages

Total messages: 10 (2 generated)
boliu
tedchoc: content and components (I was trying to find someone else, but Ted, you own ...
5 years, 8 months ago (2015-04-08 15:53:56 UTC) #2
Ted C
lgtm https://codereview.chromium.org/1067023005/diff/40001/content/browser/android/content_video_view.cc File content/browser/android/content_video_view.cc (right): https://codereview.chromium.org/1067023005/diff/40001/content/browser/android/content_video_view.cc#newcode198 content/browser/android/content_video_view.cc:198: JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() { do the callers of this ...
5 years, 8 months ago (2015-04-08 15:59:36 UTC) #3
boliu
https://codereview.chromium.org/1067023005/diff/40001/content/browser/android/content_video_view.cc File content/browser/android/content_video_view.cc (right): https://codereview.chromium.org/1067023005/diff/40001/content/browser/android/content_video_view.cc#newcode198 content/browser/android/content_video_view.cc:198: JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() { On 2015/04/08 15:59:36, Ted C wrote: ...
5 years, 8 months ago (2015-04-08 16:04:29 UTC) #4
gunsch
lgtm for chromecast
5 years, 8 months ago (2015-04-08 16:17:21 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1067023005/40001
5 years, 8 months ago (2015-04-08 16:20:38 UTC) #7
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 8 months ago (2015-04-08 17:07:26 UTC) #8
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/684ba03ae718cb7ffa9dc0720d011f941c084da3 Cr-Commit-Position: refs/heads/master@{#324243}
5 years, 8 months ago (2015-04-08 17:09:10 UTC) #9
Ted C
5 years, 8 months ago (2015-04-08 17:13:50 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/1067023005/diff/40001/content/browser/android...
File content/browser/android/content_video_view.cc (right):

https://codereview.chromium.org/1067023005/diff/40001/content/browser/android...
content/browser/android/content_video_view.cc:198: JavaObjectWeakGlobalRef
ContentVideoView::CreateJavaObject() {
On 2015/04/08 16:04:29, boliu wrote:
> On 2015/04/08 15:59:36, Ted C wrote:
> > do the callers of this properly null check?
> 
> Yes. See content_video_view.is_null() throughout this file
> 
> Btw, do you think this is a better pattern for returning a java weak
reference,
> and make the caller dereference it? That duplicates the dereference code in
all
> callers though which sucks.
> 
> I think we need a ScopedJavaLocalRefFromWeakRef or something :/

They are all pretty gross.  I don't really have a strong opinion about it.

Powered by Google App Engine
This is Rietveld 408576698