Title: [186188] tags/Safari-601.1.38/Source/WebKit2

Diff

Modified: tags/Safari-601.1.38/Source/WebKit2/ChangeLog (186187 => 186188)


--- tags/Safari-601.1.38/Source/WebKit2/ChangeLog	2015-07-01 19:33:54 UTC (rev 186187)
+++ tags/Safari-601.1.38/Source/WebKit2/ChangeLog	2015-07-01 19:34:59 UTC (rev 186188)
@@ -1,5 +1,9 @@
 2015-07-01  Babak Shafiei  <bshaf...@apple.com>
 
+        Roll out r185936.
+
+2015-07-01  Babak Shafiei  <bshaf...@apple.com>
+
         Roll out r185939.
 
 2015-06-30  Babak Shafiei  <bshaf...@apple.com>

Deleted: tags/Safari-601.1.38/Source/WebKit2/Platform/spi/ios/AssertionServicesSPI.h (186187 => 186188)


--- tags/Safari-601.1.38/Source/WebKit2/Platform/spi/ios/AssertionServicesSPI.h	2015-07-01 19:33:54 UTC (rev 186187)
+++ tags/Safari-601.1.38/Source/WebKit2/Platform/spi/ios/AssertionServicesSPI.h	2015-07-01 19:34:59 UTC (rev 186188)
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Foundation/Foundation.h>
-
-#if USE(APPLE_INTERNAL_SDK)
-
-#import <AssertionServices/BKSApplicationStateMonitor.h>
-#import <AssertionServices/BKSProcessAssertion.h>
-
-#else
-
-enum {
-    BKSApplicationStateUnknown                      = 0,
-    BKSApplicationStateTerminated                   = (1 << 0),
-    BKSApplicationStateBackgroundTaskSuspended      = (1 << 1),
-    BKSApplicationStateBackgroundRunning            = (1 << 2),
-    BKSApplicationStateForegroundRunning            = (1 << 3),
-    BKSApplicationStateProcessServer                = (1 << 4),
-    BKSApplicationStateForegroundRunningObscured    = (1 << 5),
-};
-typedef uint32_t BKSApplicationState;
-
-extern NSString * const BKSApplicationStateMostElevatedStateForProcessIDKey;
-extern NSString * const BKSApplicationStateProcessIDKey;
-
-typedef void(^BKSApplicationStateChangedHandler)(NSDictionary *userInfo);
-
-@interface BKSApplicationStateMonitor : NSObject
-
-@property (nonatomic, copy) BKSApplicationStateChangedHandler handler;
-
-- (BKSApplicationState)mostElevatedApplicationStateForPID:(pid_t)pid;
-
-@end
-
-enum {
-    BKSProcessAssertionNone = 0,
-    BKSProcessAssertionPreventTaskSuspend  = 1 << 0,
-    BKSProcessAssertionPreventTaskThrottleDown = 1 << 1,
-    BKSProcessAssertionAllowIdleSleep = 1 << 2,
-    BKSProcessAssertionWantsForegroundResourcePriority = 1 << 3,
-    BKSProcessAssertionAllowSuspendOnSleep = 1 << 4,
-};
-typedef uint32_t BKSProcessAssertionFlags;
-
-enum {
-    BKSProcessAssertionReasonExtension = 13,
-};
-typedef uint32_t BKSProcessAssertionReason;
-
-typedef void (^BKSProcessAssertionAcquisitionHandler)(BOOL acquired);
-
-@interface BKSProcessAssertion : NSObject
-@end
-
-@interface BKSProcessAssertion (Details)
-@property (nonatomic, assign) BKSProcessAssertionFlags flags;
-- (id)initWithPID:(pid_t)pid flags:(BKSProcessAssertionFlags)flags reason:(BKSProcessAssertionReason)reason name:(NSString *)name withHandler:(BKSProcessAssertionAcquisitionHandler)handler;
-- (void)invalidate;
-@end
-
-#endif

Copied: tags/Safari-601.1.38/Source/WebKit2/Platform/spi/ios/BKSProcessAssertionSPI.h (from rev 185935, trunk/Source/WebKit2/Platform/spi/ios/BKSProcessAssertionSPI.h) (0 => 186188)


