[webkit-reviews] review granted: [Bug 130694] Track plugin in visibility in the plugin process. : [Attachment 227803] take 2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 28 14:17:11 PDT 2014


Anders Carlsson <andersca at apple.com> has granted Stephanie Lewis
<slewis at apple.com>'s request for review:
Bug 130694: Track plugin in visibility in the plugin process.
https://bugs.webkit.org/show_bug.cgi?id=130694

Attachment 227803: take 2
https://bugs.webkit.org/attachment.cgi?id=227803&action=review

------- Additional Comments from Anders Carlsson <andersca at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=227803&action=review


> Source/WebKit2/PluginProcess/WebProcessConnection.cpp:331
> +    bool oldState = m_visiblePluginInstanceIDs.isEmpty();

Can you ASSERT(!m_visiblePluginInstanceIDs.contains(pluginInstanceID))?

> Source/WebKit2/PluginProcess/WebProcessConnection.cpp:346
> +    if (m_visiblePluginInstanceIDs.contains(pluginInstanceID))
> +	   m_visiblePluginInstanceIDs.remove(pluginInstanceID);

remove is just a no-op if the set doesn't contain the plug-in instance so
there's no need to do a .contains check here.

Can you assert that m_visiblePluginInstanceIDs.contains(pluginInstanceID)
always returns true here?

> Source/WebKit2/PluginProcess/WebProcessConnection.h:58
> +    void pluginDidBecomeVisible(unsigned pluginInstanceId);
> +    void pluginDidBecomeHidden(unsigned pluginInstanceId);

Capital d in ID.

> Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm:109
> +    printf("Visibility changed  to %d for plugin %llu from %d\n", isVisible,
m_pluginInstanceID, getpid());

Please remove this.

> Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm:111
> +    isVisible ? m_connection->pluginDidBecomeVisible(m_pluginInstanceID) :
m_connection->pluginDidBecomeHidden(m_pluginInstanceID);

I think an if statement is cleaner than a ternary operator here.


More information about the webkit-reviews mailing list