Changeset 164015 in webkit


Ignore:
Timestamp:
Feb 12, 2014, 10:04:36 PM (12 years ago)
Author:
Antti Koivisto
Message:

Return immediately from DestroyPlugin IPC call
https://bugs.webkit.org/show_bug.cgi?id=128712

Reviewed by Anders Carlsson.

In some cases we spend a lot of time waiting for synchronous IPC for plugin termination to complete. Reduce
the delay by returning from IPC immediately when the plugin process receives it. Just using asynchrounous
IPC might introduce undesirable arbitrary delay between the IPC call returning and the destruction actually
starting.

  • PluginProcess/WebProcessConnection.cpp:

(WebKit::WebProcessConnection::destroyPlugin):

  • PluginProcess/WebProcessConnection.h:
  • PluginProcess/WebProcessConnection.messages.in:
Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r164010 r164015  
     12014-02-12  Antti Koivisto  <antti@apple.com>
     2
     3        Return immediately from DestroyPlugin IPC call
     4        https://bugs.webkit.org/show_bug.cgi?id=128712
     5
     6        Reviewed by Anders Carlsson.
     7       
     8        In some cases we spend a lot of time waiting for synchronous IPC for plugin termination to complete. Reduce
     9        the delay by returning from IPC immediately when the plugin process receives it. Just using asynchrounous
     10        IPC might introduce undesirable arbitrary delay between the IPC call returning and the destruction actually
     11        starting.
     12
     13        * PluginProcess/WebProcessConnection.cpp:
     14        (WebKit::WebProcessConnection::destroyPlugin):
     15        * PluginProcess/WebProcessConnection.h:
     16        * PluginProcess/WebProcessConnection.messages.in:
     17
    1182014-02-12  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/Source/WebKit2/PluginProcess/WebProcessConnection.cpp

    r163591 r164015  
    179179}
    180180
    181 void WebProcessConnection::destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete)
    182 {
     181void WebProcessConnection::destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete, PassRefPtr<Messages::WebProcessConnection::DestroyPlugin::DelayedReply> reply)
     182{
     183    // We return immediately from this synchronous IPC. We want to make sure the plugin destruction is just about to start so audio playback
     184    // will finish soon after returning. However we don't want to wait for destruction to complete fully as that may take a while.
     185    reply->send();
     186
    183187    // Ensure we don't clamp any timers during destruction
    184188    ActivityAssertion activityAssertion(PluginProcess::shared().connectionActivity());
  • trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h

    r162139 r164015  
    7373    void createPlugin(const PluginCreationParameters&, PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply>);
    7474    void createPluginAsynchronously(const PluginCreationParameters&);
    75     void destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete);
     75    void destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete, PassRefPtr<Messages::WebProcessConnection::DestroyPlugin::DelayedReply>);
    7676   
    7777    void createPluginInternal(const PluginCreationParameters&, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID);
  • trunk/Source/WebKit2/PluginProcess/WebProcessConnection.messages.in

    r156069 r164015  
    3131
    3232    # Destroys the plug-in instance with the given instance ID.
    33     DestroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete) -> ()
     33    DestroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete) -> () Delayed
    3434}
    3535
Note: See TracChangeset for help on using the changeset viewer.