--- tags/Safari-601.1.38/Source/WebKit2/Platform/spi/ios/BKSProcessAssertionSPI.h	                        (rev 0)
+++ tags/Safari-601.1.38/Source/WebKit2/Platform/spi/ios/BKSProcessAssertionSPI.h	2015-07-01 19:34:59 UTC (rev 186188)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <AssertionServices/BKSProcessAssertion.h>
+
+#else
+
+enum {
+    BKSProcessAssertionNone = 0,
+    BKSProcessAssertionPreventTaskSuspend  = 1 << 0,
+    BKSProcessAssertionPreventTaskThrottleDown = 1 << 1,
+    BKSProcessAssertionAllowIdleSleep = 1 << 2,
+    BKSProcessAssertionWantsForegroundResourcePriority = 1 << 3,
+    BKSProcessAssertionAllowSuspendOnSleep = 1 << 4,
+};
+typedef uint32_t BKSProcessAssertionFlags;
+
+enum {
+    BKSProcessAssertionReasonExtension = 13,
+};
+typedef uint32_t BKSProcessAssertionReason;
+
+typedef void(^BKSProcessAssertionAcquisitionHandler)(BOOL acquired);
+
+@interface BKSProcessAssertion : NSObject
+@end
+
+@interface BKSProcessAssertion (Details)
+@property (nonatomic, assign) BKSProcessAssertionFlags flags;
+- (id)initWithPID:(pid_t)pid flags:(BKSProcessAssertionFlags)flags reason:(BKSProcessAssertionReason)reason name:(NSString *)name withHandler:(BKSProcessAssertionAcquisitionHandler)handler;
+- (void)invalidate;
+@end
+
+#endif

Modified: tags/Safari-601.1.38/Source/WebKit2/Platform/spi/ios/UIKitSPI.h (186187 => 186188)


--- tags/Safari-601.1.38/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2015-07-01 19:33:54 UTC (rev 186187)
+++ tags/Safari-601.1.38/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2015-07-01 19:34:59 UTC (rev 186188)
@@ -760,7 +760,6 @@
 extern NSString * const UIKeyboardIsLocalUserInfoKey;
 
 extern UIApplication *UIApp;
-BOOL _UIApplicationIsExtension(void);
 void _UIApplicationLoadWebKit(void);
 BOOL _UIApplicationUsesLegacyUI(void);
 

Modified: tags/Safari-601.1.38/Source/WebKit2/UIProcess/ApplicationStateTracker.mm (186187 => 186188)


--- tags/Safari-601.1.38/Source/WebKit2/UIProcess/ApplicationStateTracker.mm	2015-07-01 19:33:54 UTC (rev 186187)
+++ tags/Safari-601.1.38/Source/WebKit2/UIProcess/ApplicationStateTracker.mm	2015-07-01 19:34:59 UTC (rev 186188)
@@ -28,8 +28,6 @@
 
 #if PLATFORM(IOS)
 
-#import "AssertionServicesSPI.h"
-#import "UIKitSPI.h"
 #import <UIKit/UIApplication.h>
 #import <wtf/NeverDestroyed.h>
 #import <wtf/ObjcRuntimeExtras.h>
@@ -43,65 +41,20 @@
     return applicationStateTracker;
 }
 
-static bool isViewService()
-{
-    if (_UIApplicationIsExtension())
-        return true;
-
-    if ([[NSBundle mainBundle].bundleIdentifier isEqualToString:@"com.apple.SafariViewService"])
-        return true;
-
-    return false;
-}
-
-static bool isBackgroundState(BKSApplicationState state)
-{
-    switch (state) {
-    case BKSApplicationStateBackgroundRunning:
-    case BKSApplicationStateBackgroundTaskSuspended:
-        return true;
-
-    default:
-        return false;
-    }
-}
-
 ApplicationStateTracker::ApplicationStateTracker()
 {
-    if (isViewService()) {
-        BKSApplicationStateMonitor *applicationStateMonitor = [[BKSApplicationStateMonitor alloc] init];
+    UIApplication *application = [UIApplication sharedApplication];
+    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
 
-        m_isInBackground = isBackgroundState([applicationStateMonitor mostElevatedApplicationStateForPID:getpid()]);
+    m_isInBackground = application.applicationState == UIApplicationStateBackground;
 
-        applicationStateMonitor.handler = [this](NSDictionary *userInfo) {
-            pid_t pid = [userInfo[BKSApplicationStateProcessIDKey] integerValue];
-            if (pid != getpid())
-                return;
+    [notificationCenter addObserverForName:UIApplicationDidEnterBackgroundNotification object:application queue:nil usingBlock:[this](NSNotification *) {
+        applicationDidEnterBackground();
+    }];
 
-            BKSApplicationState newState = (BKSApplicationState)[userInfo[BKSApplicationStateMostElevatedStateForProcessIDKey] unsignedIntValue];
-            bool newInBackground = isBackgroundState(newState);
-
-            dispatch_async(dispatch_get_main_queue(), [this, newInBackground] {
-                if (!m_isInBackground && newInBackground)
-                    applicationDidEnterBackground();
-                else if (m_isInBackground && !newInBackground)
-                    applicationWillEnterForeground();
-            });
-        };
-    } else {
-        UIApplication *application = [UIApplication sharedApplication];
-        NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
-
-        m_isInBackground = application.applicationState == UIApplicationStateBackground;
-
-        [notificationCenter addObserverForName:UIApplicationDidEnterBackgroundNotification object:application queue:nil usingBlock:[this](NSNotification *) {
-            applicationDidEnterBackground();
-        }];
-
-        [notificationCenter addObserverForName:UIApplicationWillEnterForegroundNotification object:application queue:nil usingBlock:[this](NSNotification *) {
-            applicationWillEnterForeground();
-        }];
-    }
+    [notificationCenter addObserverForName:UIApplicationWillEnterForegroundNotification object:application queue:nil usingBlock:[this](NSNotification *) {
+        applicationWillEnterForeground();
+    }];
 }
 
 void ApplicationStateTracker::addListener(id object, SEL willEnterForegroundSelector, SEL didEnterBackgroundSelector)

