Changeset 259674 in webkit


Ignore:
Timestamp:
Apr 7, 2020 3:09:36 PM (4 years ago)
Author:
Chris Dumez
Message:

Merge DependencyAssertion into ProcessAssertion
https://bugs.webkit.org/show_bug.cgi?id=210076

Reviewed by Alex Christensen.

Source/WebKit:

Merge DependencyAssertion into ProcessAssertion. After r259610, ProcessAssertion can use
RunningBoard assertions so there is no longer any need to a separate DependencyAssertion
class. We can simply introduce a new assertion type to ProcessAssertion.

  • Shared/DependencyProcessAssertion.cpp: Removed.
  • Shared/DependencyProcessAssertion.h: Removed.
  • Shared/ios/DependencyProcessAssertionIOS.mm: Removed.
  • Sources.txt:
  • SourcesCocoa.txt:
  • UIProcess/ProcessAssertion.h:
  • UIProcess/ios/ProcessAssertionIOS.mm:

(-[WKProcessAssertionBackgroundTaskManager init]):
(-[WKProcessAssertionBackgroundTaskManager _hasBackgroundTask]):
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
(-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
(WebKit::runningBoardNameForAssertionType):

  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::initializeConnection):

  • WebProcess/WebProcess.h:

Source/WTF:

  • wtf/PlatformHave.h:
