[wk2] De-.get()ify receivers of Objective-C messages

https://bugs.webkit.org/show_bug.cgi?id=127398

Reviewed by Sam Weinig.

RetainPtr does the right thing when you use it as the
receiver of an Obj-C message, so we don't need .get().

Long and useless file list elided.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 46e6fb55
2014-01-21 Tim Horton <timothy_horton@apple.com>
[wk2] De-.get()ify receivers of Objective-C messages
https://bugs.webkit.org/show_bug.cgi?id=127398
Reviewed by Sam Weinig.
RetainPtr does the right thing when you use it as the
receiver of an Obj-C message, so we don't need .get().
Long and useless file list elided.
2014-01-21 Brady Eidson <beidson@apple.com>
The IDB backing store put() method shouldn't call IDB callbacks directly
......
......@@ -63,7 +63,7 @@ void Download::start()
m_nsURLDownload = adoptNS([[NSURLDownload alloc] initWithRequest:m_request.nsURLRequest(UpdateHTTPBody) delegate:m_delegate.get()]);
// FIXME: Allow this to be changed by the client.
[m_nsURLDownload.get() setDeletesFileUponFailure:NO];
[m_nsURLDownload setDeletesFileUponFailure:NO];
}
void Download::startWithHandle(ResourceHandle* handle, const ResourceResponse& response)
......@@ -79,15 +79,15 @@ void Download::startWithHandle(ResourceHandle* handle, const ResourceResponse& r
proxy:nil];
// FIXME: Allow this to be changed by the client.
[m_nsURLDownload.get() setDeletesFileUponFailure:NO];
[m_nsURLDownload setDeletesFileUponFailure:NO];
}
void Download::cancel()
{
[m_nsURLDownload.get() cancel];
[m_nsURLDownload cancel];
RetainPtr<NSData> resumeData = [m_nsURLDownload.get() resumeData];
didCancel(IPC::DataReference(reinterpret_cast<const uint8_t*>([resumeData.get() bytes]), [resumeData.get() length]));
RetainPtr<NSData> resumeData = [m_nsURLDownload resumeData];
didCancel(IPC::DataReference(reinterpret_cast<const uint8_t*>([resumeData bytes]), [resumeData length]));
}
void Download::platformInvalidate()
......@@ -95,7 +95,7 @@ void Download::platformInvalidate()
ASSERT(m_nsURLDownload);
ASSERT(m_delegate);
[m_delegate.get() invalidate];
[m_delegate invalidate];
m_delegate = nullptr;
m_nsURLDownload = nullptr;
}
......@@ -263,7 +263,7 @@ static void dispatchOnMainThread(void (^block)())
return;
RetainPtr<NSData> resumeData = [download resumeData];
IPC::DataReference dataReference(reinterpret_cast<const uint8_t*>([resumeData.get() bytes]), [resumeData.get() length]);
IPC::DataReference dataReference(reinterpret_cast<const uint8_t*>([resumeData bytes]), [resumeData length]);
_download->didFail(error, dataReference);
});
......
......@@ -216,7 +216,7 @@ void CustomProtocolManager::didFailWithError(uint64_t customProtocolID, const We
RetainPtr<NSError> nsError = error.nsError();
dispatchOnResourceLoaderRunLoop(^ {
[[protocol.get() client] URLProtocol:protocol.get() didFailWithError:nsError.get()];
[[protocol client] URLProtocol:protocol.get() didFailWithError:nsError.get()];
});
removeCustomProtocol(protocol.get());
......@@ -231,7 +231,7 @@ void CustomProtocolManager::didLoadData(uint64_t customProtocolID, const IPC::Da
RetainPtr<NSData> nsData = adoptNS([[NSData alloc] initWithBytes:data.data() length:data.size()]);
dispatchOnResourceLoaderRunLoop(^ {
[[protocol.get() client] URLProtocol:protocol.get() didLoadData:nsData.get()];
[[protocol client] URLProtocol:protocol.get() didLoadData:nsData.get()];
});
}
......@@ -244,7 +244,7 @@ void CustomProtocolManager::didReceiveResponse(uint64_t customProtocolID, const
RetainPtr<NSURLResponse> nsResponse = response.nsURLResponse();
dispatchOnResourceLoaderRunLoop(^ {
[[protocol.get() client] URLProtocol:protocol.get() didReceiveResponse:nsResponse.get() cacheStoragePolicy:static_cast<NSURLCacheStoragePolicy>(cacheStoragePolicy)];
[[protocol client] URLProtocol:protocol.get() didReceiveResponse:nsResponse.get() cacheStoragePolicy:static_cast<NSURLCacheStoragePolicy>(cacheStoragePolicy)];
});
}
......@@ -255,7 +255,7 @@ void CustomProtocolManager::didFinishLoading(uint64_t customProtocolID)
return;
dispatchOnResourceLoaderRunLoop(^ {
[[protocol.get() client] URLProtocolDidFinishLoading:protocol.get()];
[[protocol client] URLProtocolDidFinishLoading:protocol.get()];
});
removeCustomProtocol(protocol.get());
......
......@@ -249,7 +249,7 @@ bool decode(ArgumentDecoder& decoder, RetainPtr<NSAttributedString>& result)
if (!IPC::decode(decoder, plainString))
return false;
NSUInteger stringLength = [plainString.get() length];
NSUInteger stringLength = [plainString length];
RetainPtr<NSMutableAttributedString> resultString = adoptNS([[NSMutableAttributedString alloc] initWithString:plainString.get()]);
......@@ -273,7 +273,7 @@ bool decode(ArgumentDecoder& decoder, RetainPtr<NSAttributedString>& result)
if (!IPC::decode(decoder, attributes))
return false;
[resultString.get() addAttributes:attributes.get() range:NSMakeRange(rangeLocation, rangeLength)];
[resultString addAttributes:attributes.get() range:NSMakeRange(rangeLocation, rangeLength)];
}
result = adoptNS(resultString.leakRef());
......@@ -340,7 +340,7 @@ bool decode(ArgumentDecoder& decoder, RetainPtr<NSDictionary>& result)
if (!decode(decoder, value))
return false;
[dictionary.get() setObject:value.get() forKey:key.get()];
[dictionary setObject:value.get() forKey:key.get()];
}
result = adoptNS(dictionary.leakRef());
......@@ -425,7 +425,7 @@ bool decode(ArgumentDecoder& decoder, RetainPtr<NSArray>& result)
if (!decode(decoder, value))
return false;
[array.get() addObject:value.get()];
[array addObject:value.get()];
}
result = adoptNS(array.leakRef());
......
......@@ -193,7 +193,7 @@ public:
if (!decoder.decode(messageCoder))
return false;
[array.get() addObject:value.get()];
[array addObject:value.get()];
}
coder.m_root = array;
......@@ -217,7 +217,7 @@ public:
if (!decoder.decode(valueMessageCoder))
return false;
[dictionary.get() setObject:value.get() forKey:key.get()];
[dictionary setObject:value.get() forKey:key.get()];
}
coder.m_root = dictionary;
......
......@@ -109,7 +109,7 @@ struct GeolocationRequestData {
return;
if (_requestsWaitingForCoreLocationStart.isEmpty() && _requestsInWarmUp.isEmpty()) {
[_coreLocationProvider.get() stop];
[_coreLocationProvider stop];
_lastActivePosition.clear();
}
}
......@@ -118,7 +118,7 @@ struct GeolocationRequestData {
-(void)_startUpdating
{
_isWebCoreGeolocationActive = YES;
[_coreLocationProvider.get() start];
[_coreLocationProvider start];
// If we have the last position, it is from the initialization or warm up. It is the last known
// good position so we can return it directly.
......@@ -134,7 +134,7 @@ struct GeolocationRequestData {
-(void)_setEnableHighAccuracy:(BOOL)enableHighAccuracy
{
[_coreLocationProvider.get() setEnableHighAccuracy:enableHighAccuracy];
[_coreLocationProvider setEnableHighAccuracy:enableHighAccuracy];
}
#pragma mark - Public API implementation.
......@@ -172,7 +172,7 @@ struct GeolocationRequestData {
geolocationRequestData.permissionRequest = toImpl(permissionRequest);
geolocationRequestData.window = window;
_requestsWaitingForCoreLocationStart.append(geolocationRequestData);
[_coreLocationProvider.get() start];
[_coreLocationProvider start];
}
@end
......@@ -263,7 +263,7 @@ struct GeolocationRequestData {
- (void)deny
{
[_provider.get() permissionDenied:_permissionRequestProxy.get()];
[_provider permissionDenied:_permissionRequestProxy.get()];
_permissionRequestProxy->deny();
}
......
......@@ -307,13 +307,13 @@ static FloatQuad inflateQuad(const FloatQuad& quad, float inflateSize)
const CGFloat UIWebViewMinimumHighlightRadius = 2.0;
if (!_highlightView) {
_highlightView = adoptNS([[_UIHighlightView alloc] initWithFrame:CGRectZero]);
[_highlightView.get() setOpaque:NO];
[_highlightView.get() setCornerRadius:UIWebViewMinimumHighlightRadius];
[_highlightView setOpaque:NO];
[_highlightView setCornerRadius:UIWebViewMinimumHighlightRadius];
}
[self addSubview:_highlightView.get()];
RetainPtr<UIColor> highlightUIKitColor = adoptNS([[UIColor alloc] initWithRed:(color.red() / 255.0) green:(color.green() / 255.0) blue:(color.blue() / 255.0) alpha:(color.alpha() / 255.0)]);
[_highlightView.get() setColor:highlightUIKitColor.get()];
[_highlightView setColor:highlightUIKitColor.get()];
bool allHighlightRectsAreRectilinear = true;
const size_t quadCount = highlightedQuads.size();
......@@ -333,31 +333,31 @@ static FloatQuad inflateQuad(const FloatQuad& quad, float inflateSize)
// FIXME: WebKit1 uses the visibleRect. Using the whole frame from the page seems overkill.
CGRect boundaryRect = [self frame];
if (allHighlightRectsAreRectilinear)
[_highlightView.get() setFrames:rects.get() boundaryRect:boundaryRect];
[_highlightView setFrames:rects.get() boundaryRect:boundaryRect];
else {
RetainPtr<NSMutableArray> quads = adoptNS([[NSMutableArray alloc] initWithCapacity:static_cast<const NSUInteger>(quadCount)]);
for (size_t i = 0; i < quadCount; ++i) {
const FloatQuad& quad = highlightedQuads[i];
FloatQuad extendedQuad = inflateQuad(quad, UIWebViewMinimumHighlightRadius);
[quads.get() addObject:[NSValue valueWithCGPoint:extendedQuad.p1()]];
[quads.get() addObject:[NSValue valueWithCGPoint:extendedQuad.p2()]];
[quads.get() addObject:[NSValue valueWithCGPoint:extendedQuad.p3()]];
[quads.get() addObject:[NSValue valueWithCGPoint:extendedQuad.p4()]];
[quads addObject:[NSValue valueWithCGPoint:extendedQuad.p1()]];
[quads addObject:[NSValue valueWithCGPoint:extendedQuad.p2()]];
[quads addObject:[NSValue valueWithCGPoint:extendedQuad.p3()]];
[quads addObject:[NSValue valueWithCGPoint:extendedQuad.p4()]];
}
[_highlightView.get() setQuads:quads.get() boundaryRect:boundaryRect];
[_highlightView setQuads:quads.get() boundaryRect:boundaryRect];
}
RetainPtr<NSMutableArray> borderRadii = adoptNS([[NSMutableArray alloc] initWithCapacity:4]);
[borderRadii.get() addObject:[NSValue valueWithCGSize:CGSizeMake(topLeftRadius.width() + UIWebViewMinimumHighlightRadius, topLeftRadius.height() + UIWebViewMinimumHighlightRadius)]];
[borderRadii.get() addObject:[NSValue valueWithCGSize:CGSizeMake(topRightRadius.width() + UIWebViewMinimumHighlightRadius, topRightRadius.height() + UIWebViewMinimumHighlightRadius)]];
[borderRadii.get() addObject:[NSValue valueWithCGSize:CGSizeMake(bottomLeftRadius.width() + UIWebViewMinimumHighlightRadius, bottomLeftRadius.height() + UIWebViewMinimumHighlightRadius)]];
[borderRadii.get() addObject:[NSValue valueWithCGSize:CGSizeMake(bottomRightRadius.width() + UIWebViewMinimumHighlightRadius, bottomRightRadius.height() + UIWebViewMinimumHighlightRadius)]];
[_highlightView.get() setCornerRadii:borderRadii.get()];
[borderRadii addObject:[NSValue valueWithCGSize:CGSizeMake(topLeftRadius.width() + UIWebViewMinimumHighlightRadius, topLeftRadius.height() + UIWebViewMinimumHighlightRadius)]];
[borderRadii addObject:[NSValue valueWithCGSize:CGSizeMake(topRightRadius.width() + UIWebViewMinimumHighlightRadius, topRightRadius.height() + UIWebViewMinimumHighlightRadius)]];
[borderRadii addObject:[NSValue valueWithCGSize:CGSizeMake(bottomLeftRadius.width() + UIWebViewMinimumHighlightRadius, bottomLeftRadius.height() + UIWebViewMinimumHighlightRadius)]];
[borderRadii addObject:[NSValue valueWithCGSize:CGSizeMake(bottomRightRadius.width() + UIWebViewMinimumHighlightRadius, bottomRightRadius.height() + UIWebViewMinimumHighlightRadius)]];
[_highlightView setCornerRadii:borderRadii.get()];
}
- (void)_cancelLongPressGestureRecognizer
{
[_highlightLongPressGestureRecognizer.get() cancel];
[_highlightLongPressGestureRecognizer cancel];
}
- (void)_didScroll
......@@ -499,7 +499,7 @@ static inline bool isSamePair(UIGestureRecognizer *a, UIGestureRecognizer *b, UI
- (void)_cancelInteraction
{
_isTapHighlightIDValid = NO;
[_highlightView.get() removeFromSuperview];
[_highlightView removeFromSuperview];
}
- (BOOL)hasSelectablePositionAtPoint:(CGPoint)point
......
......@@ -150,15 +150,15 @@ void FindIndicatorWindow::setFindIndicator(PassRefPtr<FindIndicator> findIndicat
backing:NSBackingStoreBuffered
defer:NO]);
[m_findIndicatorWindow.get() setBackgroundColor:[NSColor clearColor]];
[m_findIndicatorWindow.get() setOpaque:NO];
[m_findIndicatorWindow.get() setIgnoresMouseEvents:YES];
[m_findIndicatorWindow setBackgroundColor:[NSColor clearColor]];
[m_findIndicatorWindow setOpaque:NO];
[m_findIndicatorWindow setIgnoresMouseEvents:YES];
RetainPtr<WKFindIndicatorView> findIndicatorView = adoptNS([[WKFindIndicatorView alloc] _initWithFindIndicator:m_findIndicator]);
[m_findIndicatorWindow.get() setContentView:findIndicatorView.get()];
[m_findIndicatorWindow setContentView:findIndicatorView.get()];
[[m_wkView window] addChildWindow:m_findIndicatorWindow.get() ordered:NSWindowAbove];
[m_findIndicatorWindow.get() setReleasedWhenClosed:NO];
[m_findIndicatorWindow setReleasedWhenClosed:NO];
if (animate) {
// Start the bounce animation.
......@@ -167,7 +167,7 @@ void FindIndicatorWindow::setFindIndicator(PassRefPtr<FindIndicator> findIndicat
animationDuration:bounceAnimationDuration
animationProgressCallback:&FindIndicatorWindow::bounceAnimationCallback
animationDidEndCallback:&FindIndicatorWindow::bounceAnimationDidEnd]);
[m_bounceAnimation.get() startAnimation];
[m_bounceAnimation startAnimation];
}
if (fadeOut)
......@@ -182,20 +182,20 @@ void FindIndicatorWindow::closeWindow()
m_startFadeOutTimer.stop();
if (m_fadeOutAnimation) {
[m_fadeOutAnimation.get() stopAnimation];
[m_fadeOutAnimation stopAnimation];
m_fadeOutAnimation = nullptr;
}
if (m_bounceAnimation) {
[m_bounceAnimation.get() stopAnimation];
[m_bounceAnimation stopAnimation];
m_bounceAnimation = nullptr;
}
if (m_bounceAnimationContext)
WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
[[m_findIndicatorWindow.get() parentWindow] removeChildWindow:m_findIndicatorWindow.get()];
[m_findIndicatorWindow.get() close];
[[m_findIndicatorWindow parentWindow] removeChildWindow:m_findIndicatorWindow.get()];
[m_findIndicatorWindow close];
m_findIndicatorWindow = nullptr;
}
......@@ -207,14 +207,14 @@ void FindIndicatorWindow::startFadeOutTimerFired()
animationDuration:fadeOutAnimationDuration
animationProgressCallback:&FindIndicatorWindow::fadeOutAnimationCallback
animationDidEndCallback:&FindIndicatorWindow::fadeOutAnimationDidEnd]);
[m_fadeOutAnimation.get() startAnimation];
[m_fadeOutAnimation startAnimation];
}
void FindIndicatorWindow::fadeOutAnimationCallback(double progress)
{
ASSERT(m_fadeOutAnimation);
[m_findIndicatorWindow.get() setAlphaValue:1.0 - progress];
[m_findIndicatorWindow setAlphaValue:1.0 - progress];
}
void FindIndicatorWindow::fadeOutAnimationDidEnd()
......
......@@ -76,14 +76,14 @@ static BOOL isForcingPreviewUpdate;
- (void)_setAutodisplay:(BOOL)newState
{
if (!newState && [[_wkView.get() window] isAutodisplay])
[_wkView.get() displayIfNeeded];
if (!newState && [[_wkView window] isAutodisplay])
[_wkView displayIfNeeded];
[[_wkView.get() window] setAutodisplay:newState];
[[_wkView window] setAutodisplay:newState];
// For some reason, painting doesn't happen for a long time without this call, <rdar://problem/8975229>.
if (newState)
[_wkView.get() displayIfNeeded];
[_wkView displayIfNeeded];
}
......
......@@ -1605,11 +1605,11 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
if (actualRange) {
*actualRange = nsRange;
actualRange->length = [result.string.get() length];
actualRange->length = [result.string length];
}
LOG(TextInput, "attributedSubstringFromRange:(%u, %u) -> \"%@\"", nsRange.location, nsRange.length, [result.string.get() string]);
return [[result.string.get() retain] autorelease];
LOG(TextInput, "attributedSubstringFromRange:(%u, %u) -> \"%@\"", nsRange.location, nsRange.length, [result.string string]);
return [[result.string retain] autorelease];
}
- (NSUInteger)characterIndexForPoint:(NSPoint)thePoint
......@@ -2202,7 +2202,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
}
ColorSpaceData colorSpaceData;
colorSpaceData.cgColorSpace = [_data->_colorSpace.get() CGColorSpace];
colorSpaceData.cgColorSpace = [_data->_colorSpace CGColorSpace];
return colorSpaceData;
}
......@@ -2585,7 +2585,7 @@ static bool matchesExtensionOrEquivalent(NSString *filename, NSString *extension
NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:pasteboardName];
RetainPtr<NSMutableArray> types = adoptNS([[NSMutableArray alloc] initWithObjects:NSFilesPromisePboardType, nil]);
[types.get() addObjectsFromArray:archiveBuffer ? PasteboardTypes::forImagesWithArchive() : PasteboardTypes::forImages()];
[types addObjectsFromArray:archiveBuffer ? PasteboardTypes::forImagesWithArchive() : PasteboardTypes::forImages()];
[pasteboard declareTypes:types.get() owner:self];
if (!matchesExtensionOrEquivalent(filename, extension))
filename = [[filename stringByAppendingString:@"."] stringByAppendingString:extension];
......@@ -2676,7 +2676,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
}
// FIXME: Report an error if we fail to create a file.
NSString *path = [[dropDestination path] stringByAppendingPathComponent:[wrapper.get() preferredFilename]];
NSString *path = [[dropDestination path] stringByAppendingPathComponent:[wrapper preferredFilename]];
path = pathWithUniqueFilenameForPath(path);
if (![wrapper writeToURL:[NSURL fileURLWithPath:path] options:NSFileWrapperWritingWithNameUpdating originalContentsURL:nil error:nullptr])
LOG_ERROR("Failed to create image file via -[NSFileWrapper writeToURL:options:originalContentsURL:error:]");
......@@ -2765,8 +2765,8 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
// 2) prevents any NSBeep; we don't ever want to beep here.
RetainPtr<WKResponderChainSink> sink = adoptNS([[WKResponderChainSink alloc] initWithResponderChain:self]);
[super doCommandBySelector:selector];
[sink.get() detach];
return ![sink.get() didReceiveUnhandledCommand];
[sink detach];
return ![sink didReceiveUnhandledCommand];
}
- (void)_setIntrinsicContentSize:(NSSize)intrinsicContentSize
......
......@@ -271,7 +271,7 @@ void PluginProcessProxy::beginModal()
ASSERT(!m_activationObserver);
m_placeholderWindow = adoptNS([[WKPlaceholderModalWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
[m_placeholderWindow.get() setReleasedWhenClosed:NO];
[m_placeholderWindow setReleasedWhenClosed:NO];
m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationWillBecomeActiveNotification object:NSApp queue:nil
usingBlock:^(NSNotification *){ applicationDidBecomeActive(); }];
......@@ -282,7 +282,7 @@ void PluginProcessProxy::beginModal()
[NSApp runModalForWindow:m_placeholderWindow.get()];
[m_placeholderWindow.get() orderOut:nil];
[m_placeholderWindow orderOut:nil];
m_placeholderWindow = nullptr;
}
......
......@@ -118,7 +118,7 @@ void CorrectionPanel::handleAcceptedReplacement(NSString* acceptedReplacement, N
return;
NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker];
NSInteger documentTag = [m_view.get() spellCheckerDocumentTag];
NSInteger documentTag = [m_view spellCheckerDocumentTag];
switch (correctionIndicatorType) {
case NSCorrectionIndicatorTypeDefault:
......@@ -141,7 +141,7 @@ void CorrectionPanel::handleAcceptedReplacement(NSString* acceptedReplacement, N
break;
}
[m_view.get() handleAcceptedAlternativeText:acceptedReplacement];
[m_view handleAcceptedAlternativeText:acceptedReplacement];
m_view.clear();
if (acceptedReplacement)
m_resultForDismissal = adoptNS([acceptedReplacement copy]);
......
......@@ -418,7 +418,7 @@ void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String& badGr
RetainPtr<NSMutableArray> corrections = adoptNS([[NSMutableArray alloc] init]);
for (size_t i = 0; i < grammarDetail.guesses.size(); ++i) {
NSString *guess = grammarDetail.guesses[i];
[corrections.get() addObject:guess];
[corrections addObject:guess];
}
NSRange grammarRange = NSMakeRange(grammarDetail.location, grammarDetail.length);
......
......@@ -167,7 +167,7 @@ static NSRect convertRectToScreen(NSWindow *window, NSRect rect)
NSWindow* window = [self window];
NSRect screenFrame = [[window screen] frame];
[window setFrame:screenFrame display:YES];
[_backgroundWindow.get() setFrame:screenFrame display:YES];
[_backgroundWindow setFrame:screenFrame display:YES];
}
#pragma mark -
......@@ -235,10 +235,10 @@ static RetainPtr<CGImageRef> createImageWithCopiedData(CGImageRef sourceImage)
// Swap the webView placeholder into place.
if (!_webViewPlaceholder) {
_webViewPlaceholder = adoptNS([[WebCoreFullScreenPlaceholderView alloc] initWithFrame:[_webView frame]]);
[_webViewPlaceholder.get() setAction:@selector(cancelOperation:)];
[_webViewPlaceholder setAction:@selector(cancelOperation:)];
}
[_webViewPlaceholder.get() setTarget:nil];
[_webViewPlaceholder.get() setContents:(id)webViewContents.get()];
[_webViewPlaceholder setTarget:nil];
[_webViewPlaceholder setContents:(id)webViewContents.get()];
[self _replaceView:_webView with:_webViewPlaceholder.get()];
// Then insert the WebView into the full screen window
......@@ -286,23 +286,23 @@ static RetainPtr<CGImageRef> createImageWithCopiedData(CGImageRef sourceImage)
windowBounds.origin = NSZeroPoint;
WKWindowSetClipRect([self window], windowBounds);
[_fadeAnimation.get() stopAnimation];
[_fadeAnimation.get() setWindow:nil];
[_fadeAnimation stopAnimation];
[_fadeAnimation setWindow:nil];
_fadeAnimation = nullptr;
[_backgroundWindow.get() orderOut:self];
[_backgroundWindow.get() setFrame:NSZeroRect display:YES];
[_backgroundWindow orderOut:self];
[_backgroundWindow setFrame:NSZeroRect display:YES];
[_webViewPlaceholder.get() setExitWarningVisible:YES];
[_webViewPlaceholder.get() setTarget:self];
[_webViewPlaceholder setExitWarningVisible:YES];
[_webViewPlaceholder setTarget:self];
} else {
// Transition to fullscreen failed. Clean up.
_fullScreenState = NotInFullScreen;
[_scaleAnimation.get() stopAnimation];
[_scaleAnimation stopAnimation];
[_backgroundWindow.get() orderOut:self];
[_backgroundWindow.get() setFrame:NSZeroRect display:YES];
[_backgroundWindow orderOut:self];
[_backgroundWindow setFrame:NSZeroRect display:YES];
[[self window] setAutodisplay:YES];
[_webView _setSuppressVisibilityUpdates:NO];
......@@ -324,7 +324,7 @@ static RetainPtr<CGImageRef> createImageWithCopiedData(CGImageRef sourceImage)
- (void)exitFullScreen
{
if (_watchdogTimer) {
[_watchdogTimer.get() invalidate];
[_watchdogTimer invalidate];
_watchdogTimer.clear();
}
......@@ -332,7 +332,7 @@ static RetainPtr<CGImageRef> createImageWithCopiedData(CGImageRef sourceImage)
return;
_fullScreenState = WaitingToExitFullScreen;
[_webViewPlaceholder.get() setExitWarningVisible:NO];
[_webViewPlaceholder setExitWarningVisible:NO];
// Screen updates to be re-enabled in _startExitFullScreenAnimationWithDuration: or beganExitFullScreenWithInitialFrame:finalFrame:
NSDisableScreenUpdates();
......@@ -341,7 +341,7 @@ static RetainPtr<CGImageRef> createImageWithCopiedData(CGImageRef sourceImage)
// See the related comment in enterFullScreen:
// We will resume the normal behavior in _startExitFullScreenAnimationWithDuration:
[_webView _setSuppressVisibilityUpdates:YES];
[_webViewPlaceholder.get() setTarget:nil];
[_webViewPlaceholder setTarget:nil];
[self _manager]->setAnimatingFullScreen(true);
[self _manager]->willExitFullScreen();
......@@ -377,7 +377,7 @@ static void completeFinishExitFullScreenAnimationAfterRepaint(WKErrorRef, void*)
// Screen updates to be re-enabled in completeFinishExitFullScreenAnimationAfterRepaint.
NSDisableScreenUpdates();
[[_webViewPlaceholder.get() window] setAutodisplay:NO];
[[_webViewPlaceholder window] setAutodisplay:NO];
NSResponder *firstResponder = [[self window] firstResponder];
[self _replaceView:_webViewPlaceholder.get() with:_webView];
......@@ -390,12 +390,12 @@ static void completeFinishExitFullScreenAnimationAfterRepaint(WKErrorRef, void*)
[[self window] orderOut:self];
[[self window] setFrame:NSZeroRect display:YES];
[_fadeAnimation.get() stopAnimation];
[_fadeAnimation.get() setWindow:nil];
[_fadeAnimation stopAnimation];
[_fadeAnimation setWindow:nil];
_fadeAnimation = nullptr;
[_backgroundWindow.get() orderOut:self];
[_backgroundWindow.get() setFrame:NSZeroRect display:YES];
[_backgroundWindow orderOut:self];
[_backgroundWindow setFrame:NSZeroRect display:YES];
[[_webView window] makeKeyAndOrderFront:self];
......@@ -555,9 +555,9 @@ static NSRect windowFrameFromApparentFrames(NSRect screenFrame, NSRect initialFr
_scaleAnimation = adoptNS([[WebWindowScaleAnimation alloc] initWithHintedDuration:duration window:[self window] initalFrame:initialWindowFrame finalFrame:screenFrame]);
[_scaleAnimation.get() setAnimationBlockingMode:NSAnimationNonblocking];
[_scaleAnimation.get() setCurrentProgress:0];
[_scaleAnimation.get() startAnimation];
[_scaleAnimation setAnimationBlockingMode:NSAnimationNonblocking];
[_scaleAnimation setCurrentProgress:0];
[_scaleAnimation startAnimation];
// WKWindowSetClipRect takes window coordinates, so convert from screen coordinates here:
NSRect finalBounds = _finalFrame;
......@@ -577,24 +577,24 @@ static NSRect windowFrameFromApparentFrames(NSRect screenFrame, NSRect initialFr
if (!_backgroundWindow)
_backgroundWindow = createBackgroundFullscreenWindow(screenFrame);
else
[_backgroundWindow.get() setFrame:screenFrame display:NO];
[_backgroundWindow setFrame:screenFrame display:NO];
CGFloat currentAlpha = 0;
if (_fadeAnimation) {
currentAlpha = [_fadeAnimation.get() currentAlpha];
[_fadeAnimation.get() stopAnimation];
[_fadeAnimation.get() setWindow:nil];
currentAlpha = [_fadeAnimation currentAlpha];
[_fadeAnimation stopAnimation];
[_fadeAnimation setWindow:nil];
}
_fadeAnimation = adoptNS([[WebWindowFadeAnimation alloc] initWithDuration:duration
window:_backgroundWindow.get()
initialAlpha:currentAlpha
finalAlpha:1]);
[_fadeAnimation.get() setAnimationBlockingMode:NSAnimationNonblocking];
[_fadeAnimation.get() setCurrentProgress:0];
[_fadeAnimation.get() startAnimation];
[_fadeAnimation setAnimationBlockingMode:NSAnimationNonblocking];
[_fadeAnimation setCurrentProgress:0];
[_fadeAnimation startAnimation];
[_backgroundWindow.get() orderWindow:NSWindowBelow relativeTo:[[self window] windowNumber]];
[_backgroundWindow orderWindow:NSWindowBelow relativeTo:[[self window] windowNumber]];
[_webView _setSuppressVisibilityUpdates:NO];
[[self window] setAutodisplay:YES];
......@@ -615,33 +615,33 @@ static NSRect windowFrameFromApparentFrames(NSRect screenFrame, NSRect initialFr
NSRect screenFrame = [[[self window] screen] frame];
NSRect initialWindowFrame = windowFrameFromApparentFrames(screenFrame, _initialFrame, _finalFrame);
NSRect currentFrame = _scaleAnimation ? [_scaleAnimation.get() currentFrame] : [[self window] frame];
NSRect currentFrame = _scaleAnimation ? [_scaleAnimation currentFrame] : [[self window] frame];
_scaleAnimation = adoptNS([[WebWindowScaleAnimation alloc] initWithHintedDuration:duration window:[self window] initalFrame:currentFrame finalFrame:initialWindowFrame]);
[_scaleAnimation.get() setAnimationBlockingMode:NSAnimationNonblocking];
[_scaleAnimation.get() setCurrentProgress:0];
[_scaleAnimation.get() startAnimation];
[_scaleAnimation setAnimationBlockingMode:NSAnimationNonblocking];
[_scaleAnimation setCurrentProgress:0];
[_scaleAnimation startAnimation];
if (!_backgroundWindow)
_backgroundWindow = createBackgroundFullscreenWindow(screenFrame);
else
[_backgroundWindow.get() setFrame:screenFrame display:NO];
[_backgroundWindow setFrame:screenFrame display:NO];
CGFloat currentAlpha = 1;
if (_fadeAnimation) {
currentAlpha = [_fadeAnimation.get() currentAlpha];
[_fadeAnimation.get() stopAnimation];