Changeset 231980 in webkit
- Timestamp:
- May 18, 2018 1:20:35 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r231979 r231980 1 2018-05-18 Brent Fulgham <bfulgham@apple.com> 2 3 Convert ProcessPrivilege assertions to regular debug-only assertions 4 https://bugs.webkit.org/show_bug.cgi?id=185775 5 <rdar://problem/40372286> 6 7 Reviewed by Geoffrey Garen. 8 9 In Bug 184322 I added a number of RELEASE_ASSERT checks that certain 10 UI-only calls were not being made in the WebContent process. 11 12 Measurements have shown that these RELEASE_ASSERTs have regressed performance 13 by around 1% on some benchmarks, so we should convert them to normal asserts. 14 15 This patch changes the RELEASE_ASSERTs into ASSERTs. 16 17 * platform/mac/PasteboardMac.mm: 18 (WebCore::Pasteboard::setDragImage): 19 * platform/mac/PlatformScreenMac.mm: 20 (WebCore::displayID): 21 (WebCore::firstScreen): 22 (WebCore::window): 23 (WebCore::screen): 24 (WebCore::getScreenProperties): 25 (WebCore::screenIsMonochrome): 26 1 27 2018-05-18 Eric Carlson <eric.carlson@apple.com> 2 28 -
trunk/Source/WebCore/platform/mac/PasteboardMac.mm
r231276 r231980 677 677 // NSRunLoop, and not the NSApplication run loop. 678 678 if ([NSApp isRunning]) { 679 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));679 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 680 680 NSEvent* event = [NSEvent mouseEventWithType:NSEventTypeMouseMoved location:NSZeroPoint 681 681 modifierFlags:0 timestamp:0 windowNumber:0 context:nil eventNumber:0 clickCount:0 pressure:0]; -
trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm
r231937 r231980 49 49 static PlatformDisplayID displayID(NSScreen *screen) 50 50 { 51 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));51 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 52 52 return [[[screen deviceDescription] objectForKey:@"NSScreenNumber"] intValue]; 53 53 } … … 72 72 static NSScreen *firstScreen() 73 73 { 74 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));74 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 75 75 NSArray *screens = [NSScreen screens]; 76 76 if (![screens count]) … … 81 81 static NSWindow *window(Widget* widget) 82 82 { 83 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));83 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 84 84 if (!widget) 85 85 return nil; … … 89 89 static NSScreen *screen(Widget* widget) 90 90 { 91 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));91 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 92 92 // If the widget is in a window, use that, otherwise use the display ID from the host window. 93 93 // First case is for when the NSWindow is in the same process, second case for when it's not. … … 111 111 std::pair<PlatformDisplayID, HashMap<PlatformDisplayID, ScreenProperties>> getScreenProperties() 112 112 { 113 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));113 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 114 114 115 115 HashMap<PlatformDisplayID, ScreenProperties> screenProperties; … … 172 172 173 173 // This is a system-wide accessibility setting, same on all screens. 174 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));174 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 175 175 return CGDisplayUsesForceToGray(); 176 176 } … … 247 247 NSScreen *screen(NSWindow *window) 248 248 { 249 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));249 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 250 250 return [window screen] ?: firstScreen(); 251 251 } … … 253 253 NSScreen *screen(PlatformDisplayID displayID) 254 254 { 255 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));255 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 256 256 for (NSScreen *screen in [NSScreen screens]) { 257 257 if (WebCore::displayID(screen) == displayID) -
trunk/Source/WebKit/ChangeLog
r231979 r231980 1 2018-05-18 Brent Fulgham <bfulgham@apple.com> 2 3 Convert ProcessPrivilege assertions to regular debug-only assertions 4 https://bugs.webkit.org/show_bug.cgi?id=185775 5 <rdar://problem/40372286> 6 7 Reviewed by Geoffrey Garen. 8 9 In Bug 184322 I added a number of RELEASE_ASSERT checks that certain 10 UI-only calls were not being made in the WebContent process. 11 12 Measurements have shown that these RELEASE_ASSERTs have regressed performance 13 by around 1% on some benchmarks, so we should convert them to normal asserts. 14 15 This patch changes the RELEASE_ASSERTs into ASSERTs. 16 17 * UIProcess/Cocoa/WebProcessPoolCocoa.mm: 18 (WebKit::WebProcessPool::platformInitializeWebProcess): 19 * UIProcess/Cocoa/WebViewImpl.mm: 20 (WebKit::WebViewImpl::WebViewImpl): 21 (WebKit::WebViewImpl::becomeFirstResponder): 22 (WebKit::WebViewImpl::pluginFocusOrWindowFocusChanged): 23 (WebKit::WebViewImpl::validateUserInterfaceItem): 24 (WebKit::WebViewImpl::startSpeaking): 25 (WebKit::WebViewImpl::stopSpeaking): 26 (WebKit::applicationFlagsForDrag): 27 (WebKit::WebViewImpl::doneWithKeyEvent): 28 * UIProcess/Gamepad/mac/UIGamepadProviderMac.mm: 29 (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput): 30 * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: 31 (WebKit::PluginProcessProxy::enterFullscreen): 32 (WebKit::PluginProcessProxy::beginModal): 33 (WebKit::PluginProcessProxy::endModal): 34 * UIProcess/mac/DisplayLink.cpp: 35 (WebKit::DisplayLink::DisplayLink): 36 (WebKit::DisplayLink::~DisplayLink): 37 * UIProcess/mac/WebPageProxyMac.mm: 38 (WebKit::WebPageProxy::getIsSpeaking): 39 (WebKit::WebPageProxy::speak): 40 (WebKit::WebPageProxy::stopSpeaking): 41 (WebKit::WebPageProxy::startDisplayLink): 42 * UIProcess/mac/WebPopupMenuProxyMac.mm: 43 (WebKit::WebPopupMenuProxyMac::showPopupMenu): 44 1 45 2018-05-18 Eric Carlson <eric.carlson@apple.com> 2 46 -
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
r231770 r231980 181 181 #pragma clang diagnostic push 182 182 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 183 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));183 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 184 184 parameters.accessibilityEnhancedUserInterfaceEnabled = [[NSApp accessibilityAttributeValue:@"AXEnhancedUserInterface"] boolValue]; 185 185 #pragma clang diagnostic pop -
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
r231371 r231980 1296 1296 static_cast<PageClientImpl&>(*m_pageClient).setImpl(*this); 1297 1297 1298 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));1298 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 1299 1299 [NSApp registerServicesMenuSendTypes:PasteboardTypes::forSelection() returnTypes:PasteboardTypes::forEditing()]; 1300 1300 … … 1430 1430 bool WebViewImpl::becomeFirstResponder() 1431 1431 { 1432 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));1432 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 1433 1433 // If we just became first responder again, there is no need to do anything, 1434 1434 // since resignFirstResponder has correctly detected this situation. … … 2387 2387 void WebViewImpl::pluginFocusOrWindowFocusChanged(bool pluginHasFocusAndWindowHasFocus, uint64_t pluginComplexTextInputIdentifier) 2388 2388 { 2389 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));2389 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 2390 2390 BOOL inputSourceChanged = m_pluginComplexTextInputIdentifier; 2391 2391 … … 2697 2697 bool WebViewImpl::validateUserInterfaceItem(id <NSValidatedUserInterfaceItem> item) 2698 2698 { 2699 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));2699 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 2700 2700 SEL action = [item action]; 2701 2701 … … 2819 2819 void WebViewImpl::startSpeaking() 2820 2820 { 2821 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));2821 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 2822 2822 m_page->getSelectionOrContentsAsString([](const String& string, WebKit::CallbackBase::Error error) { 2823 2823 if (error != WebKit::CallbackBase::Error::None) … … 2832 2832 void WebViewImpl::stopSpeaking(id sender) 2833 2833 { 2834 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));2834 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 2835 2835 [NSApp stopSpeaking:sender]; 2836 2836 } … … 3640 3640 static WebCore::DragApplicationFlags applicationFlagsForDrag(NSView *view, id <NSDraggingInfo> draggingInfo) 3641 3641 { 3642 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));3642 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 3643 3643 uint32_t flags = 0; 3644 3644 if ([NSApp modalWindow]) … … 4253 4253 void WebViewImpl::doneWithKeyEvent(NSEvent *event, bool eventWasHandled) 4254 4254 { 4255 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));4255 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 4256 4256 if ([event type] != NSEventTypeKeyDown) 4257 4257 return; -
trunk/Source/WebKit/UIProcess/Gamepad/mac/UIGamepadProviderMac.mm
r230468 r231980 39 39 WebPageProxy* UIGamepadProvider::platformWebPageProxyForGamepadInput() 40 40 { 41 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));41 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 42 42 auto responder = [[NSApp keyWindow] firstResponder]; 43 43 -
trunk/Source/WebKit/UIProcess/Plugins/mac/PluginProcessProxyMac.mm
r231771 r231980 133 133 void PluginProcessProxy::enterFullscreen() 134 134 { 135 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));135 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 136 136 // Get the current presentation options. 137 137 m_preFullscreenAppPresentationOptions = [NSApp presentationOptions]; … … 194 194 ASSERT(!m_placeholderWindow); 195 195 ASSERT(!m_activationObserver); 196 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));196 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 197 197 198 198 m_placeholderWindow = adoptNS([[WKPlaceholderModalWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES]); … … 216 216 ASSERT(m_placeholderWindow); 217 217 ASSERT(m_activationObserver); 218 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));218 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 219 219 220 220 [[NSNotificationCenter defaultCenter] removeObserver:m_activationObserver.get()]; -
trunk/Source/WebKit/UIProcess/mac/DisplayLink.cpp
r231818 r231980 38 38 DisplayLink::DisplayLink(WebCore::PlatformDisplayID displayID, WebPageProxy& webPageProxy) 39 39 { 40 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));40 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 41 41 CVReturn error = CVDisplayLinkCreateWithCGDisplay(displayID, &m_displayLink); 42 42 if (error) { … … 58 58 DisplayLink::~DisplayLink() 59 59 { 60 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));60 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 61 61 ASSERT(m_displayLink); 62 62 if (!m_displayLink) -
trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
r231510 r231980 134 134 void WebPageProxy::getIsSpeaking(bool& isSpeaking) 135 135 { 136 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));136 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 137 137 isSpeaking = [NSApp isSpeaking]; 138 138 } … … 140 140 void WebPageProxy::speak(const String& string) 141 141 { 142 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));142 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 143 143 [NSApp speakString:nsStringFromWebCoreString(string)]; 144 144 } … … 146 146 void WebPageProxy::stopSpeaking() 147 147 { 148 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));148 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 149 149 [NSApp stopSpeaking:nil]; 150 150 } … … 685 685 void WebPageProxy::startDisplayLink(unsigned observerID) 686 686 { 687 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));687 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 688 688 if (!m_displayLink) { 689 689 uint32_t displayID = [[[[platformWindow() screen] deviceDescription] objectForKey:@"NSScreenNumber"] intValue]; -
trunk/Source/WebKit/UIProcess/mac/WebPopupMenuProxyMac.mm
r230468 r231980 100 100 void WebPopupMenuProxyMac::showPopupMenu(const IntRect& rect, TextDirection textDirection, double pageScaleFactor, const Vector<WebPopupItem>& items, const PlatformPopupMenuData& data, int32_t selectedIndex) 101 101 { 102 RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));102 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); 103 103 NSFont *font; 104 104 if (data.fontInfo.fontAttributeDictionary) {
Note: See TracChangeset
for help on using the changeset viewer.