Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Issue 137243005: WebMediaPlayer{Android,Impl}: RenderFrameObserver instead of RVO/ML::DestructionObserver. (Closed)

Created:
6 years, 11 months ago by Ami GONE FROM CHROMIUM
Modified:
6 years, 10 months ago
CC:
chromium-reviews, fischman+watch_chromium.org, mcasas+watch_chromium.org, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org, qinmin
Visibility:
Public.

Description

WebMediaPlayer{Android,Impl}: use RenderFrameObserver instead of ML::DestructionObserver/RenderViewObserver. RenderThreadImpl is torn down before the main thread's MessageLoop is, and some of WebMediaPlayerAndroid's dependencies require the render thread to still be alive, so move its tear-down to earlier in the process. This is the Android version of r240125 which fixed the same bug in WebMediaPlayerImpl, but forgot that WebMediaPlayerAndroid is a fork. Since RenderViewObserver is apparently out of favor nowadays, use RenderFrameObserver. BUG=338393, 304967, 338481 [Previously committed PS#3 as r248115 and rolled back in r248128] [email protected], [email protected], [email protected], [email protected] Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=248321

Patch Set 1 #

Total comments: 9

Patch Set 2 : scherkus review #

Patch Set 3 : convert WMPI & WMPA to RenderFrameObserver #

Patch Set 4 : Fixed layouttest #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+93 lines, -95 lines) Patch
M content/browser/web_contents/web_contents_impl.h View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 2 chunks +29 lines, -26 lines 1 comment Download
M content/common/view_messages.h View 1 2 3 1 chunk +4 lines, -3 lines 0 comments Download
M content/renderer/media/android/webmediaplayer_android.h View 1 2 3 4 chunks +17 lines, -15 lines 0 comments Download
M content/renderer/media/android/webmediaplayer_android.cc View 1 2 3 6 chunks +6 lines, -9 lines 0 comments Download
M content/renderer/media/webmediaplayer_impl.h View 1 2 3 3 chunks +3 lines, -6 lines 0 comments Download
M content/renderer/media/webmediaplayer_impl.cc View 1 2 3 3 chunks +16 lines, -14 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 3 chunks +14 lines, -18 lines 0 comments Download

Messages

Total messages: 51 (0 generated)
Ami GONE FROM CHROMIUM
@scherkus: please review @piman: please OWNERS c/r/r_v_i.cc @qinmin: FYI https://codereview.chromium.org/137243005/diff/1/content/renderer/media/android/webmediaplayer_android.h File content/renderer/media/android/webmediaplayer_android.h (right): https://codereview.chromium.org/137243005/diff/1/content/renderer/media/android/webmediaplayer_android.h#newcode70 content/renderer/media/android/webmediaplayer_android.h:70: ...
6 years, 11 months ago (2014-01-27 18:45:59 UTC) #1
piman
LGTM from the lifetime pov, but my understanding is that we're trying to remove RenderViewObserver. ...
6 years, 11 months ago (2014-01-27 19:00:16 UTC) #2
scherkus (not reviewing)
lgtm w/ nits re: RenderViewObserver ... perhaps there's a yet-to-be-written frame-based observer to support the ...
6 years, 11 months ago (2014-01-27 19:10:06 UTC) #3
Ami GONE FROM CHROMIUM
Thanks for the reviews. https://codereview.chromium.org/137243005/diff/1/content/renderer/media/android/webmediaplayer_android.cc File content/renderer/media/android/webmediaplayer_android.cc (right): https://codereview.chromium.org/137243005/diff/1/content/renderer/media/android/webmediaplayer_android.cc#newcode76 content/renderer/media/android/webmediaplayer_android.cc:76: content::RenderView* render_view, On 2014/01/27 19:10:06, ...
6 years, 11 months ago (2014-01-27 19:27:03 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/137243005/40001
6 years, 11 months ago (2014-01-27 19:28:50 UTC) #5
piman
On Mon, Jan 27, 2014 at 11:10 AM, <[email protected]> wrote: > lgtm w/ nits > ...
6 years, 11 months ago (2014-01-27 20:09:32 UTC) #6
Ami GONE FROM CHROMIUM
On Mon, Jan 27, 2014 at 12:09 PM, Antoine Labour <[email protected]> wrote: > On Mon, ...
6 years, 11 months ago (2014-01-27 20:27:55 UTC) #7
piman
On Mon, Jan 27, 2014 at 12:27 PM, Ami Fischman <[email protected]>wrote: > On Mon, Jan ...
6 years, 11 months ago (2014-01-27 20:36:08 UTC) #8
Ami GONE FROM CHROMIUM
On Mon, Jan 27, 2014 at 12:35 PM, Antoine Labour <[email protected]> wrote: > I assume ...
6 years, 11 months ago (2014-01-27 21:03:46 UTC) #9
jam
On 2014/01/27 20:36:08, piman wrote: > On Mon, Jan 27, 2014 at 12:27 PM, Ami ...
6 years, 11 months ago (2014-01-27 21:33:54 UTC) #10
Ami GONE FROM CHROMIUM
On Mon, Jan 27, 2014 at 1:33 PM, <[email protected]> wrote: > This class has a ...
6 years, 11 months ago (2014-01-27 21:45:31 UTC) #11
jam
On 2014/01/27 21:45:31, Ami Fischman wrote: > On Mon, Jan 27, 2014 at 1:33 PM, ...
6 years, 11 months ago (2014-01-27 22:48:06 UTC) #12
Ami GONE FROM CHROMIUM
On Mon, Jan 27, 2014 at 2:48 PM, <[email protected]> wrote: > This class, as written, ...
6 years, 11 months ago (2014-01-27 22:56:08 UTC) #13
jam
On 2014/01/27 22:56:08, Ami Fischman wrote: > On Mon, Jan 27, 2014 at 2:48 PM, ...
6 years, 11 months ago (2014-01-27 23:32:10 UTC) #14
Ami GONE FROM CHROMIUM
On 2014/01/27 23:32:10, jam wrote: > On 2014/01/27 22:56:08, Ami Fischman wrote: > > On ...
6 years, 10 months ago (2014-01-29 18:35:58 UTC) #15
scherkus (not reviewing)
lgtm
6 years, 10 months ago (2014-01-29 22:30:10 UTC) #16
jam
lgtm
6 years, 10 months ago (2014-01-30 20:58:51 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/137243005/100001
6 years, 10 months ago (2014-01-30 23:41:17 UTC) #18
commit-bot: I haz the power
Retried try job too often on mac for step(s) compile http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac&number=120140
6 years, 10 months ago (2014-01-31 00:57:38 UTC) #19
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 00:57:48 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/137243005/100001
6 years, 10 months ago (2014-01-31 01:01:45 UTC) #21
commit-bot: I haz the power
Change committed as 248115
6 years, 10 months ago (2014-01-31 03:16:03 UTC) #22
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 03:16:10 UTC) #23
dglazkov
It's very weird, but this I think had an effect on Blink layout tests. One ...
6 years, 10 months ago (2014-01-31 05:06:32 UTC) #24
Ami GONE FROM CHROMIUM
@dglazkov: thanks for reverting for me. @jam/scherkus: please take a look at PS#4 which fixes ...
6 years, 10 months ago (2014-01-31 06:24:23 UTC) #25
jam
lgtm
6 years, 10 months ago (2014-01-31 17:40:47 UTC) #26
scherkus (not reviewing)
lgtm
6 years, 10 months ago (2014-01-31 20:51:08 UTC) #27
Ami GONE FROM CHROMIUM
-jln (OOO), +cevans for _messages.h please
6 years, 10 months ago (2014-01-31 21:01:49 UTC) #28
Chris Evans
On 2014/01/31 21:01:49, Ami Fischman wrote: > -jln (OOO), +cevans for _messages.h please lgtm
6 years, 10 months ago (2014-01-31 21:15:30 UTC) #29
Ami GONE FROM CHROMIUM
The CQ bit was checked by [email protected]
6 years, 10 months ago (2014-01-31 21:16:28 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/137243005/120001
6 years, 10 months ago (2014-01-31 21:24:46 UTC) #31
commit-bot: I haz the power
The CQ bit was unchecked by [email protected]
6 years, 10 months ago (2014-01-31 22:07:37 UTC) #32
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) app_list_unittests, aura_unittests, browser_tests, compositor_unittests, content_browsertests, content_unittests, ...
6 years, 10 months ago (2014-01-31 22:07:37 UTC) #33
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 22:07:38 UTC) #34
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 22:07:43 UTC) #35
Ami GONE FROM CHROMIUM
The CQ bit was checked by [email protected]
6 years, 10 months ago (2014-01-31 22:57:25 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/137243005/120001
6 years, 10 months ago (2014-01-31 22:58:51 UTC) #37
commit-bot: I haz the power
The CQ bit was unchecked by [email protected]
6 years, 10 months ago (2014-01-31 23:30:19 UTC) #38
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) app_list_unittests, aura_unittests, browser_tests, compositor_unittests, content_browsertests, content_unittests, ...
6 years, 10 months ago (2014-01-31 23:30:21 UTC) #39
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 23:30:22 UTC) #40
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-01-31 23:30:22 UTC) #41
Ami GONE FROM CHROMIUM
The CQ bit was checked by [email protected]
6 years, 10 months ago (2014-01-31 23:59:16 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/137243005/120001
6 years, 10 months ago (2014-01-31 23:59:49 UTC) #43
commit-bot: I haz the power
The CQ bit was unchecked by [email protected]
6 years, 10 months ago (2014-02-01 00:31:01 UTC) #44
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) app_list_unittests, aura_unittests, browser_tests, compositor_unittests, content_browsertests, content_unittests, ...
6 years, 10 months ago (2014-02-01 00:31:02 UTC) #45
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-01 00:31:06 UTC) #46
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-01 00:31:12 UTC) #47
Ami GONE FROM CHROMIUM
Committed patchset #4 manually as r248321 (presubmit successful).
6 years, 10 months ago (2014-02-01 01:16:33 UTC) #48
jln (very slow on Chromium)
If a compromised process sends MediaPausedNotification twice, you'll delete NULL. It's not a security vulnerability, ...
6 years, 10 months ago (2014-02-03 21:33:28 UTC) #49
Ami GONE FROM CHROMIUM
On Mon, Feb 3, 2014 at 1:33 PM, <[email protected]> wrote: > If a compromised process ...
6 years, 10 months ago (2014-02-03 21:42:46 UTC) #50
jln (very slow on Chromium)
6 years, 10 months ago (2014-02-03 22:17:05 UTC) #51
Message was sent while issue was closed.
On 2014/02/03 21:42:46, Ami Fischman wrote:

> delete NULL;
> is a no-op in the language spec (5.3.5 - Delete [expr.delete] says: "if the
> value of the operand of delete is the null pointer the operation has no
> effect.").  In what sense is it not a "safe code construct"?

It's not a safe code construct because it can easily confuse readers that the
object is not deleted yet and lead to UAF.
Adding "CHECK(blah->IsFoo());" before "delete blah" is a common mistake to make.
However, on most platforms it's not exploitable anymore (most memory allocators
won't
allocate the first page).

if (X) {} is generally better than doing safe no-op operations on NULL pointers.

> > Shouldn't PowerSaveBlockerMap be a map to a map to scoped_ptr<>?
> >
> 
> scoped_ptr<>s can't be put in STL containers (b/c before we adopt C++11
> they don't have STL-compatible move semantics).
> It /could/ hold linked_ptrs, instead.

Ohh yeah, right!

Powered by Google App Engine
This is Rietveld 408576698