Bug 130746 - WebProcesses use lots of cpu in the background if there are a lot of plugins.
Summary: WebProcesses use lots of cpu in the background if there are a lot of plugins.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 130743
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-25 15:19 PDT by Stephanie Lewis
Modified: 2014-03-28 18:20 PDT (History)
3 users (show)

See Also:


Attachments
patch (21.03 KB, patch)
2014-03-25 15:19 PDT, Stephanie Lewis
slewis: review-
Details | Formatted Diff | Diff
reworked patch (21.54 KB, patch)
2014-03-27 14:19 PDT, Stephanie Lewis
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephanie Lewis 2014-03-25 15:19:19 PDT
Everytime pluginDidEvaluate is called the WebProcess page throttler is disabled.  This was done originally so that web apps like Pandora could continue to play smoothly in the background.
We only need to stop the page throttler is audio is playing.
Comment 1 Stephanie Lewis 2014-03-25 15:19:50 PDT
Created attachment 227807 [details]
patch
Comment 2 Stephanie Lewis 2014-03-25 15:47:08 PDT
Going to change the bool to an enum so I don't need the isSupported function but the general layout of the patch should be correct
Comment 3 Stephanie Lewis 2014-03-27 14:19:27 PDT
Created attachment 227980 [details]
reworked patch
Comment 4 Anders Carlsson 2014-03-28 14:29:18 PDT
Comment on attachment 227980 [details]
reworked patch

View in context: https://bugs.webkit.org/attachment.cgi?id=227980&action=review

> Source/WebKit2/PluginProcess/PluginProcess.cpp:264
> +    for (auto it = m_webProcessConnections.begin(), end = m_webProcessConnections.end(); it != end; ++it) {
> +        WebProcessConnection* connection = it->get();
> +        connection->audioHardwareDidBecomeActive();
> +    }

This can use range for.

> Source/WebKit2/PluginProcess/PluginProcess.cpp:272
> +    for (auto it = m_webProcessConnections.begin(), end = m_webProcessConnections.end(); it != end; ++it) {
> +        WebProcessConnection* connection = it->get();
> +        connection->audioHardwareDidBecomeInactive();
> +    }

Ditto.

> Source/WebKit2/PluginProcess/PluginProcess.h:45
> +    public WebCore::AudioHardwareListener::Client

Please put this on the same line. I also don't think it needs to be public.

> Source/WebKit2/PluginProcess/PluginProcess.h:102
> +    //AudioHardwareListenerClient

Missing space after //.
Comment 5 Stephanie Lewis 2014-03-28 18:20:55 PDT
http://trac.webkit.org/changeset/166443