Changeset 231771 in webkit
- Timestamp:
- May 14, 2018 3:31:40 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r231770 r231771 1 2018-05-14 Chris Dumez <cdumez@apple.com> 2 3 Overly aggressive timer throttling in service workers 4 https://bugs.webkit.org/show_bug.cgi?id=185575 5 <rdar://problem/40219038> 6 7 Reviewed by Geoff Garen. 8 9 After ~30 seconds, the system would put the service worker process in "App Nap", 10 causing its timers to get aggressively throttled. This happens because the 11 service worker processes are WebProcesses that have no visible WebPages. 12 13 To address the issue, we now disable process suppression for all service worker 14 processes. This causes those processes to construct a UserActivity which prevents 15 App Nap. 16 17 This patch also refactors the code a bit to avoid duplication. The ProcessSuppression 18 suppression logic in now all on ChildProcessProxy / ChildProcess. 19 20 * NetworkProcess/NetworkProcess.messages.in: 21 * PluginProcess/PluginProcess.messages.in: 22 * Shared/ChildProcess.messages.in: 23 * UIProcess/ChildProcessProxy.cpp: 24 (WebKit::ChildProcessProxy::setProcessSuppressionEnabled): 25 * UIProcess/ChildProcessProxy.h: 26 * UIProcess/Network/NetworkProcessProxy.h: 27 * UIProcess/Network/mac/NetworkProcessProxyMac.mm: Removed. 28 * UIProcess/Plugins/PluginProcessProxy.h: 29 * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: 30 * UIProcess/ServiceWorkerProcessProxy.cpp: 31 (WebKit::ServiceWorkerProcessProxy::didFinishLaunching): 32 * UIProcess/ServiceWorkerProcessProxy.h: 33 * UIProcess/WebProcessProxy.h: 34 * WebKit.xcodeproj/project.pbxproj: 35 * WebProcess/WebProcess.messages.in: 36 1 37 2018-05-14 Andy Estes <aestes@apple.com> 2 38 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r231536 r231771 53 53 ContinueDecidePendingDownloadDestination(WebKit::DownloadID downloadID, String destination, WebKit::SandboxExtension::Handle sandboxExtensionHandle, bool allowOverwrite) 54 54 55 SetProcessSuppressionEnabled(bool flag)56 55 #if PLATFORM(COCOA) 57 56 SetQOS(int latencyQOS, int throughputQOS) -
trunk/Source/WebKit/PluginProcess/PluginProcess.messages.in
r226349 r231771 39 39 DeleteWebsiteDataForHostNames(Vector<String> hostNames, uint64_t callbackID) 40 40 41 SetProcessSuppressionEnabled(bool flag)42 41 #if PLATFORM(COCOA) 43 42 SetQOS(int latencyQOS, int throughputQOS) -
trunk/Source/WebKit/Shared/ChildProcess.messages.in
r226088 r231771 24 24 ShutDown() 25 25 RegisterURLSchemeServiceWorkersCanHandle(String scheme) 26 SetProcessSuppressionEnabled(bool flag) 26 27 } -
trunk/Source/WebKit/UIProcess/ChildProcessProxy.cpp
r230084 r231771 214 214 } 215 215 216 void ChildProcessProxy::setProcessSuppressionEnabled(bool processSuppressionEnabled) 217 { 218 #if PLATFORM(COCOA) 219 if (state() != State::Running) 220 return; 221 222 connection()->send(Messages::ChildProcess::SetProcessSuppressionEnabled(processSuppressionEnabled), 0); 223 #else 224 UNUSED_PARAM(processSuppressionEnabled); 225 #endif 226 } 227 216 228 void ChildProcessProxy::connectionWillOpen(IPC::Connection&) 217 229 { -
trunk/Source/WebKit/UIProcess/ChildProcessProxy.h
r226308 r231771 84 84 WebCore::ProcessIdentifier coreProcessIdentifier() const { return m_processIdentifier; } 85 85 86 void setProcessSuppressionEnabled(bool); 87 86 88 protected: 87 89 // ProcessLauncher::Client -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
r231536 r231771 76 76 void deleteWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType>, WallTime modifiedSince, WTF::Function<void()>&& completionHandler); 77 77 void deleteWebsiteDataForOrigins(PAL::SessionID, OptionSet<WebKit::WebsiteDataType>, const Vector<WebCore::SecurityOriginData>& origins, const Vector<String>& cookieHostNames, WTF::Function<void()>&& completionHandler); 78 79 #if PLATFORM(COCOA)80 void setProcessSuppressionEnabled(bool);81 #endif82 78 83 79 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) -
trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h
r230293 r231771 84 84 85 85 bool isValid() const { return m_connection; } 86 87 #if PLATFORM(COCOA)88 void setProcessSuppressionEnabled(bool);89 90 #endif91 86 92 87 #if PLUGIN_ARCHITECTURE(UNIX) -
trunk/Source/WebKit/UIProcess/Plugins/mac/PluginProcessProxyMac.mm
r230468 r231771 231 231 } 232 232 233 void PluginProcessProxy::setProcessSuppressionEnabled(bool processSuppressionEnabled)234 {235 if (!isValid())236 return;237 238 m_connection->send(Messages::PluginProcess::SetProcessSuppressionEnabled(processSuppressionEnabled), 0);239 }240 241 233 static bool isFlashUpdater(const String& launchPath, const Vector<String>& arguments) 242 234 { -
trunk/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp
r230977 r231771 106 106 } 107 107 108 void ServiceWorkerProcessProxy::didFinishLaunching(ProcessLauncher* launcher, IPC::Connection::Identifier connectionIdentifier) 109 { 110 WebProcessProxy::didFinishLaunching(launcher, connectionIdentifier); 111 112 // Prevent App Nap for Service Worker processes. 113 // FIXME: Ideally, the Service Worker process would app nap when all its clients app nap (http://webkit.org/b/185626). 114 setProcessSuppressionEnabled(false); 115 } 116 108 117 } // namespace WebKit 109 118 -
trunk/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.h
r229979 r231771 55 55 void getLaunchOptions(ProcessLauncher::LaunchOptions&) final; 56 56 57 // ProcessLauncher::Client 58 void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) final; 59 57 60 bool isServiceWorkerProcess() const final { return true; } 58 61 -
trunk/Source/WebKit/UIProcess/WebProcessProxy.h
r231321 r231771 231 231 void processWillShutDown(IPC::Connection&) override; 232 232 233 // ProcessLauncher::Client 234 void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override; 235 233 236 private: 234 237 // Called when the web process has crashed or we know that it will terminate soon. … … 294 297 void didSetAssertionState(AssertionState) override; 295 298 296 // ProcessLauncher::Client297 void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override;298 299 299 // Implemented in generated WebProcessProxyMessageReceiver.cpp 300 300 void didReceiveWebProcessProxyMessage(IPC::Connection&, IPC::Decoder&); -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r231510 r231771 1075 1075 515E7728183DD6F60007203F /* AsyncRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 515E7726183DD6F60007203F /* AsyncRequest.h */; }; 1076 1076 5160BFE113381DF900918999 /* LoggingFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160BFE013381DF900918999 /* LoggingFoundation.mm */; }; 1077 516319921628980A00E22F00 /* NetworkProcessProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 516319911628980A00E22F00 /* NetworkProcessProxyMac.mm */; };1078 1077 5163199416289A6000E22F00 /* NetworkProcessMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ACC9341628064800342550 /* NetworkProcessMessageReceiver.cpp */; }; 1079 1078 5163199516289A6300E22F00 /* NetworkProcessMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ACC9351628064800342550 /* NetworkProcessMessages.h */; }; … … 2073 2072 CDC2831D201BD79D00E6E745 /* WKFullscreenStackView.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC2831B201BD79D00E6E745 /* WKFullscreenStackView.h */; }; 2074 2073 CDC2831E201BD79D00E6E745 /* WKFullscreenStackView.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC2831C201BD79D00E6E745 /* WKFullscreenStackView.mm */; }; 2075 CDC382FE17211799008A2FC3 /* SecItemShimLibrary.mm in Sources */ = {isa = PBXBuildFile; fileRef = 511F8A78138B460900A95F44 /* SecItemShimLibrary.mm */; };2076 2074 CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */; }; 2077 2075 CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */; }; … … 3490 3488 515E7726183DD6F60007203F /* AsyncRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncRequest.h; sourceTree = "<group>"; }; 3491 3489 5160BFE013381DF900918999 /* LoggingFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LoggingFoundation.mm; sourceTree = "<group>"; }; 3492 516319911628980A00E22F00 /* NetworkProcessProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NetworkProcessProxyMac.mm; path = mac/NetworkProcessProxyMac.mm; sourceTree = "<group>"; };3493 3490 5164C0941B05B757004F102A /* ChildProcess.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChildProcess.messages.in; sourceTree = "<group>"; }; 3494 3491 516A4A5B120A2CCD00C05B7F /* APIError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIError.h; sourceTree = "<group>"; }; … … 4606 4603 CDC2831C201BD79D00E6E745 /* WKFullscreenStackView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKFullscreenStackView.mm; path = ios/fullscreen/WKFullscreenStackView.mm; sourceTree = "<group>"; }; 4607 4604 CDC382F717211506008A2FC3 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = /System/Library/Frameworks/CFNetwork.framework; sourceTree = "<absolute>"; }; 4608 CDC3830617211799008A2FC3 /* WebProcessShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = WebProcessShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; };4609 4605 CDC8F4881725E67800166F6E /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; }; 4610 4606 CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKFullScreenWindowController.mm; sourceTree = "<group>"; }; … … 6590 6586 isa = PBXGroup; 6591 6587 children = ( 6592 516319911628980A00E22F00 /* NetworkProcessProxyMac.mm */,6593 6588 ); 6594 6589 name = mac; … … 10705 10700 E14A954916E016A40068DE82 /* NetworkProcessPlatformStrategies.cpp in Sources */, 10706 10701 5179556D162877B100FA43B6 /* NetworkProcessProxy.cpp in Sources */, 10707 516319921628980A00E22F00 /* NetworkProcessProxyMac.mm in Sources */,10708 10702 513A163C163088F6005D7D22 /* NetworkProcessProxyMessageReceiver.cpp in Sources */, 10709 10703 51FD18B51651FBAD00DBE1CE /* NetworkResourceLoader.cpp in Sources */, … … 11451 11445 runOnlyForDeploymentPostprocessing = 0; 11452 11446 }; 11453 CDC382FD17211799008A2FC3 /* Sources */ = {11454 isa = PBXSourcesBuildPhase;11455 buildActionMask = 2147483647;11456 files = (11457 CDC382FE17211799008A2FC3 /* SecItemShimLibrary.mm in Sources */,11458 );11459 runOnlyForDeploymentPostprocessing = 0;11460 };11461 11447 /* End PBXSourcesBuildPhase section */ 11462 11448 -
trunk/Source/WebKit/WebProcess/WebProcess.messages.in
r230640 r231771 85 85 86 86 SetHiddenPageDOMTimerThrottlingIncreaseLimit(int milliseconds) 87 SetProcessSuppressionEnabled(bool flag)88 87 #if PLATFORM(COCOA) 89 88 SetQOS(int latencyQOS, int throughputQOS)
Note: See TracChangeset
for help on using the changeset viewer.