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

Issue 2855373003: Check delegate before running Pepper media-device enumeration/monitoring requests. (Closed)

Created:
3 years, 7 months ago by Guido Urdaneta
Modified:
3 years, 7 months ago
Reviewers:
bbudge, yzshen1
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, jam, darin-cc_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Check delegate before running Pepper media-device enumeration/monitoring requests. This is intended to address a crash that appears to occur because the delegate object that performs enumerations is not available. BUG=716377 Review-Url: https://codereview.chromium.org/2855373003 Cr-Commit-Position: refs/heads/master@{#469601} Committed: https://chromium.googlesource.com/chromium/src/+/8dfbdfabb1747778fcaa216f662790dc7bc6ad3c

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -2 lines) Patch
M content/renderer/pepper/pepper_device_enumeration_host_helper.cc View 3 chunks +6 lines, -2 lines 3 comments Download

Messages

Total messages: 16 (9 generated)
Guido Urdaneta
Hi, PTAL. bbudge@: please do OWNER's review. yzshen@: Years ago, you added the DCHECK I ...
3 years, 7 months ago (2017-05-04 13:13:58 UTC) #5
bbudge
lgtm
3 years, 7 months ago (2017-05-04 16:57:37 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2855373003/1
3 years, 7 months ago (2017-05-05 05:29:55 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/8dfbdfabb1747778fcaa216f662790dc7bc6ad3c
3 years, 7 months ago (2017-05-05 05:35:12 UTC) #13
yzshen1
https://codereview.chromium.org/2855373003/diff/1/content/renderer/pepper/pepper_device_enumeration_host_helper.cc File content/renderer/pepper/pepper_device_enumeration_host_helper.cc (right): https://codereview.chromium.org/2855373003/diff/1/content/renderer/pepper/pepper_device_enumeration_host_helper.cc#newcode38 content/renderer/pepper/pepper_device_enumeration_host_helper.cc:38: if (!owner->delegate_) Sorry this has been too long ago. ...
3 years, 7 months ago (2017-05-05 17:08:11 UTC) #14
Guido Urdaneta
https://codereview.chromium.org/2855373003/diff/1/content/renderer/pepper/pepper_device_enumeration_host_helper.cc File content/renderer/pepper/pepper_device_enumeration_host_helper.cc (right): https://codereview.chromium.org/2855373003/diff/1/content/renderer/pepper/pepper_device_enumeration_host_helper.cc#newcode38 content/renderer/pepper/pepper_device_enumeration_host_helper.cc:38: if (!owner->delegate_) On 2017/05/05 17:08:11, yzshen1 wrote: > Sorry ...
3 years, 7 months ago (2017-05-05 17:18:12 UTC) #15
yzshen1
3 years, 7 months ago (2017-05-05 17:22:31 UTC) #16
Message was sent while issue was closed.
https://codereview.chromium.org/2855373003/diff/1/content/renderer/pepper/pep...
File content/renderer/pepper/pepper_device_enumeration_host_helper.cc (right):

https://codereview.chromium.org/2855373003/diff/1/content/renderer/pepper/pep...
content/renderer/pepper/pepper_device_enumeration_host_helper.cc:38: if
(!owner->delegate_)
On 2017/05/05 17:18:12, Guido Urdaneta wrote:
> On 2017/05/05 17:08:11, yzshen1 wrote:
> > Sorry this has been too long ago. I don't remember this code. :)
> > 
> > Do we understand why delegate could be null? Is there a legitimate reason?
> > 
> > If we early return from, the callback will never be called, does the caller
> > expect that?
> > 
> 
> It is also expected if the document_url is not valid a few lines above, so I
> thought it was OK for a somewhat similar situation of a null delegate. 
That makes sense. :)


> I don't know why the delegate can become null. I am familiar with the device
> enumeration code, but not so much with the lifetimes of the Pepper objects. I
> glanced through the source code, but did not find an obvious reason why this
> could be the case.
This is what I am a little concerned about. There may be something wrong
elsewhere leading to an inconsistent state. 


> 
> An alternative to leaving the callback hanging could be to invoke the callback
> with an empty result.
> 
> I can prepare a patch that does that if you think that is better.

You definitely know this code better than I do now. So it is up to you. :)

Powered by Google App Engine
This is Rietveld 408576698