Bug 130746

Summary: WebProcesses use lots of cpu in the background if there are a lot of plugins.
Product: WebKit Reporter: Stephanie Lewis <slewis>
Component: Plug-insAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, jer.noble, slewis
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 130743    
Bug Blocks:    
Attachments:
Description Flags
patch
slewis: review-
reworked patch andersca: review+

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