Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[macOS] Re-enable ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWOR…
…K_PROCESS

https://bugs.webkit.org/show_bug.cgi?id=221039
<rdar://problem/73665061>
Source/WebCore:

Reviewed by Brent Fulgham.

The commit r271907 introduced a crash, since it denied access to the Launch Services daemon, which AppKit is using to get and set
application information, for example whether the app is foreground or not. To work around this, the WebCoreThemeWindow has been made
borderless, and the method +[NSWindow invalidateRestorableState] is overridden to do nothing. Running the default
+[NSWindow invalidateRestorableState] will exercise code which tries to reach out to the Launch Services daemon, and crashes if
unable to do so. This functionality should not be required in the WebContent process, and can be disabled.

* platform/mac/ThemeMac.mm:
(-[WebCoreThemeWindow invalidateRestorableState]):
(-[WebCoreThemeView window]):

Source/WebKit:

Reviewed by Brent Fulgham.

Work around crash introduced in r271907, by disabling persistent UI. Having persistent UI enabled will exercise code
which tries to connect with the Launch Services daemon, and crash if that fails.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Source/WTF:

Reviewed by Brent Fulgham.

* wtf/PlatformEnableCocoa.h:


Canonical link: https://commits.webkit.org/233409@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
pvollan committed Jan 27, 2021
1 parent 761bc64 commit 130f0e8
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 3 deletions.
10 changes: 10 additions & 0 deletions Source/WTF/ChangeLog
@@ -1,3 +1,13 @@
2021-01-27 Per Arne <pvollan@apple.com>

[macOS] Re-enable ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS
https://bugs.webkit.org/show_bug.cgi?id=221039
<rdar://problem/73665061>

Reviewed by Brent Fulgham.

* wtf/PlatformEnableCocoa.h:

2021-01-27 Antti Koivisto <antti@apple.com>

Implement visibility based resource load scheduling for low priority resources
Expand Down
2 changes: 1 addition & 1 deletion Source/WTF/wtf/PlatformEnableCocoa.h
Expand Up @@ -630,7 +630,7 @@
#define ENABLE_VORBIS 1
#endif

#if !defined(ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 120000
#if !defined(ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
#define ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS 1
#endif

Expand Down
18 changes: 18 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
2021-01-27 Per Arne <pvollan@apple.com>

[macOS] Re-enable ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS
https://bugs.webkit.org/show_bug.cgi?id=221039
<rdar://problem/73665061>

Reviewed by Brent Fulgham.

The commit r271907 introduced a crash, since it denied access to the Launch Services daemon, which AppKit is using to get and set
application information, for example whether the app is foreground or not. To work around this, the WebCoreThemeWindow has been made
borderless, and the method +[NSWindow invalidateRestorableState] is overridden to do nothing. Running the default
+[NSWindow invalidateRestorableState] will exercise code which tries to reach out to the Launch Services daemon, and crashes if
unable to do so. This functionality should not be required in the WebContent process, and can be disabled.

* platform/mac/ThemeMac.mm:
(-[WebCoreThemeWindow invalidateRestorableState]):
(-[WebCoreThemeView window]):

2021-01-27 Sihui Liu <sihui_liu@appe.com>

Use SFTranscription instead of SFTranscriptionSegment for SpeechRecognitionAlternative
Expand Down
5 changes: 4 additions & 1 deletion Source/WebCore/platform/mac/ThemeMac.mm
Expand Up @@ -67,6 +67,9 @@ - (BOOL)isKeyWindow
return themeWindowHasKeyAppearance;
}

- (void)invalidateRestorableState
{
}
@end

@implementation WebCoreThemeView
Expand All @@ -76,7 +79,7 @@ - (NSWindow *)window
// Using defer:YES prevents us from wasting any window server resources for this window, since we're not actually
// going to draw into it. The other arguments match what you get when calling -[NSWindow init].
static WebCoreThemeWindow *window = [[WebCoreThemeWindow alloc] initWithContentRect:NSMakeRect(100, 100, 100, 100)
styleMask:NSWindowStyleMaskTitled backing:NSBackingStoreBuffered defer:YES];
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES];
return window;
}

Expand Down
14 changes: 14 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,17 @@
2021-01-27 Per Arne <pvollan@apple.com>

[macOS] Re-enable ENABLE_SET_WEBCONTENT_PROCESS_INFORMATION_IN_NETWORK_PROCESS
https://bugs.webkit.org/show_bug.cgi?id=221039
<rdar://problem/73665061>

Reviewed by Brent Fulgham.

Work around crash introduced in r271907, by disabling persistent UI. Having persistent UI enabled will exercise code
which tries to connect with the Launch Services daemon, and crash if that fails.

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

2021-01-27 Per Arne <pvollan@apple.com>

[iOS] Fix sandbox violation file-read-data /dev/dtracehelper in the Networking process
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Expand Up @@ -293,7 +293,7 @@ static Boolean isAXAuthenticatedCallback(audit_token_t auditToken)
// We don't need to talk to the Dock.
[NSApplication _preventDockConnections];

[[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions" : @YES }];
[[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions" : @YES, @"ApplePersistence" : @NO }];

// rdar://9118639 accessibilityFocusedUIElement in NSApplication defaults to use the keyWindow. Since there's
// no window in WK2, NSApplication needs to use the focused page's focused element.
Expand Down

0 comments on commit 130f0e8

Please sign in to comment.