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

Issue 1015023002: Plugin Power Saver: Throttle 'large' plugins that appear small. (Closed)

Created:
5 years, 9 months ago by tommycli
Modified:
5 years, 8 months ago
Reviewers:
Lei Zhang, piman
CC:
chromium-reviews, mkwst+moarreviews-renderer_chromium.org, darin-cc_chromium.org, jam, mlamouri+watch-content_chromium.org, groby-ooo-7-16
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Plugin Power Saver: Throttle 'large' plugins that appear small. Some plugins are large, but only a small portion of it is visible to the user. An example might be a large SWF in a small div container. This is to allow the SWF to dynamically expand via JS. However, the throttling criteria should be based on the visible size rather than the SWF size. This patch fixes that by walking up the DOM tree and looking for smaller parent elements and using that as the visible size. This patch also centers the 'play' button on the visible area rather than the whole keyframe area, which may be much larger than the visible area. BUG=468142, 403800 Committed: https://crrev.com/c3ace4f15c91440c2dad238731422fe29b1b4373 Cr-Commit-Position: refs/heads/master@{#323331}

Patch Set 1 #

Total comments: 4

Patch Set 2 : use gfx::Size #

Total comments: 9

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Patch Set 5 : update plugin interface #

Patch Set 6 : #

Patch Set 7 : Remove keyframe size tracking. Unnecessary. #

Total comments: 10

Patch Set 8 : #

Patch Set 9 : #

