Changeset 258180 in webkit
- Timestamp:
- Mar 9, 2020 6:17:09 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 13 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r258174 r258180 1 2020-03-09 Chris Dumez <cdumez@apple.com> 2 3 [iOS] Replace "unexpectedly resumed" observer with RunningBoard suspendible assertions 4 https://bugs.webkit.org/show_bug.cgi?id=205687 5 <rdar://problem/57890246> 6 7 Reviewed by Tim Horton. 8 9 Adopt new RunningBoard process assertion to indicate that WebContent processes depend on their 10 UIProcess (and therefore, the UIProcess must be running if the WebContent process is). This 11 replaces our "Unexpectedly resumed" assertion which was causing unexpected terminations in some 12 cases. 13 14 * Configurations/WebKit.xcconfig: 15 * Platform/spi/ios/RunningBoardServicesSPI.h: Added. 16 * Scripts/process-entitlements.sh: 17 * Shared/DependencyProcessAssertion.cpp: Added. 18 (WebKit::DependencyProcessAssertion::DependencyProcessAssertion): 19 (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion): 20 * Shared/DependencyProcessAssertion.h: Added. 21 * Shared/ios/DependencyProcessAssertionIOS.mm: Added. 22 (WebKit::DependencyProcessAssertion::DependencyProcessAssertion): 23 (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion): 24 * Sources.txt: 25 * SourcesCocoa.txt: 26 * UIProcess/Cocoa/WebProcessProxyCocoa.mm: 27 * UIProcess/WebProcessProxy.h: 28 * UIProcess/WebProcessProxy.messages.in: 29 * WebKit.xcodeproj/project.pbxproj: 30 * WebProcess/WebProcess.cpp: 31 (WebKit::WebProcess::initializeConnection): 32 * WebProcess/WebProcess.h: 33 * WebProcess/cocoa/WebProcessCocoa.mm: 34 1 35 2020-03-09 Per Arne Vollan <pvollan@apple.com> 2 36 -
trunk/Source/WebKit/Configurations/WebKit.xcconfig
r257085 r258180 51 51 WK_ASSERTION_SERVICES_LDFLAGS = $(WK_ASSERTION_SERVICES_LDFLAGS_$(WK_COCOA_TOUCH)); 52 52 WK_ASSERTION_SERVICES_LDFLAGS_cocoatouch = -framework AssertionServices; 53 54 WK_RUNNINGBOARD_SERVICES_LDFLAGS = $(WK_RUNNINGBOARD_SERVICES_LDFLAGS_$(WK_COCOA_TOUCH)); 55 WK_RUNNINGBOARD_SERVICES_LDFLAGS_cocoatouch = -framework RunningBoardServices; 53 56 54 57 WK_CARBON_LDFLAGS = $(WK_CARBON_LDFLAGS_$(WK_PLATFORM_NAME)); … … 121 124 WK_AUTHKIT_LDFLAGS_MACOS_SINCE_1015 = -framework AuthKit; 122 125 123 FRAMEWORK_AND_LIBRARY_LDFLAGS = -lobjc -framework CFNetwork -framework CoreAudio -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework IOKit -framework IOSurface -framework WebKitLegacy -lnetwork $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_ASSERTION_SERVICES_LDFLAGS) $(WK_ AUTHKIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_LIBSANDBOX_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(WK_SAFE_BROWSING_LDFLAGS) $(WK_SECURITY_INTERFACE_LDFLAGS) $(WK_UIKIT_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS) $(WK_WEBINSPECTORUI_LDFLAGS);126 FRAMEWORK_AND_LIBRARY_LDFLAGS = -lobjc -framework CFNetwork -framework CoreAudio -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework IOKit -framework IOSurface -framework WebKitLegacy -lnetwork $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_ASSERTION_SERVICES_LDFLAGS) $(WK_RUNNINGBOARD_SERVICES_LDFLAGS) $(WK_AUTHKIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_LIBSANDBOX_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(WK_SAFE_BROWSING_LDFLAGS) $(WK_SECURITY_INTERFACE_LDFLAGS) $(WK_UIKIT_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS) $(WK_WEBINSPECTORUI_LDFLAGS); 124 127 125 128 // Prevent C++ standard library basic_stringstream, operator new, delete and their related exception types from being exported as weak symbols. -
trunk/Source/WebKit/Scripts/process-entitlements.sh
r258013 r258180 141 141 plistbuddy Add :com.apple.private.webinspector.allow-remote-inspection bool YES 142 142 plistbuddy Add :com.apple.private.webinspector.proxy-application bool YES 143 plistbuddy Add :com.apple.runningboard.assertions.webkit bool YES 143 144 plistbuddy Add :dynamic-codesigning bool YES 144 145 -
trunk/Source/WebKit/Shared/DependencyProcessAssertion.h
r258178 r258180 1 1 /* 2 * Copyright (C) 20 11 Benjamin Poulain <benjamin@webkit.org>2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "WebEvent.h"29 30 #i f ENABLE(TOUCH_EVENTS)28 #include <wtf/ProcessID.h> 29 #include <wtf/RetainPtr.h> 30 #include <wtf/text/ASCIILiteral.h> 31 31 32 32 #if PLATFORM(IOS_FAMILY) 33 #if defined(__OBJC__) 34 #include <UIKit/UIKit.h> 35 struct _UIWebTouchEvent; 33 OBJC_CLASS RBSAssertion; 36 34 #endif 37 #elif PLATFORM(GTK)38 #include <WebCore/GUniquePtrGtk.h>39 #elif USE(LIBWPE)40 #include <wpe/wpe.h>41 #endif42 43 #endif // ENABLE(TOUCH_EVENTS)44 35 45 36 namespace WebKit { 46 37 47 #if ENABLE(TOUCH_EVENTS) 48 49 class NativeWebTouchEvent : public WebTouchEvent { 38 class DependencyProcessAssertion { 39 WTF_MAKE_FAST_ALLOCATED; 50 40 public: 51 #if PLATFORM(IOS_FAMILY) 52 #if defined(__OBJC__) 53 explicit NativeWebTouchEvent(const _UIWebTouchEvent*, UIKeyModifierFlags); 54 #endif 55 #elif PLATFORM(GTK) 56 NativeWebTouchEvent(GdkEvent*, Vector<WebPlatformTouchPoint>&&); 57 NativeWebTouchEvent(const NativeWebTouchEvent&); 58 const GdkEvent* nativeEvent() const { return m_nativeEvent.get(); } 59 #elif USE(LIBWPE) 60 NativeWebTouchEvent(struct wpe_input_touch_event*, float deviceScaleFactor); 61 const struct wpe_input_touch_event_raw* nativeFallbackTouchPoint() const { return &m_fallbackTouchPoint; } 62 #elif PLATFORM(WIN) 63 NativeWebTouchEvent(); 64 #endif 41 DependencyProcessAssertion(ProcessID targetPID, ASCIILiteral description); 42 ~DependencyProcessAssertion(); 65 43 66 44 private: 67 #if PLATFORM(IOS_FAMILY) && defined(__OBJC__) 68 Vector<WebPlatformTouchPoint> extractWebTouchPoint(const _UIWebTouchEvent*); 69 #endif 70 71 #if PLATFORM(GTK) 72 GUniquePtr<GdkEvent> m_nativeEvent; 73 #elif USE(LIBWPE) 74 struct wpe_input_touch_event_raw m_fallbackTouchPoint; 45 #if PLATFORM(IOS_FAMILY) 46 RetainPtr<RBSAssertion> m_assertion; 75 47 #endif 76 48 }; 77 49 78 #endif // ENABLE(TOUCH_EVENTS)79 80 #if PLATFORM(IOS_FAMILY) && defined(__OBJC__)81 OptionSet<WebEvent::Modifier> webEventModifierFlags(UIKeyModifierFlags);82 #endif83 84 50 } // namespace WebKit -
trunk/Source/WebKit/Shared/NativeWebTouchEvent.h
r255189 r258180 28 28 #include "WebEvent.h" 29 29 30 #if PLATFORM(IOS_FAMILY) && defined(__OBJC__) 31 #include <UIKit/UIKit.h> 32 #endif 33 30 34 #if ENABLE(TOUCH_EVENTS) 31 35 32 36 #if PLATFORM(IOS_FAMILY) 33 37 #if defined(__OBJC__) 34 #include <UIKit/UIKit.h>35 38 struct _UIWebTouchEvent; 36 39 #endif -
trunk/Source/WebKit/Sources.txt
r258122 r258180 157 157 Shared/ContextMenuContextData.cpp 158 158 Shared/DebuggableInfoData.cpp 159 Shared/DependencyProcessAssertion.cpp 159 160 Shared/EditingRange.cpp 160 161 Shared/EditorState.cpp -
trunk/Source/WebKit/SourcesCocoa.txt
r258109 r258180 175 175 176 176 Shared/ios/AuxiliaryProcessIOS.mm 177 Shared/ios/DependencyProcessAssertionIOS.mm 177 178 Shared/ios/InteractionInformationAtPosition.mm 178 179 Shared/ios/InteractionInformationRequest.cpp -
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm
r258064 r258180 195 195 #endif 196 196 197 #if PLATFORM(IOS_FAMILY)198 void WebProcessProxy::processWasResumed(CompletionHandler<void()>&& completionHandler)199 {200 CompletionHandlerCallingScope exitScope(WTFMove(completionHandler));201 202 if (m_throttler.shouldBeRunnable()) {203 // The process becoming unsuspended was not unexpected.204 return;205 }206 207 // The WebProcess was awakened by something other than the UIProcess. Take out an assertion for a208 // limited duration to allow whatever task needs to be accomplished time to complete.209 RELEASE_LOG(ProcessSuspension, "%p - WebProcessProxy::processWasResumed() Process was unexpectedly resumed, starting background activity", this);210 auto backgroundActivityTimeoutHandler = [activity = m_throttler.backgroundActivity("WebProcess was unexpectedly resumed"_s), weakThis = makeWeakPtr(this)] {211 RELEASE_LOG(ProcessSuspension, "%p - WebProcessProxy::processWasResumed() - lambda, background activity timed out", weakThis.get());212 };213 m_unexpectedActivityTimer = makeUnique<WebCore::DeferrableOneShotTimer>(WTFMove(backgroundActivityTimeoutHandler), unexpectedActivityDuration);214 }215 #endif216 217 197 #if ENABLE(REMOTE_INSPECTOR) 218 198 void WebProcessProxy::enableRemoteInspectorIfNeeded() -
trunk/Source/WebKit/UIProcess/WebProcessProxy.h
r258064 r258180 342 342 #endif 343 343 344 #if PLATFORM(IOS_FAMILY)345 void processWasResumed(CompletionHandler<void()>&&);346 #endif347 348 344 void webPageMediaStateDidChange(WebPageProxy&); 349 345 … … 532 528 ForegroundWebProcessToken m_foregroundToken; 533 529 BackgroundWebProcessToken m_backgroundToken; 534 #if PLATFORM(IOS_FAMILY)535 std::unique_ptr<WebCore::DeferrableOneShotTimer> m_unexpectedActivityTimer;536 #endif537 530 538 531 #if PLATFORM(COCOA) -
trunk/Source/WebKit/UIProcess/WebProcessProxy.messages.in
r255189 r258180 73 73 #endif 74 74 75 #if PLATFORM(IOS_FAMILY)76 ProcessWasResumed() -> () Async77 #endif78 79 75 # Plug-in messages. 80 76 void AddPlugInAutoStartOriginHash(String pageOrigin, uint32_t hash) -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r258122 r258180 953 953 46CE3B1123D8C8490016A96A /* WebBackForwardListCounts.h in Headers */ = {isa = PBXBuildFile; fileRef = 46CE3B1023D8C83D0016A96A /* WebBackForwardListCounts.h */; }; 954 954 46DF063C1F3905F8001980BB /* NetworkCORSPreflightChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DF063A1F3905E5001980BB /* NetworkCORSPreflightChecker.h */; }; 955 46F38E8C2416E6730059375A /* RunningBoardServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 46F38E8B2416E66D0059375A /* RunningBoardServicesSPI.h */; }; 955 956 46F9B26323526EF3006FE5FA /* WebBackForwardCacheEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 46F9B26223526ED0006FE5FA /* WebBackForwardCacheEntry.h */; }; 956 957 4960A3BD23C52AFD00961842 /* WebViewCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4960A3BC23C5286400961842 /* WebViewCategory.h */; }; … … 3553 3554 46DF06391F3905E5001980BB /* NetworkCORSPreflightChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCORSPreflightChecker.cpp; sourceTree = "<group>"; }; 3554 3555 46DF063A1F3905E5001980BB /* NetworkCORSPreflightChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCORSPreflightChecker.h; sourceTree = "<group>"; }; 3556 46F38E882416D9630059375A /* DependencyProcessAssertion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DependencyProcessAssertion.cpp; sourceTree = "<group>"; }; 3557 46F38E892416D9630059375A /* DependencyProcessAssertion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DependencyProcessAssertion.h; sourceTree = "<group>"; }; 3558 46F38E8A2416D9A70059375A /* DependencyProcessAssertionIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DependencyProcessAssertionIOS.mm; path = ios/DependencyProcessAssertionIOS.mm; sourceTree = "<group>"; }; 3559 46F38E8B2416E66D0059375A /* RunningBoardServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunningBoardServicesSPI.h; sourceTree = "<group>"; }; 3555 3560 46F9B26223526ED0006FE5FA /* WebBackForwardCacheEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardCacheEntry.h; sourceTree = "<group>"; }; 3556 3561 4960A3BC23C5286400961842 /* WebViewCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebViewCategory.h; sourceTree = "<group>"; }; … … 5966 5971 99036AE823A970870000B06A /* DebuggableInfoData.cpp */, 5967 5972 99036AE723A970870000B06A /* DebuggableInfoData.h */, 5973 46F38E882416D9630059375A /* DependencyProcessAssertion.cpp */, 5974 46F38E892416D9630059375A /* DependencyProcessAssertion.h */, 5968 5975 2D7FD190223C730F007887F1 /* DocumentEditingContext.h */, 5969 5976 2D7FD191223C7310007887F1 /* DocumentEditingContext.mm */, … … 6892 6899 children = ( 6893 6900 A7E93CEB192531AA00A1DC48 /* AuxiliaryProcessIOS.mm */, 6901 46F38E8A2416D9A70059375A /* DependencyProcessAssertionIOS.mm */, 6894 6902 2DA6731920C754B1003CB401 /* DynamicViewportSizeUpdate.h */, 6895 6903 2DA9449D1884E4F000ED86DB /* GestureTypes.h */, … … 10283 10291 3178AF9720E2A7F80074DE94 /* PDFKitSPI.h */, 10284 10292 2DC18FAF218912640025A88D /* PencilKitSPI.h */, 10293 46F38E8B2416E66D0059375A /* RunningBoardServicesSPI.h */, 10285 10294 CE1A0BD01A48E6C60054EF74 /* TCCSPI.h */, 10286 10295 CE1A0BD11A48E6C60054EF74 /* TextInputSPI.h */, … … 10976 10985 1A30066E1110F4F70031937C /* ResponsivenessTimer.h in Headers */, 10977 10986 410482CE1DDD324F00F006D0 /* RTCNetwork.h in Headers */, 10987 46F38E8C2416E6730059375A /* RunningBoardServicesSPI.h in Headers */, 10978 10988 0E97D74D200E900400BF6643 /* SafeBrowsingSPI.h in Headers */, 10979 10989 5CA9854A210BEB640057EB6B /* SafeBrowsingWarning.h in Headers */, -
trunk/Source/WebKit/WebProcess/WebProcess.cpp
r258160 r258180 32 32 #include "AuthenticationManager.h" 33 33 #include "AuxiliaryProcessMessages.h" 34 #include "DependencyProcessAssertion.h" 34 35 #include "DrawingArea.h" 35 36 #include "EventDispatcher.h" … … 187 188 #define RELEASE_LOG_SESSION_ID (m_sessionID ? m_sessionID->toUInt64() : 0) 188 189 #define RELEASE_LOG_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__) 190 #define RELEASE_LOG_ERROR_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__) 189 191 190 192 // This should be less than plugInAutoStartExpirationTimeThreshold in PlugInAutoStartProvider. … … 296 298 #if PLATFORM(IOS_FAMILY) 297 299 m_viewUpdateDispatcher->initializeConnection(connection); 300 301 ASSERT(!m_uiProcessDependencyProcessAssertion); 302 if (auto remoteProcessID = connection->remoteProcessID()) 303 m_uiProcessDependencyProcessAssertion = makeUnique<DependencyProcessAssertion>(remoteProcessID, "WebContent process dependency on UIProcess"_s); 304 else 305 RELEASE_LOG_ERROR_IF_ALLOWED(ProcessSuspension, "Unable to create a process depending assertion on UIProcess because remoteProcessID is 0"); 298 306 #endif // PLATFORM(IOS_FAMILY) 307 299 308 m_webInspectorInterruptDispatcher->initializeConnection(connection); 300 309 … … 307 316 308 317 m_webConnection = WebConnectionToUIProcess::create(this); 309 310 #if PLATFORM(IOS_FAMILY)311 // Make sure we have an IPC::Connection before creating the ProcessTaskStateObserver since it may call312 // WebProcess::processTaskStateDidChange() on a background thread and deference the IPC connection.313 m_taskStateObserver = ProcessTaskStateObserver::create(*this);314 #endif315 318 } 316 319 … … 2045 2048 #undef RELEASE_LOG_SESSION_ID 2046 2049 #undef RELEASE_LOG_IF_ALLOWED 2050 #undef RELEASE_LOG_ERROR_IF_ALLOWED -
trunk/Source/WebKit/WebProcess/WebProcess.h
r258064 r258180 67 67 #endif 68 68 69 #if PLATFORM(IOS_FAMILY)70 #include "ProcessTaskStateObserver.h"71 OBJC_CLASS BKSProcessAssertion;72 #endif73 74 69 #if PLATFORM(WAYLAND) && USE(WPE_RENDERER) 75 70 #include <WebCore/PlatformDisplayLibWPE.h> … … 107 102 namespace WebKit { 108 103 104 class DependencyProcessAssertion; 109 105 class EventDispatcher; 110 106 class GamepadData; … … 143 139 #endif 144 140 145 class WebProcess 146 : public AuxiliaryProcess 147 #if PLATFORM(IOS_FAMILY) 148 , ProcessTaskStateObserver::Client 149 #endif 141 class WebProcess : public AuxiliaryProcess 150 142 { 151 143 WTF_MAKE_FAST_ALLOCATED; … … 502 494 503 495 #if PLATFORM(IOS_FAMILY) 504 void processTaskStateDidChange(ProcessTaskStateObserver::TaskState) final;505 496 bool shouldFreezeOnSuspension() const; 506 497 void updateFreezerStatus(); 507 508 void releaseProcessWasResumedAssertions();509 498 #endif 510 499 … … 594 583 #if PLATFORM(IOS_FAMILY) 595 584 WebSQLiteDatabaseTracker m_webSQLiteDatabaseTracker; 596 RefPtr<ProcessTaskStateObserver> m_taskStateObserver; 597 Lock m_processWasResumedAssertionsLock; 598 RetainPtr<BKSProcessAssertion> m_processWasResumedUIAssertion; 599 RetainPtr<BKSProcessAssertion> m_processWasResumedOwnAssertion; 585 std::unique_ptr<DependencyProcessAssertion> m_uiProcessDependencyProcessAssertion; 600 586 #endif 601 587 -
trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
r258168 r258180 101 101 #import "AccessibilitySupportSPI.h" 102 102 #import "AssertionServicesSPI.h" 103 #import "RunningBoardServicesSPI.h" 103 104 #import "UserInterfaceIdiom.h" 104 105 #import "WKAccessibilityWebPageObjectIOS.h" … … 377 378 378 379 #if PLATFORM(IOS_FAMILY) 379 void WebProcess::processTaskStateDidChange(ProcessTaskStateObserver::TaskState taskState)380 {381 // NOTE: This will be called from a background thread.382 RELEASE_LOG(ProcessSuspension, "%p - WebProcess::processTaskStateDidChange() - taskState(%d)", this, taskState);383 if (taskState != ProcessTaskStateObserver::Running)384 return;385 386 LockHolder holder(m_processWasResumedAssertionsLock);387 if (m_processWasResumedUIAssertion && m_processWasResumedOwnAssertion)388 return;389 390 // We were awakened from suspension unexpectedly. Notify the WebProcessProxy, but take a process assertion on our parent PID391 // to ensure that it too is awakened.392 RELEASE_LOG(ProcessSuspension, "%p - WebProcess::processTaskStateChanged() Taking 'WebProcess was resumed' assertion on behalf on UIProcess", this);393 m_processWasResumedUIAssertion = adoptNS([[BKSProcessAssertion alloc] initWithPID:parentProcessConnection()->remoteProcessID() flags:BKSProcessAssertionPreventTaskSuspend reason:BKSProcessAssertionReasonFinishTask name:@"WebProcess was resumed" withHandler:^(BOOL acquired) {394 if (!acquired)395 RELEASE_LOG_ERROR(ProcessSuspension, "%p - WebProcess::processTaskStateDidChange() failed to take 'WebProcess was resumed' assertion for parent process", this);396 }]);397 m_processWasResumedUIAssertion.get().invalidationHandler = [this] {398 RELEASE_LOG_ERROR(ProcessSuspension, "%p - WebProcess::processTaskStateChanged() Releasing 'WebProcess was resumed' assertion on behalf on UIProcess due to invalidation", this);399 releaseProcessWasResumedAssertions();400 };401 m_processWasResumedOwnAssertion = adoptNS([[BKSProcessAssertion alloc] initWithPID:getpid() flags:BKSProcessAssertionPreventTaskSuspend reason:BKSProcessAssertionReasonFinishTask name:@"WebProcess was resumed" withHandler:^(BOOL acquired) {402 if (!acquired)403 RELEASE_LOG_ERROR(ProcessSuspension, "%p - WebProcess::processTaskStateDidChange() failed to take 'WebProcess was resumed' assertion for WebContent process", this);404 }]);405 m_processWasResumedOwnAssertion.get().invalidationHandler = [this] {406 RELEASE_LOG_ERROR(ProcessSuspension, "%p - WebProcess::processTaskStateChanged() Releasing 'WebProcess was resumed' assertion on behalf on WebContent process due to invalidation", this);407 releaseProcessWasResumedAssertions();408 };409 410 parentProcessConnection()->sendWithAsyncReply(Messages::WebProcessProxy::ProcessWasResumed(), [this] {411 RELEASE_LOG(ProcessSuspension, "%p - WebProcess::processTaskStateDidChange() Parent process handled ProcessWasResumed IPC, releasing our assertions", this);412 releaseProcessWasResumedAssertions();413 });414 }415 416 void WebProcess::releaseProcessWasResumedAssertions()417 {418 LockHolder holder(m_processWasResumedAssertionsLock);419 if (m_processWasResumedUIAssertion) {420 RELEASE_LOG(ProcessSuspension, "%p - WebProcess::releaseProcessWasResumedAssertions() Releasing parent process 'WebProcess was resumed' assertion", this);421 [m_processWasResumedUIAssertion invalidate];422 m_processWasResumedUIAssertion = nullptr;423 }424 if (m_processWasResumedOwnAssertion) {425 RELEASE_LOG(ProcessSuspension, "%p - WebProcess::releaseProcessWasResumedAssertions() Releasing WebContent process 'WebProcess was resumed' assertion", this);426 [m_processWasResumedOwnAssertion invalidate];427 m_processWasResumedOwnAssertion = nullptr;428 }429 }430 431 #endif432 433 #if PLATFORM(IOS_FAMILY)434 380 static NSString *webProcessLoaderAccessibilityBundlePath() 435 381 {
Note: See TracChangeset
for help on using the changeset viewer.