Location:
trunk/Source
Files:
3 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r259652 r259674  
     12020-04-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Merge DependencyAssertion into ProcessAssertion
     4        https://bugs.webkit.org/show_bug.cgi?id=210076
     5
     6        Reviewed by Alex Christensen.
     7
     8        * wtf/PlatformHave.h:
     9
    1102020-04-07  Saam Barati  <sbarati@apple.com>
    211
  • trunk/Source/WTF/wtf/PlatformHave.h

    r259414 r259674  
    460460    || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
    461461    || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
    462 #define HAVE_RUNNINGBOARD_WEBKIT_ASSERTIONS 1
     462#define HAVE_RUNNINGBOARD_VISIBILITY_ASSERTIONS 1
    463463#endif
    464464
  • trunk/Source/WebKit/ChangeLog

    r259673 r259674  
     12020-04-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Merge DependencyAssertion into ProcessAssertion
     4        https://bugs.webkit.org/show_bug.cgi?id=210076
     5
     6        Reviewed by Alex Christensen.
     7
     8        Merge DependencyAssertion into ProcessAssertion. After r259610, ProcessAssertion can use
     9        RunningBoard assertions so there is no longer any need to a separate DependencyAssertion
     10        class. We can simply introduce a new assertion type to ProcessAssertion.
     11
     12        * Shared/DependencyProcessAssertion.cpp: Removed.
     13        * Shared/DependencyProcessAssertion.h: Removed.
     14        * Shared/ios/DependencyProcessAssertionIOS.mm: Removed.
     15        * Sources.txt:
     16        * SourcesCocoa.txt:
     17        * UIProcess/ProcessAssertion.h:
     18        * UIProcess/ios/ProcessAssertionIOS.mm:
     19        (-[WKProcessAssertionBackgroundTaskManager init]):
     20        (-[WKProcessAssertionBackgroundTaskManager _hasBackgroundTask]):
     21        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
     22        (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
     23        (WebKit::runningBoardNameForAssertionType):
     24        * WebKit.xcodeproj/project.pbxproj:
     25        * WebProcess/WebProcess.cpp:
     26        (WebKit::WebProcess::initializeConnection):
     27        * WebProcess/WebProcess.h:
     28
    1292020-04-07  Alex Christensen  <achristensen@webkit.org>
    230
  • trunk/Source/WebKit/Sources.txt

    r259307 r259674  
    157157Shared/ContextMenuContextData.cpp
    158158Shared/DebuggableInfoData.cpp
    159 Shared/DependencyProcessAssertion.cpp
    160159Shared/EditingRange.cpp
    161160Shared/EditorState.cpp
  • trunk/Source/WebKit/SourcesCocoa.txt

    r258180 r259674  
    175175
    176176Shared/ios/AuxiliaryProcessIOS.mm
    177 Shared/ios/DependencyProcessAssertionIOS.mm
    178177Shared/ios/InteractionInformationAtPosition.mm
    179178Shared/ios/InteractionInformationRequest.cpp
  • trunk/Source/WebKit/UIProcess/ProcessAssertion.h

    r259610 r259674  
    5151    Foreground,
    5252    MediaPlayback,
     53    DependentProcessLink,
    5354};
    5455
  • trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp

    r259540 r259674  
    13681368    case ProcessAssertionType::MediaPlayback:
    13691369    case ProcessAssertionType::UnboundedNetworking:
     1370    case ProcessAssertionType::DependentProcessLink:
    13701371        ASSERT_NOT_REACHED();
    13711372    }
  • trunk/Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm

    r259635 r259674  
    4747
    4848@interface WKProcessAssertionBackgroundTaskManager
    49 #if HAVE(RUNNINGBOARD_WEBKIT_ASSERTIONS)
     49#if HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
    5050    : NSObject <RBSAssertionObserving>
    5151#else
     
    6262@implementation WKProcessAssertionBackgroundTaskManager
    6363{
    64 #if HAVE(RUNNINGBOARD_WEBKIT_ASSERTIONS)
     64#if HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
    6565    RetainPtr<RBSAssertion> _backgroundTask;
    6666#else
     
    8585        return nil;
    8686
    87 #if !HAVE(RUNNINGBOARD_WEBKIT_ASSERTIONS)
     87#if !HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
    8888    _backgroundTask = UIBackgroundTaskInvalid;
    8989#endif
     
    170170- (BOOL)_hasBackgroundTask
    171171{
    172 #if HAVE(RUNNINGBOARD_WEBKIT_ASSERTIONS)
     172#if HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
    173173    return !!_backgroundTask;
    174174#else
     
    185185        }
    186186        RELEASE_LOG(ProcessSuspension, "%p - WKProcessAssertionBackgroundTaskManager: beginBackgroundTaskWithName", self);
    187 #if HAVE(RUNNINGBOARD_WEBKIT_ASSERTIONS)
     187#if HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
    188188        RBSTarget *target = [RBSTarget currentProcess];
    189189        RBSDomainAttribute *domainAttribute = [RBSDomainAttribute attributeWithDomain:@"com.apple.common" name:@"FinishTaskInterruptable"];
     
    205205}
    206206
    207 #if HAVE(RUNNINGBOARD_WEBKIT_ASSERTIONS)
     207#if HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
    208208- (void)assertionWillInvalidate:(RBSAssertion *)assertion
    209209{
     
    254254        WebKit::WebProcessPool::notifyProcessPoolsApplicationIsAboutToSuspend();
    255255
    256 #if HAVE(RUNNINGBOARD_WEBKIT_ASSERTIONS)
     256#if HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
    257257    [_backgroundTask removeObserver:self];
    258258    [_backgroundTask invalidate];
     
    292292static NSString *runningBoardNameForAssertionType(ProcessAssertionType assertionType)
    293293{
    294 #if HAVE(RUNNINGBOARD_WEBKIT_ASSERTIONS)
     294#if HAVE(RUNNINGBOARD_VISIBILITY_ASSERTIONS)
    295295    switch (assertionType) {
    296296    case ProcessAssertionType::Suspended:
     
    302302    case ProcessAssertionType::Foreground:
    303303        return @"Foreground";
     304    case ProcessAssertionType::DependentProcessLink:
     305        return @"DependentProcessLink";
    304306    case ProcessAssertionType::MediaPlayback:
    305307        return nil; // FIXME: Name to be defined in <rdar://problem/61263147>.
    306308    }
    307309#else
    308     UNUSED_PARAM(assertionType);
     310    if (assertionType == ProcessAssertionType::DependentProcessLink)
     311        return @"DependentProcessLink";
    309312    return nil;
    310313#endif
     
    326329    case ProcessAssertionType::MediaPlayback:
    327330        return foregroundTabFlags;
     331    case ProcessAssertionType::DependentProcessLink:
     332        ASSERT_NOT_REACHED();
     333        return backgroundTabFlags;
    328334    }
    329335}
     
    340346    case ProcessAssertionType::MediaPlayback:
    341347        return BKSProcessAssertionReasonMediaPlayback;
     348    case ProcessAssertionType::DependentProcessLink:
     349        ASSERT_NOT_REACHED();
     350        return BKSProcessAssertionReasonExtension;
    342351    }
    343352}
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r259307 r259674  
    35523552                46DF06391F3905E5001980BB /* NetworkCORSPreflightChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCORSPreflightChecker.cpp; sourceTree = "<group>"; };
    35533553                46DF063A1F3905E5001980BB /* NetworkCORSPreflightChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCORSPreflightChecker.h; sourceTree = "<group>"; };
    3554                 46F38E882416D9630059375A /* DependencyProcessAssertion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DependencyProcessAssertion.cpp; sourceTree = "<group>"; };
    3555                 46F38E892416D9630059375A /* DependencyProcessAssertion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DependencyProcessAssertion.h; sourceTree = "<group>"; };
    3556                 46F38E8A2416D9A70059375A /* DependencyProcessAssertionIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DependencyProcessAssertionIOS.mm; path = ios/DependencyProcessAssertionIOS.mm; sourceTree = "<group>"; };
    35573554                46F38E8B2416E66D0059375A /* RunningBoardServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunningBoardServicesSPI.h; sourceTree = "<group>"; };
    35583555                46F9B26223526ED0006FE5FA /* WebBackForwardCacheEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardCacheEntry.h; sourceTree = "<group>"; };
     
    59695966                                99036AE823A970870000B06A /* DebuggableInfoData.cpp */,
    59705967                                99036AE723A970870000B06A /* DebuggableInfoData.h */,
    5971                                 46F38E882416D9630059375A /* DependencyProcessAssertion.cpp */,
    5972                                 46F38E892416D9630059375A /* DependencyProcessAssertion.h */,
    59735968                                2D7FD190223C730F007887F1 /* DocumentEditingContext.h */,
    59745969                                2D7FD191223C7310007887F1 /* DocumentEditingContext.mm */,
     
    68986893                        children = (
    68996894                                A7E93CEB192531AA00A1DC48 /* AuxiliaryProcessIOS.mm */,
    6900                                 46F38E8A2416D9A70059375A /* DependencyProcessAssertionIOS.mm */,
    69016895                                2DA6731920C754B1003CB401 /* DynamicViewportSizeUpdate.h */,
    69026896                                2DA9449D1884E4F000ED86DB /* GestureTypes.h */,
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r259673 r259674  
    3232#include "AuthenticationManager.h"
    3333#include "AuxiliaryProcessMessages.h"
    34 #include "DependencyProcessAssertion.h"
    3534#include "DrawingArea.h"
    3635#include "EventDispatcher.h"
     
    4443#include "NetworkSessionCreationParameters.h"
    4544#include "PluginProcessConnectionManager.h"
     45#include "ProcessAssertion.h"
    4646#include "RemoteAudioSession.h"
    4747#include "RemoteLegacyCDMFactory.h"
     
    300300    ASSERT(!m_uiProcessDependencyProcessAssertion);
    301301    if (auto remoteProcessID = connection->remoteProcessID())
    302         m_uiProcessDependencyProcessAssertion = makeUnique<DependencyProcessAssertion>(remoteProcessID, "WebContent process dependency on UIProcess"_s);
     302        m_uiProcessDependencyProcessAssertion = makeUnique<ProcessAssertion>(remoteProcessID, "WebContent process dependency on UIProcess"_s, ProcessAssertionType::DependentProcessLink);
    303303    else
    304         RELEASE_LOG_ERROR_IF_ALLOWED(ProcessSuspension, "Unable to create a process depending assertion on UIProcess because remoteProcessID is 0");
     304        RELEASE_LOG_ERROR_IF_ALLOWED(ProcessSuspension, "Unable to create a process dependency assertion on UIProcess because remoteProcessID is 0");
    305305#endif // PLATFORM(IOS_FAMILY)
    306306
  • trunk/Source/WebKit/WebProcess/WebProcess.h

    r259236 r259674  
    9999namespace WebKit {
    100100
    101 class DependencyProcessAssertion;
    102101class EventDispatcher;
    103102class GamepadData;
     
    108107class NetworkProcessConnection;
    109108class ObjCObjectGraph;
     109class ProcessAssertion;
    110110struct ServiceWorkerInitializationData;
    111111class StorageAreaMap;
     
    578578#if PLATFORM(IOS_FAMILY)
    579579    WebSQLiteDatabaseTracker m_webSQLiteDatabaseTracker;
    580     std::unique_ptr<DependencyProcessAssertion> m_uiProcessDependencyProcessAssertion;
     580    std::unique_ptr<ProcessAssertion> m_uiProcessDependencyProcessAssertion;
    581581#endif
    582582
Note: See TracChangeset for help on using the changeset viewer.