Changeset 148038 in webkit
- Timestamp:
- Apr 9, 2013 12:48:01 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r148034 r148038 1 2013-04-08 Dean Jackson <dino@apple.com> 2 3 Don't create another plugin process for restarted plugins 4 https://bugs.webkit.org/show_bug.cgi?id=114233 5 6 Reviewed by Geoff Garen. 7 8 A snapshotting plugin starts in a separate process from 9 regular plugins. This can be a little confusing to users 10 because they might see two plugin processes. We can set 11 the minimum life and timeout on the snapshotting process 12 to much smaller values, since the process doesn't need 13 to live that long. This will reduce some potential 14 confusion. Also, since there is another plugin process 15 running real plugins, it should be paged in if it needs 16 to restart. 17 18 There was, however, a bug in the process management. A 19 restarted plugin received a special PluginProcess::Type, 20 so that it could cross fade into the page nicely. This 21 caused it to start a *third* plugin process. Instead 22 mark a restarted flag directly on the PluginProxy and 23 revert back to two process types. 24 25 * PluginProcess/PluginProcess.h: Remove TypeRestartedProcess. 26 27 * UIProcess/Plugins/PluginProcessProxy.cpp: Add two new 28 timeout values for snapshotting processes. 29 (WebKit::PluginProcessProxy::didFinishLaunching): Chose which 30 of the timeout pairs to use. 31 32 * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm: 33 (WebKit::PluginProxy::pluginLayer): Don't look at the process type, instead 34 look at the process flag to see if we are restarted. 35 * WebProcess/Plugins/PluginProxy.cpp: 36 (WebKit::PluginProxy::create): Copy the new flag into constructor. 37 (WebKit::PluginProxy::PluginProxy): Remember the flag. 38 * WebProcess/Plugins/PluginProxy.h: Add a new m_restartedProcess flag. 39 40 * WebProcess/WebPage/WebPage.cpp: 41 (WebKit::WebPage::createPlugin): When we are creating the proxy, separate 42 the concept of snapshotting and restarting. 43 1 44 2013-04-09 Tim Horton <timothy_horton@apple.com> 2 45 -
trunk/Source/WebKit2/PluginProcess/PluginProcess.h
r147579 r148038 45 45 // Start with value one since default HashTraits<> disallows zero as key. 46 46 TypeRegularProcess = 1, 47 TypeSnapshotProcess, 48 TypeRestartedProcess 47 TypeSnapshotProcess 49 48 }; 50 49 -
trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
r147138 r148038 49 49 50 50 static const double minimumLifetime = 2 * 60; 51 static const double snapshottingMinimumLifetime = 30; 52 51 53 static const double shutdownTimeout = 1 * 60; 54 static const double snapshottingShutdownTimeout = 15; 52 55 53 56 PassRefPtr<PluginProcessProxy> PluginProcessProxy::create(PluginProcessManager* PluginProcessManager, const PluginModuleInfo& pluginInfo, PluginProcess::Type processType) … … 201 204 PluginProcessCreationParameters parameters; 202 205 parameters.processType = m_processType; 203 parameters.minimumLifetime = minimumLifetime; 204 parameters.terminationTimeout = shutdownTimeout; 206 if (m_processType == PluginProcess::TypeSnapshotProcess) { 207 parameters.minimumLifetime = snapshottingMinimumLifetime; 208 parameters.terminationTimeout = snapshottingShutdownTimeout; 209 } else { 210 parameters.minimumLifetime = minimumLifetime; 211 parameters.terminationTimeout = shutdownTimeout; 212 } 205 213 platformInitializePluginProcess(parameters); 206 214 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm
r147579 r148038 55 55 [m_pluginLayer.get() setGeometryFlipped:YES]; 56 56 57 if (m_ processType == PluginProcess::TypeRestartedProcess) {57 if (m_isRestartedProcess) { 58 58 CABasicAnimation *fadeInAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; 59 59 fadeInAnimation.fromValue = [NSNumber numberWithFloat:0]; -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
r147253 r148038 57 57 } 58 58 59 PassRefPtr<PluginProxy> PluginProxy::create(const String& pluginPath, PluginProcess::Type processType )60 { 61 return adoptRef(new PluginProxy(pluginPath, processType ));62 } 63 64 PluginProxy::PluginProxy(const String& pluginPath, PluginProcess::Type processType )59 PassRefPtr<PluginProxy> PluginProxy::create(const String& pluginPath, PluginProcess::Type processType, bool isRestartedProcess) 60 { 61 return adoptRef(new PluginProxy(pluginPath, processType, isRestartedProcess)); 62 } 63 64 PluginProxy::PluginProxy(const String& pluginPath, PluginProcess::Type processType, bool isRestartedProcess) 65 65 : m_pluginPath(pluginPath) 66 66 , m_pluginInstanceID(generatePluginInstanceID()) … … 72 72 , m_waitingOnAsynchronousInitialization(false) 73 73 , m_processType(processType) 74 , m_isRestartedProcess(isRestartedProcess) 74 75 { 75 76 } -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
r145477 r148038 57 57 class PluginProxy : public Plugin { 58 58 public: 59 static PassRefPtr<PluginProxy> create(const String& pluginPath, PluginProcess::Type );59 static PassRefPtr<PluginProxy> create(const String& pluginPath, PluginProcess::Type, bool isRestartedProcess); 60 60 ~PluginProxy(); 61 61 … … 69 69 70 70 private: 71 explicit PluginProxy(const String& pluginPath, PluginProcess::Type );71 explicit PluginProxy(const String& pluginPath, PluginProcess::Type, bool isRestartedProcess); 72 72 73 73 // Plugin … … 219 219 220 220 PluginProcess::Type m_processType; 221 bool m_isRestartedProcess; 221 222 }; 222 223 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r148000 r148038 560 560 #if ENABLE(PLUGIN_PROCESS) 561 561 562 PluginProcess::Type processType = PluginProcess::TypeRegularProcess; 563 if (pluginElement->displayState() == HTMLPlugInElement::WaitingForSnapshot) 564 processType = PluginProcess::TypeSnapshotProcess; 565 else if (pluginElement->displayState() == HTMLPlugInElement::Restarting || pluginElement->displayState() == HTMLPlugInElement::RestartingWithPendingMouseClick) 566 processType = PluginProcess::TypeRestartedProcess; 567 return PluginProxy::create(pluginPath, processType); 562 PluginProcess::Type processType = (pluginElement->displayState() == HTMLPlugInElement::WaitingForSnapshot ? PluginProcess::TypeSnapshotProcess : PluginProcess::TypeRegularProcess); 563 bool isRestartedProcess = (pluginElement->displayState() == HTMLPlugInElement::Restarting || pluginElement->displayState() == HTMLPlugInElement::RestartingWithPendingMouseClick); 564 return PluginProxy::create(pluginPath, processType, isRestartedProcess); 568 565 #else 569 566 NetscapePlugin::setSetExceptionFunction(NPRuntimeObjectMap::setGlobalException);
Note: See TracChangeset
for help on using the changeset viewer.