Changeset 162655 in webkit


Ignore:
Timestamp:
Jan 23, 2014 3:28:54 PM (10 years ago)
Author:
andersca@apple.com
Message:

Clean up WKView.mm a little
https://bugs.webkit.org/show_bug.cgi?id=127517

Reviewed by Tim Horton.

Remove an unused ivar and migrate to API constants that were added in Lion.

  • UIProcess/API/mac/WKView.mm:

(-[WKView setFrameSize:]):
(-[WKView addWindowObserversForWindow:]):
(-[WKView removeWindowObservers]):
(-[WKView viewDidMoveToWindow]):
(-[WKView _windowDidMiniaturize:]):
(-[WKView _windowDidResize:]):
(-[WKView _windowDidChangeBackingProperties:]):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r162654 r162655  
     12014-01-23  Anders Carlsson  <andersca@apple.com>
     2
     3        Clean up WKView.mm a little
     4        https://bugs.webkit.org/show_bug.cgi?id=127517
     5
     6        Reviewed by Tim Horton.
     7
     8        Remove an unused ivar and migrate to API constants that were added in Lion.
     9
     10        * UIProcess/API/mac/WKView.mm:
     11        (-[WKView setFrameSize:]):
     12        (-[WKView addWindowObserversForWindow:]):
     13        (-[WKView removeWindowObservers]):
     14        (-[WKView viewDidMoveToWindow]):
     15        (-[WKView _windowDidMiniaturize:]):
     16        (-[WKView _windowDidResize:]):
     17        (-[WKView _windowDidChangeBackingProperties:]):
     18
    1192014-01-23  Anders Carlsson  <andersca@apple.com>
    220
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r162580 r162655  
    204204    BOOL _didScheduleWindowAndViewFrameUpdate;
    205205
    206     // Whether the containing window of the WKView has a valid backing store.
    207     // The window server invalidates the backing store whenever the window is resized or minimized.
    208     // We use this flag to determine when we need to paint the background (white or clear)
    209     // when the web process is unresponsive or takes too long to paint.
    210     BOOL _windowHasValidBackingStore;
    211 
    212206    RetainPtr<NSColorSpace> _colorSpace;
    213207
     
    405399- (void)setFrameSize:(NSSize)size
    406400{
    407     if (!NSEqualSizes(size, [self frame].size))
    408         _data->_windowHasValidBackingStore = NO;
    409 
    410401    [super setFrameSize:size];
    411402
     
    18181809}
    18191810
    1820 // FIXME: Use AppKit constants for these when they are available.
    1821 static NSString * const windowDidChangeBackingPropertiesNotification = @"NSWindowDidChangeBackingPropertiesNotification";
    1822 static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey";
    1823 
    18241811- (void)addWindowObserversForWindow:(NSWindow *)window
    18251812{
     
    18421829                                                     name:@"_NSWindowDidBecomeVisible" object:window];
    18431830        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeBackingProperties:)
    1844                                                      name:windowDidChangeBackingPropertiesNotification object:window];
     1831                                                     name:NSWindowDidChangeBackingPropertiesNotification object:window];
    18451832        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeScreen:)
    18461833                                                     name:NSWindowDidChangeScreenNotification object:window];
     
    18671854    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSWindowDidOrderOffScreenNotification" object:window];
    18681855    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"_NSWindowDidBecomeVisible" object:window];
    1869     [[NSNotificationCenter defaultCenter] removeObserver:self name:windowDidChangeBackingPropertiesNotification object:window];
     1856    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window];
    18701857    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeScreenNotification object:window];
    18711858#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     
    18891876{
    18901877    if ([self window]) {
    1891         _data->_windowHasValidBackingStore = NO;
    18921878        [self doWindowDidChangeScreen];
    18931879
     
    19561942- (void)_windowDidMiniaturize:(NSNotification *)notification
    19571943{
    1958     _data->_windowHasValidBackingStore = NO;
    19591944    _data->_page->viewStateDidChange(ViewState::IsVisible);
    19601945}
     
    19721957- (void)_windowDidResize:(NSNotification *)notification
    19731958{
    1974     _data->_windowHasValidBackingStore = NO;
    1975 
    19761959    [self _updateWindowAndViewFrames];
    19771960}
     
    19891972- (void)_windowDidChangeBackingProperties:(NSNotification *)notification
    19901973{
    1991     CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:backingPropertyOldScaleFactorKey] doubleValue];
    1992     CGFloat newBackingScaleFactor = [self _intrinsicDeviceScaleFactor]; 
     1974    CGFloat oldBackingScaleFactor = [notification.userInfo[NSBackingPropertyOldScaleFactorKey] doubleValue];
     1975    CGFloat newBackingScaleFactor = [self _intrinsicDeviceScaleFactor];
    19931976    if (oldBackingScaleFactor == newBackingScaleFactor)
    19941977        return;
    19951978
    1996     _data->_windowHasValidBackingStore = NO;
    19971979    _data->_page->setIntrinsicDeviceScaleFactor(newBackingScaleFactor);
    19981980}
Note: See TracChangeset for help on using the changeset viewer.