Modified: tags/Safari-601.1.38/Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm (186187 => 186188)


--- tags/Safari-601.1.38/Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm	2015-07-01 19:33:54 UTC (rev 186187)
+++ tags/Safari-601.1.38/Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm	2015-07-01 19:34:59 UTC (rev 186188)
@@ -29,7 +29,7 @@
 #if PLATFORM(IOS)
 
 #import "ApplicationStateTracker.h"
-#import "AssertionServicesSPI.h"
+#import "BKSProcessAssertionSPI.h"
 #import <UIKit/UIApplication.h>
 #import <wtf/HashSet.h>
 #import <wtf/Vector.h>

Modified: tags/Safari-601.1.38/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (186187 => 186188)


--- tags/Safari-601.1.38/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2015-07-01 19:33:54 UTC (rev 186187)
+++ tags/Safari-601.1.38/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2015-07-01 19:34:59 UTC (rev 186188)
@@ -1678,7 +1678,7 @@
 		CDC3831017212440008A2FC3 /* CookieStorageShim.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC3830D1721242D008A2FC3 /* CookieStorageShim.mm */; };
 		CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */; };
 		CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */; };
-		CE1A0BD21A48E6C60054EF74 /* AssertionServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BCC1A48E6C60054EF74 /* AssertionServicesSPI.h */; };
+		CE1A0BD21A48E6C60054EF74 /* BKSProcessAssertionSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BCC1A48E6C60054EF74 /* BKSProcessAssertionSPI.h */; };
 		CE1A0BD31A48E6C60054EF74 /* CorePDFSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BCD1A48E6C60054EF74 /* CorePDFSPI.h */; };
 		CE1A0BD41A48E6C60054EF74 /* DataDetectorsUISPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BCE1A48E6C60054EF74 /* DataDetectorsUISPI.h */; };
 		CE1A0BD51A48E6C60054EF74 /* ManagedConfigurationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BCF1A48E6C60054EF74 /* ManagedConfigurationSPI.h */; };
@@ -3907,7 +3907,7 @@
 		CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKFullScreenWindowController.mm; sourceTree = "<group>"; };
 		CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFullScreenWindowController.h; sourceTree = "<group>"; };
 		CDCA85D4132AC2B300E961DF /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
-		CE1A0BCC1A48E6C60054EF74 /* AssertionServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssertionServicesSPI.h; sourceTree = "<group>"; };
+		CE1A0BCC1A48E6C60054EF74 /* BKSProcessAssertionSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKSProcessAssertionSPI.h; sourceTree = "<group>"; };
 		CE1A0BCD1A48E6C60054EF74 /* CorePDFSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePDFSPI.h; sourceTree = "<group>"; };
 		CE1A0BCE1A48E6C60054EF74 /* DataDetectorsUISPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsUISPI.h; sourceTree = "<group>"; };
 		CE1A0BCF1A48E6C60054EF74 /* ManagedConfigurationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManagedConfigurationSPI.h; sourceTree = "<group>"; };
@@ -7325,8 +7325,8 @@
 		CE1A0BCB1A48E6C60054EF74 /* ios */ = {
 			isa = PBXGroup;
 			children = (
-				CE1A0BCC1A48E6C60054EF74 /* AssertionServicesSPI.h */,
 				CDA041F31ACE2105004A13EC /* BackBoardServicesSPI.h */,
+				CE1A0BCC1A48E6C60054EF74 /* BKSProcessAssertionSPI.h */,
 				CE1A0BCD1A48E6C60054EF74 /* CorePDFSPI.h */,
 				CE1A0BCE1A48E6C60054EF74 /* DataDetectorsUISPI.h */,
 				CE1A0BCF1A48E6C60054EF74 /* ManagedConfigurationSPI.h */,
@@ -7575,7 +7575,7 @@
 				512F58A312A883AD00629530 /* AuthenticationManagerMessages.h in Headers */,
 				7CD102DA1866770600ED429D /* AutoCorrectionCallback.h in Headers */,
 				CDA041F41ACE2105004A13EC /* BackBoardServicesSPI.h in Headers */,
-				CE1A0BD21A48E6C60054EF74 /* AssertionServicesSPI.h in Headers */,
+				CE1A0BD21A48E6C60054EF74 /* BKSProcessAssertionSPI.h in Headers */,
 				E164A2F2191AF14E0010737D /* BlobDataFileReferenceWithSandboxExtension.h in Headers */,
 				E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */,
 				4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to