Total comments: 8

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -48 lines) Patch
M chrome/renderer/chrome_content_renderer_client.cc View 1 2 3 4 5 6 7 3 chunks +11 lines, -8 lines 0 comments Download
M chrome/renderer/plugins/chrome_plugin_placeholder.h View 1 2 3 4 5 6 7 8 9 2 chunks +18 lines, -4 lines 0 comments Download
M chrome/renderer/plugins/chrome_plugin_placeholder.cc View 1 2 3 4 5 6 7 8 9 4 chunks +16 lines, -6 lines 0 comments Download
M chrome/renderer/plugins/plugin_preroller.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -1 line 0 comments Download
M chrome/renderer/resources/plugin_poster.html View 1 2 3 4 5 6 7 2 chunks +11 lines, -2 lines 0 comments Download
M content/public/renderer/plugin_instance_throttler.h View 1 2 3 4 5 2 chunks +7 lines, -0 lines 0 comments Download
M content/renderer/pepper/pepper_plugin_instance_impl.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -1 line 0 comments Download
M content/renderer/pepper/pepper_plugin_instance_impl.cc View 1 2 3 4 5 6 7 8 6 chunks +31 lines, -16 lines 0 comments Download
M content/renderer/pepper/pepper_webplugin_impl.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/pepper/plugin_instance_throttler_impl.h View 1 2 3 4 5 6 7 8 9 4 chunks +6 lines, -2 lines 0 comments Download
M content/renderer/pepper/plugin_instance_throttler_impl.cc View 1 2 3 4 5 6 7 8 9 2 chunks +9 lines, -2 lines 0 comments Download
M content/renderer/pepper/plugin_instance_throttler_impl_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -4 lines 0 comments Download
M content/renderer/render_widget_fullscreen_pepper.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 25 (2 generated)
tommycli
thestig / piman: PTAL The patch seems unnecessarily large given the apparent simplicity of what ...
5 years, 9 months ago (2015-03-18 00:06:47 UTC) #2
tommycli
+cc groby Let me know if you have any feedback on this approach (walk up ...
5 years, 9 months ago (2015-03-18 00:07:38 UTC) #3
Lei Zhang
- naive -> native in the CL desc? - Use a gfx::Size instead of a ...
5 years, 9 months ago (2015-03-18 00:19:32 UTC) #4
tommycli
thestig: thanks. That eliminated some sloc https://codereview.chromium.org/1015023002/diff/1/chrome/renderer/plugins/plugin_preroller.cc File chrome/renderer/plugins/plugin_preroller.cc (right): https://codereview.chromium.org/1015023002/diff/1/chrome/renderer/plugins/plugin_preroller.cc#newcode57 chrome/renderer/plugins/plugin_preroller.cc:57: keyframe_width_ = bitmap->width(); ...
5 years, 9 months ago (2015-03-18 00:39:33 UTC) #5
Lei Zhang
Is it possible to add a test for this? https://codereview.chromium.org/1015023002/diff/20001/content/public/renderer/plugin_instance_throttler.h File content/public/renderer/plugin_instance_throttler.h (right): https://codereview.chromium.org/1015023002/diff/20001/content/public/renderer/plugin_instance_throttler.h#newcode91 content/public/renderer/plugin_instance_throttler.h:91: ...
5 years, 9 months ago (2015-03-18 00:48:12 UTC) #6
piman
https://codereview.chromium.org/1015023002/diff/40001/content/renderer/pepper/pepper_plugin_instance_impl.cc File content/renderer/pepper/pepper_plugin_instance_impl.cc (right): https://codereview.chromium.org/1015023002/diff/40001/content/renderer/pepper/pepper_plugin_instance_impl.cc#newcode823 content/renderer/pepper/pepper_plugin_instance_impl.cc:823: } This seems crazy. It's also most likely wrong ...
5 years, 9 months ago (2015-03-18 01:58:57 UTC) #7
tommycli
piman/thestig: addressed your concerns below. thestig: Will remember to look into some kind of test ...
5 years, 9 months ago (2015-03-19 22:10:13 UTC) #8
Lei Zhang
You should be able to add a test independent of the implementation because you already ...
5 years, 9 months ago (2015-03-19 22:26:42 UTC) #9
Lei Zhang
https://codereview.chromium.org/1015023002/diff/20001/content/renderer/pepper/plugin_instance_throttler_impl.cc File content/renderer/pepper/plugin_instance_throttler_impl.cc (right): https://codereview.chromium.org/1015023002/diff/20001/content/renderer/pepper/plugin_instance_throttler_impl.cc#newcode118 content/renderer/pepper/plugin_instance_throttler_impl.cc:118: initialized_size_ = size; On 2015/03/19 22:10:12, tommycli wrote: > ...
5 years, 9 months ago (2015-03-19 22:29:45 UTC) #10
piman
On Thu, Mar 19, 2015 at 3:10 PM, <tommycli@chromium.org> wrote: > piman/thestig: addressed your concerns ...
5 years, 9 months ago (2015-03-19 22:43:04 UTC) #11
chromium-reviews
piman: That seems reasonable. I'll give that a shot. On Thu, Mar 19, 2015 at ...
5 years, 9 months ago (2015-03-19 22:47:55 UTC) #12
tommycli
piman: PTAL. I finally got around to trying your advice of delaying using coordinates by ...
5 years, 8 months ago (2015-04-01 00:09:07 UTC) #13
tommycli
thestig: This patch has changed a lot, so may need another look. Also: last time ...
5 years, 8 months ago (2015-04-01 00:34:11 UTC) #14
Lei Zhang
https://codereview.chromium.org/1015023002/diff/120001/chrome/renderer/plugins/chrome_plugin_placeholder.h File chrome/renderer/plugins/chrome_plugin_placeholder.h (right): https://codereview.chromium.org/1015023002/diff/120001/chrome/renderer/plugins/chrome_plugin_placeholder.h#newcode38 chrome/renderer/plugins/chrome_plugin_placeholder.h:38: const gfx::Size& custom_poster_size); Maybe put all the poster related ...
5 years, 8 months ago (2015-04-01 00:51:08 UTC) #15
piman
https://codereview.chromium.org/1015023002/diff/120001/content/renderer/pepper/pepper_plugin_instance_impl.cc File content/renderer/pepper/pepper_plugin_instance_impl.cc (right): https://codereview.chromium.org/1015023002/diff/120001/content/renderer/pepper/pepper_plugin_instance_impl.cc#newcode1631 content/renderer/pepper/pepper_plugin_instance_impl.cc:1631: if (!sent_initial_did_change_view_) { So, you may be getting into ...
5 years, 8 months ago (2015-04-01 01:02:41 UTC) #16
tommycli
thestig, piman: addressed below. thanks! https://codereview.chromium.org/1015023002/diff/120001/chrome/renderer/plugins/chrome_plugin_placeholder.h File chrome/renderer/plugins/chrome_plugin_placeholder.h (right): https://codereview.chromium.org/1015023002/diff/120001/chrome/renderer/plugins/chrome_plugin_placeholder.h#newcode38 chrome/renderer/plugins/chrome_plugin_placeholder.h:38: const gfx::Size& custom_poster_size); On ...
5 years, 8 months ago (2015-04-01 18:55:28 UTC) #17
Lei Zhang
https://codereview.chromium.org/1015023002/diff/160001/chrome/renderer/plugins/chrome_plugin_placeholder.cc File chrome/renderer/plugins/chrome_plugin_placeholder.cc (right): https://codereview.chromium.org/1015023002/diff/160001/chrome/renderer/plugins/chrome_plugin_placeholder.cc#newcode161 chrome/renderer/plugins/chrome_plugin_placeholder.cc:161: base::Int64ToString(poster_info.custom_poster_size.width()) + "px"); Why not just base::IntToString()? https://codereview.chromium.org/1015023002/diff/160001/chrome/renderer/plugins/chrome_plugin_placeholder.h File ...
5 years, 8 months ago (2015-04-01 19:18:35 UTC) #18
tommycli
thestig: thanks! https://codereview.chromium.org/1015023002/diff/160001/chrome/renderer/plugins/chrome_plugin_placeholder.cc File chrome/renderer/plugins/chrome_plugin_placeholder.cc (right): https://codereview.chromium.org/1015023002/diff/160001/chrome/renderer/plugins/chrome_plugin_placeholder.cc#newcode161 chrome/renderer/plugins/chrome_plugin_placeholder.cc:161: base::Int64ToString(poster_info.custom_poster_size.width()) + "px"); On 2015/04/01 19:18:35, Lei ...
5 years, 8 months ago (2015-04-01 19:33:20 UTC) #19
piman
lgtm
5 years, 8 months ago (2015-04-01 19:37:22 UTC) #20
Lei Zhang
lgtm
5 years, 8 months ago (2015-04-01 21:04:48 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1015023002/180001
5 years, 8 months ago (2015-04-01 21:05:36 UTC) #23
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 8 months ago (2015-04-01 21:56:16 UTC) #24
commit-bot: I haz the power
5 years, 8 months ago (2015-04-01 21:57:13 UTC) #25
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/c3ace4f15c91440c2dad238731422fe29b1b4373
Cr-Commit-Position: refs/heads/master@{#323331}

Powered by Google App Engine
This is Rietveld 408576698