WebKit Bugzilla
Attachment 339569 Details for
Bug 185310
: Wasted time dlopening Lookup when tearing down a WKWebView
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185310-20180504112141.patch (text/plain), 4.12 KB, created by
Tim Horton
on 2018-05-04 11:21:41 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2018-05-04 11:21:41 PDT
Size:
4.12 KB
patch
obsolete
>Subversion Revision: 231348 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 7ccd23f9ca125d7734d990b0f2c7634a85084358..b2427eb54dcd139db40e73bebc4583fc604c6763 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-05-04 Tim Horton <timothy_horton@apple.com> >+ >+ Wasted time dlopening Lookup when tearing down a WKWebView >+ https://bugs.webkit.org/show_bug.cgi?id=185310 >+ <rdar://problem/39934085> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/Cocoa/WebViewImpl.h: >+ * UIProcess/Cocoa/WebViewImpl.mm: >+ (-[WKWindowVisibilityObserver dealloc]): >+ (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]): >+ (WebKit::WebViewImpl::prepareForDictionaryLookup): >+ (-[WKWindowVisibilityObserver startObservingLookupDismissal]): Deleted. >+ Avoid un-registering as a Lookup dismissal observer if we never >+ registered in the first place, because that involves dlopening Lookup. >+ > 2018-05-03 Chris Dumez <cdumez@apple.com> > > More aggressively terminate child processes when the connection to their parent process is severed >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >index cc001dd51bad99eb67655d0d33ac907c2653c454..bf1d95fc5b1797feb7423b36635c9d08da9fb99f 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >@@ -680,7 +680,6 @@ private: > RetainPtr<NSImmediateActionGestureRecognizer> m_immediateActionGestureRecognizer; > > bool m_allowsLinkPreview { true }; >- bool m_didRegisterForLookupPopoverCloseNotifications { false }; > > RetainPtr<NSTrackingArea> m_primaryTrackingArea; > >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >index b3fd3462e3d7dbb4b3b4ec3a18ef86347e686530..f7078277a3110bf819f0eb49ecf411fdd57235ff 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >@@ -186,13 +186,15 @@ @end > @interface WKWindowVisibilityObserver : NSObject { > NSView *_view; > WebKit::WebViewImpl *_impl; >+ >+ BOOL _didRegisterForLookupPopoverCloseNotifications; > } > > - (instancetype)initWithView:(NSView *)view impl:(WebKit::WebViewImpl&)impl; > - (void)startObserving:(NSWindow *)window; > - (void)stopObserving:(NSWindow *)window; > - (void)startObservingFontPanel; >-- (void)startObservingLookupDismissal; >+- (void)startObservingLookupDismissalIfNeeded; > @end > > @implementation WKWindowVisibilityObserver >@@ -214,7 +216,7 @@ - (instancetype)initWithView:(NSView *)view impl:(WebKit::WebViewImpl&)impl > > - (void)dealloc > { >- if (canLoadLUNotificationPopoverWillClose()) >+ if (_didRegisterForLookupPopoverCloseNotifications && canLoadLUNotificationPopoverWillClose()) > [[NSNotificationCenter defaultCenter] removeObserver:self name:getLUNotificationPopoverWillClose() object:nil]; > > NSNotificationCenter *workspaceNotificationCenter = [[NSWorkspace sharedWorkspace] notificationCenter]; >@@ -283,8 +285,13 @@ - (void)startObservingFontPanel > [[NSFontPanel sharedFontPanel] addObserver:self forKeyPath:@"visible" options:0 context:keyValueObservingContext]; > } > >-- (void)startObservingLookupDismissal >+- (void)startObservingLookupDismissalIfNeeded > { >+ if (_didRegisterForLookupPopoverCloseNotifications) >+ return; >+ >+ _didRegisterForLookupPopoverCloseNotifications = true; >+ > if (canLoadLUNotificationPopoverWillClose()) > [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil]; > } >@@ -3216,12 +3223,7 @@ void WebViewImpl::quickLookWithEvent(NSEvent *event) > > void WebViewImpl::prepareForDictionaryLookup() > { >- if (m_didRegisterForLookupPopoverCloseNotifications) >- return; >- >- m_didRegisterForLookupPopoverCloseNotifications = true; >- >- [m_windowVisibilityObserver startObservingLookupDismissal]; >+ [m_windowVisibilityObserver startObservingLookupDismissalIfNeeded]; > } > > void WebViewImpl::setAllowsLinkPreview(bool allowsLinkPreview)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
wenson_hsieh
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185310
:
339569
|
339578