Changeset 228338 in webkit
- Timestamp:
- Feb 9, 2018 2:13:00 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r228337 r228338 1 2018-02-09 Per Arne Vollan <pvollan@apple.com> 2 3 Assert that NSApp is not running in the WebProcess. 4 https://bugs.webkit.org/show_bug.cgi?id=182553 5 6 Reviewed by Simon Fraser. 7 8 In WebCore, there are a few places where NSApp is referenced. Since the WebContent process 9 is no longer using the NSApplication run loop, and NSApp is no longer guaranteed to be 10 valid, we should make sure that the NSApp is not referenced by the WebContent process or 11 the Network process, by asserting that the NSApplication event loop is running when NSApp 12 is referenced. It is still ok for the UIProcess to reference NSApp. Adding these assert 13 will help catch NSApp references when the NSApplication run loop is not used. 14 15 Also, do not post a fake mouse event in PasteBoard::setDragImage when the NSApplication 16 run loop is not running, since this is only relevant in WK1. 17 18 No new tests, covered by existing tests. 19 20 * page/mac/EventHandlerMac.mm: 21 (WebCore::lastEventIsMouseUp): 22 (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking): 23 * platform/mac/PasteboardMac.mm: 24 (WebCore::Pasteboard::setDragImage): 25 1 26 2018-02-09 Zalan Bujtas <zalan@apple.com> 2 27 -
trunk/Source/WebCore/page/mac/EventHandlerMac.mm
r228260 r228338 197 197 // It's not clear in what cases this is helpful now -- it's possible it can be removed. 198 198 199 ASSERT([NSApp isRunning]); 200 199 201 BEGIN_BLOCK_OBJC_EXCEPTIONS; 200 202 NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent]; … … 571 573 int eventType = [initiatingEvent type]; 572 574 if (eventType == NSEventTypeLeftMouseDown || eventType == NSEventTypeKeyDown) { 575 ASSERT([NSApp isRunning]); 573 576 NSEvent *fakeEvent = nil; 574 577 if (eventType == NSEventTypeLeftMouseDown) { -
trunk/Source/WebCore/platform/mac/PasteboardMac.mm
r228254 r228338 659 659 // Hack: We must post an event to wake up the NSDragManager, which is sitting in a nextEvent call 660 660 // up the stack from us because the CoreFoundation drag manager does not use the run loop by itself. 661 // This is the most innocuous event to use, per Kristen Forster. 662 NSEvent* event = [NSEvent mouseEventWithType:NSEventTypeMouseMoved location:NSZeroPoint 663 modifierFlags:0 timestamp:0 windowNumber:0 context:nil eventNumber:0 clickCount:0 pressure:0]; 664 [NSApp postEvent:event atStart:YES]; 661 // This is the most innocuous event to use, per Kristin Forster. 662 // This is only relevant in WK1. Do not execute in the WebContent process, since it is now using 663 // NSRunLoop, and not the NSApplication run loop. 664 if ([NSApp isRunning]) { 665 NSEvent* event = [NSEvent mouseEventWithType:NSEventTypeMouseMoved location:NSZeroPoint 666 modifierFlags:0 timestamp:0 windowNumber:0 context:nil eventNumber:0 clickCount:0 pressure:0]; 667 [NSApp postEvent:event atStart:YES]; 668 } 665 669 } 666 670 #endif
Note: See TracChangeset
for help on using the changeset viewer.