Title: [199960] trunk/Source
Revision
199960
Author
aes...@apple.com
Date
2016-04-23 19:49:49 -0700 (Sat, 23 Apr 2016)

Log Message

Fix issues found by the clang static analyzer
https://bugs.webkit.org/show_bug.cgi?id=156956

Reviewed by Alexey Proskuryakov.

Source/WebCore:

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange): Stored tz in a RetainPtr.
* platform/cf/KeyedDecoderCF.cpp:
(WebCore::KeyedDecoderCF::KeyedDecoderCF): If dynamic_cf_cast returned nullptr, the result of
CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr, then leaked/adopted it
into m_rootDictionary (to avoid retain count churn) if it is a CFDictionary.
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController dealloc]): Released _externalPlaybackAirPlayDeviceLocalizedName.
(-[WebAVMediaSelectionOption dealloc]): Added to release _localizedDisplayName.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer dealloc]): Released _pixelBufferAttributes.
* platform/network/cocoa/WebCoreNSURLSession.h: Removed the readwrite attributes from properties, since
properties are readwrite by default.
* platform/network/cocoa/WebCoreNSURLSession.mm: Removed @dynamic, which isn't necessary just for defining a custom getter.
(-[WebCoreNSURLSessionDataTask dealloc]): Added to release copied ivars.

Source/WebKit/mac:

* WebView/WebDeviceOrientationProviderMock.mm:
(-[WebDeviceOrientationProviderMock dealloc]): [super dealloc] should be called last.

Source/WebKit2:

* UIProcess/API/Cocoa/WKPreviewActionItem.mm:
(-[WKPreviewAction dealloc]): Added to release _identifier.
* UIProcess/_WKWebViewPrintFormatter.mm:
(-[_WKWebViewPrintFormatter dealloc]): Released _frameToPrint.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView inputView]): -createPeripheralWithView: returned a retained object, but the method name did not
match Cocoa conventions. Called -initWithView: instead.
(-[WKContentView _showAttachmentSheet]): Stored the _WKActivatedElementInfo in a RetainPtr.
(-[WKContentView _dataForPreviewItemController:atPosition:type:]): Ditto.
(+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
The properties contextBeforeSelection, selectedText, markedText, and contextAfterSelection have the 'copy'
annotation in UIWKAutocorrectionContext, so the additional copy made here would be leaked. Removed the extra copy.
(-[WKAutocorrectionContext dealloc]): Deleted.
* UIProcess/ios/forms/WKFormInputControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKFormInputControl initWithView:]): Changed to return instancetype.
(+[WKFormInputControl createPeripheralWithView:]): Deleted.
* UIProcess/ios/forms/WKFormSelectControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
* UIProcess/ios/forms/WKFormSelectControl.mm:
(+[WKFormSelectControl createPeripheralWithView:]): Deleted.
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::decodeLegacySessionState): If dynamic_cf_cast returned nullptr, the result of
CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr before calling dynamic_cf_cast.
* UIProcess/mac/ServicesController.mm:
(WebKit::ServicesController::refreshExistingServices): Used a RetainPtr for attachment and cell.
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::setupServicesMenu): Used a RetainPtr for groupEntry.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (199959 => 199960)


--- trunk/Source/WebCore/ChangeLog	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebCore/ChangeLog	2016-04-24 02:49:49 UTC (rev 199960)
@@ -1,3 +1,26 @@
+2016-04-23  Andy Estes  <aes...@apple.com>
+
+        Fix issues found by the clang static analyzer
+        https://bugs.webkit.org/show_bug.cgi?id=156956
+
+        Reviewed by Alexey Proskuryakov.
+
+        * editing/cocoa/DataDetection.mm:
+        (WebCore::DataDetection::detectContentInRange): Stored tz in a RetainPtr.
+        * platform/cf/KeyedDecoderCF.cpp:
+        (WebCore::KeyedDecoderCF::KeyedDecoderCF): If dynamic_cf_cast returned nullptr, the result of
+        CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr, then leaked/adopted it
+        into m_rootDictionary (to avoid retain count churn) if it is a CFDictionary.
+        * platform/ios/WebAVPlayerController.mm:
+        (-[WebAVPlayerController dealloc]): Released _externalPlaybackAirPlayDeviceLocalizedName.
+        (-[WebAVMediaSelectionOption dealloc]): Added to release _localizedDisplayName.
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (-[WebAVPlayerLayer dealloc]): Released _pixelBufferAttributes.
+        * platform/network/cocoa/WebCoreNSURLSession.h: Removed the readwrite attributes from properties, since
+        properties are readwrite by default.
+        * platform/network/cocoa/WebCoreNSURLSession.mm: Removed @dynamic, which isn't necessary just for defining a custom getter.
+        (-[WebCoreNSURLSessionDataTask dealloc]): Added to release copied ivars.
+
 2016-04-23  Dan Bernstein  <m...@apple.com>
 
         <rdar://problem/25894586> A project has failed to build because WTF_MAKE_FAST_ALLOCATED was not defined

Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.mm (199959 => 199960)


--- trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -550,7 +550,7 @@
         allResultRanges.append(WTFMove(fragmentRanges));
     }
     
-    CFTimeZoneRef tz = CFTimeZoneCopyDefault();
+    auto tz = adoptCF(CFTimeZoneCopyDefault());
     NSDate *referenceDate = [NSDate date];
     Text* lastTextNodeToUpdate = nullptr;
     String lastNodeContent;
@@ -582,7 +582,7 @@
             rangeBoundaries.uncheckedAppend({ range->startPosition(), range->endPosition() });
 
         NSString *identifier = dataDetectorStringForPath(indexPaths[resultIndex].get());
-        NSString *correspondingURL = constructURLStringForResult(coreResult, identifier, referenceDate, (NSTimeZone *)tz, types);
+        NSString *correspondingURL = constructURLStringForResult(coreResult, identifier, referenceDate, (NSTimeZone *)tz.get(), types);
         bool didModifyDOM = false;
 
         if (!correspondingURL || searchForLinkRemovingExistingDDLinks(resultRanges.first()->startContainer(), resultRanges.last()->endContainer(), didModifyDOM))

Modified: trunk/Source/WebCore/platform/cf/KeyedDecoderCF.cpp (199959 => 199960)


--- trunk/Source/WebCore/platform/cf/KeyedDecoderCF.cpp	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebCore/platform/cf/KeyedDecoderCF.cpp	2016-04-24 02:49:49 UTC (rev 199960)
@@ -39,9 +39,10 @@
 KeyedDecoderCF::KeyedDecoderCF(const uint8_t* data, size_t size)
 {
     auto cfData = adoptCF(CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, data, size, kCFAllocatorNull));
+    auto cfPropertyList = adoptCF(CFPropertyListCreateWithData(kCFAllocatorDefault, cfData.get(), kCFPropertyListImmutable, nullptr, nullptr));
 
-    if (auto rootDictionary = adoptCF(dynamic_cf_cast<CFDictionaryRef>(CFPropertyListCreateWithData(kCFAllocatorDefault, cfData.get(), kCFPropertyListImmutable, nullptr, nullptr))))
-        m_rootDictionary = WTFMove(rootDictionary);
+    if (dynamic_cf_cast<CFDictionaryRef>(cfPropertyList.get()))
+        m_rootDictionary = adoptCF(static_cast<CFDictionaryRef>(cfPropertyList.leakRef()));
     else
         m_rootDictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, nullptr, nullptr, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     m_dictionaryStack.append(m_rootDictionary.get());

Modified: trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm (199959 => 199960)


--- trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -71,6 +71,7 @@
     [_legibleMediaSelectionOptions release];
     [_currentAudioMediaSelectionOption release];
     [_currentLegibleMediaSelectionOption release];
+    [_externalPlaybackAirPlayDeviceLocalizedName release];
     [super dealloc];
 }
 
@@ -453,6 +454,13 @@
 @end
 
 @implementation WebAVMediaSelectionOption
+
+- (void)dealloc
+{
+    [_localizedDisplayName release];
+    [super dealloc];
+}
+
 @end
 
 #endif // PLATFORM(IOS)

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (199959 => 199960)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -234,6 +234,7 @@
 - (void)dealloc
 {
     [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(resolveBounds) object:nil];
+    [_pixelBufferAttributes release];
     [super dealloc];
 }
 

Modified: trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h (199959 => 199960)


--- trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h	2016-04-24 02:49:49 UTC (rev 199960)
@@ -119,16 +119,17 @@
     NSString *_taskDescription;
     float _priority;
 }
-@property (readwrite) NSUInteger taskIdentifier;
-@property (readwrite, copy) NSURLRequest *originalRequest;
-@property (readwrite, copy) NSURLRequest *currentRequest;
+
+@property NSUInteger taskIdentifier;
+@property (copy) NSURLRequest *originalRequest;
+@property (copy) NSURLRequest *currentRequest;
 @property (readonly, copy) NSURLResponse *response;
-@property (readwrite) int64_t countOfBytesReceived;
-@property (readwrite) int64_t countOfBytesSent;
-@property (readwrite) int64_t countOfBytesExpectedToSend;
-@property (readwrite) int64_t countOfBytesExpectedToReceive;
-@property (readwrite) NSURLSessionTaskState state;
-@property (readwrite, copy) NSError *error;
+@property int64_t countOfBytesReceived;
+@property int64_t countOfBytesSent;
+@property int64_t countOfBytesExpectedToSend;
+@property int64_t countOfBytesExpectedToReceive;
+@property NSURLSessionTaskState state;
+@property (copy) NSError *error;
 @property (copy) NSString *taskDescription;
 @property float priority;
 - (void)cancel;

Modified: trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm (199959 => 199960)


--- trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -457,7 +457,7 @@
 @synthesize error=_error;
 @synthesize taskDescription=_taskDescription;
 @synthesize priority=_priority;
-@dynamic response;
+
 - (NSURLResponse *)response
 {
     return _response.get();
@@ -497,6 +497,15 @@
     });
 }
 
+- (void)dealloc
+{
+    [_originalRequest release];
+    [_currentRequest release];
+    [_error release];
+    [_taskDescription release];
+    [super dealloc];
+}
+
 #pragma mark - NSURLSession SPI
 
 - (NSDictionary *)_timingData

Modified: trunk/Source/WebKit/mac/ChangeLog (199959 => 199960)


--- trunk/Source/WebKit/mac/ChangeLog	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-04-24 02:49:49 UTC (rev 199960)
@@ -1,3 +1,13 @@
+2016-04-23  Andy Estes  <aes...@apple.com>
+
+        Fix issues found by the clang static analyzer
+        https://bugs.webkit.org/show_bug.cgi?id=156956
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebView/WebDeviceOrientationProviderMock.mm:
+        (-[WebDeviceOrientationProviderMock dealloc]): [super dealloc] should be called last.
+
 2016-04-21  Tim Horton  <timothy_hor...@apple.com>
 
         Fix the iOS build: WAKView may not respond to drawLayer:inContext:

Modified: trunk/Source/WebKit/mac/WebView/WebDeviceOrientationProviderMock.mm (199959 => 199960)


--- trunk/Source/WebKit/mac/WebView/WebDeviceOrientationProviderMock.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit/mac/WebView/WebDeviceOrientationProviderMock.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -95,8 +95,8 @@
 
 - (void)dealloc
 {
+    [m_internal release];
     [super dealloc];
-    [m_internal release];
 }
 
 - (void)setOrientation:(WebDeviceOrientation*)orientation

Modified: trunk/Source/WebKit2/ChangeLog (199959 => 199960)


--- trunk/Source/WebKit2/ChangeLog	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/ChangeLog	2016-04-24 02:49:49 UTC (rev 199960)
@@ -1,3 +1,38 @@
+2016-04-23  Andy Estes  <aes...@apple.com>
+
+        Fix issues found by the clang static analyzer
+        https://bugs.webkit.org/show_bug.cgi?id=156956
+
+        Reviewed by Alexey Proskuryakov.
+
+        * UIProcess/API/Cocoa/WKPreviewActionItem.mm:
+        (-[WKPreviewAction dealloc]): Added to release _identifier.
+        * UIProcess/_WKWebViewPrintFormatter.mm:
+        (-[_WKWebViewPrintFormatter dealloc]): Released _frameToPrint.
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView inputView]): -createPeripheralWithView: returned a retained object, but the method name did not
+        match Cocoa conventions. Called -initWithView: instead.
+        (-[WKContentView _showAttachmentSheet]): Stored the _WKActivatedElementInfo in a RetainPtr.
+        (-[WKContentView _dataForPreviewItemController:atPosition:type:]): Ditto.
+        (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
+        The properties contextBeforeSelection, selectedText, markedText, and contextAfterSelection have the 'copy'
+        annotation in UIWKAutocorrectionContext, so the additional copy made here would be leaked. Removed the extra copy.
+        (-[WKAutocorrectionContext dealloc]): Deleted.
+        * UIProcess/ios/forms/WKFormInputControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
+        * UIProcess/ios/forms/WKFormInputControl.mm:
+        (-[WKFormInputControl initWithView:]): Changed to return instancetype.
+        (+[WKFormInputControl createPeripheralWithView:]): Deleted.
+        * UIProcess/ios/forms/WKFormSelectControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
+        * UIProcess/ios/forms/WKFormSelectControl.mm:
+        (+[WKFormSelectControl createPeripheralWithView:]): Deleted.
+        * UIProcess/mac/LegacySessionStateCoding.cpp:
+        (WebKit::decodeLegacySessionState): If dynamic_cf_cast returned nullptr, the result of
+        CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr before calling dynamic_cf_cast.
+        * UIProcess/mac/ServicesController.mm:
+        (WebKit::ServicesController::refreshExistingServices): Used a RetainPtr for attachment and cell.
+        * UIProcess/mac/WebContextMenuProxyMac.mm:
+        (WebKit::WebContextMenuProxyMac::setupServicesMenu): Used a RetainPtr for groupEntry.
+
 2016-04-23  Chris Dumez  <cdu...@apple.com>
 
         Tie the DiagnosticLoggingClient's lifetime to the Page

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreviewActionItem.mm (199959 => 199960)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreviewActionItem.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreviewActionItem.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -45,6 +45,12 @@
     return action;
 }
 
+- (void)dealloc
+{
+    [_identifier release];
+    [super dealloc];
+}
+
 @end
 
 #endif // WK_API_ENABLED && TARGET_OS_IPHONE

Modified: trunk/Source/WebKit2/UIProcess/_WKWebViewPrintFormatter.mm (199959 => 199960)


--- trunk/Source/WebKit2/UIProcess/_WKWebViewPrintFormatter.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/UIProcess/_WKWebViewPrintFormatter.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -49,6 +49,7 @@
 - (void)dealloc
 {
     [self.webView _endPrinting];
+    [_frameToPrint release];
     [super dealloc];
 }
 

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (199959 => 199960)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -1066,7 +1066,7 @@
         return nil;
 
     if (!_inputPeripheral)
-        _inputPeripheral = adoptNS(_assistedNodeInformation.elementType == InputType::Select ? [WKFormSelectControl createPeripheralWithView:self] : [WKFormInputControl createPeripheralWithView:self]);
+        _inputPeripheral = adoptNS(_assistedNodeInformation.elementType == InputType::Select ? [[WKFormSelectControl alloc] initWithView:self] : [[WKFormInputControl alloc] initWithView:self]);
     else
         [self _displayFormNodeInputView];
 
@@ -1138,9 +1138,11 @@
 - (void)_showAttachmentSheet
 {
     id <WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([_webView UIDelegate]);
-    
-    if ([uiDelegate respondsToSelector:@selector(_webView:showCustomSheetForElement:)])
-        [uiDelegate _webView:_webView showCustomSheetForElement:[[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeAttachment URL:[NSURL _web_URLWithWTFString:_positionInformation.url] location:_positionInformation.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:nil]];
+    if (![uiDelegate respondsToSelector:@selector(_webView:showCustomSheetForElement:)])
+        return;
+
+    auto element = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeAttachment URL:[NSURL _web_URLWithWTFString:_positionInformation.url] location:_positionInformation.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:nil]);
+    [uiDelegate _webView:_webView showCustomSheetForElement:element.get()];
 }
 
 - (void)_showLinkSheet
@@ -3914,8 +3916,8 @@
         // FIXME: Should use UIKit constants.
         enum { WKUIPreviewItemTypeAttachment = 5 };
         *type = static_cast<UIPreviewItemType>(WKUIPreviewItemTypeAttachment);
-        const auto& element = [[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeAttachment URL:[NSURL _web_URLWithWTFString:_positionInformation.url] location:_positionInformation.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:nil];
-        NSUInteger index = [uiDelegate _webView:_webView indexIntoAttachmentListForElement:element];
+        auto element = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeAttachment URL:[NSURL _web_URLWithWTFString:_positionInformation.url] location:_positionInformation.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:nil]);
+        NSUInteger index = [uiDelegate _webView:_webView indexIntoAttachmentListForElement:element.get()];
         if (index != NSNotFound) {
             dataForPreview[@"UIPreviewDataAttachmentList"] = [uiDelegate _attachmentListForWebView:_webView];
             dataForPreview[@"UIPreviewDataAttachmentIndex"] = [NSNumber numberWithUnsignedInteger:index];
@@ -4296,27 +4298,17 @@
     WKAutocorrectionContext *context = [[WKAutocorrectionContext alloc] init];
 
     if ([beforeText length])
-        context.contextBeforeSelection = [beforeText copy];
+        context.contextBeforeSelection = beforeText;
     if ([selectedText length])
-        context.selectedText = [selectedText copy];
+        context.selectedText = selectedText;
     if ([markedText length])
-        context.markedText = [markedText copy];
+        context.markedText = markedText;
     if ([afterText length])
-        context.contextAfterSelection = [afterText copy];
+        context.contextAfterSelection = afterText;
     context.rangeInMarkedText = range;
     return [context autorelease];
 }
 
-- (void)dealloc
-{
-    [self.contextBeforeSelection release];
-    [self.markedText release];
-    [self.selectedText release];
-    [self.contextAfterSelection release];
-
-    [super dealloc];
-}
-
 @end
 
 #endif // PLATFORM(IOS)

Modified: trunk/Source/WebKit2/UIProcess/ios/forms/WKFormInputControl.h (199959 => 199960)


--- trunk/Source/WebKit2/UIProcess/ios/forms/WKFormInputControl.h	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/UIProcess/ios/forms/WKFormInputControl.h	2016-04-24 02:49:49 UTC (rev 199960)
@@ -30,7 +30,7 @@
 @class WKContentView;
 
 @interface WKFormInputControl : NSObject<WKFormPeripheral>
-+ (WKFormInputControl *)createPeripheralWithView:(WKContentView *)view;
+- (instancetype)initWithView:(WKContentView *)view;
 @end
 
 #endif // PLATFORM(IOS)

Modified: trunk/Source/WebKit2/UIProcess/ios/forms/WKFormInputControl.mm (199959 => 199960)


--- trunk/Source/WebKit2/UIProcess/ios/forms/WKFormInputControl.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/UIProcess/ios/forms/WKFormInputControl.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -225,7 +225,7 @@
     RetainPtr<id<WKFormControl>> _control;
 }
 
-- (id)initWithView:(WKContentView *)view
+- (instancetype)initWithView:(WKContentView *)view
 {
     if (!(self = [super init]))
         return nil;
@@ -263,11 +263,6 @@
 
 }
 
-+ (WKFormInputControl *)createPeripheralWithView:(WKContentView *)view
-{
-    return [[WKFormInputControl alloc] initWithView:view];
-}
-
 - (void)beginEditing
 {
     [_control controlBeginEditing];

Modified: trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.h (199959 => 199960)


--- trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.h	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.h	2016-04-24 02:49:49 UTC (rev 199960)
@@ -36,7 +36,7 @@
 @class WKContentView;
 
 @interface WKFormSelectControl : NSObject<WKFormPeripheral>
-+ (WKFormSelectControl *)createPeripheralWithView:(WKContentView *)view;
+- (instancetype)initWithView:(WKContentView *)view;
 @end
 
 @interface WKSelectPopover : WKFormRotatingAccessoryPopover<WKFormControl>

Modified: trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.mm (199959 => 199960)


--- trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -84,11 +84,6 @@
     return self;
 }
 
-+ (WKFormSelectControl *)createPeripheralWithView:(WKContentView *)view
-{
-    return [[WKFormSelectControl alloc] initWithView:view];
-}
-
 - (UIView *)assistantView
 {
     return [_control controlView];

Modified: trunk/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp (199959 => 199960)


--- trunk/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp	2016-04-24 02:49:49 UTC (rev 199960)
@@ -1122,22 +1122,23 @@
     if (versionNumber != sessionStateDataVersion)
         return false;
 
-    auto sessionStateDictionary = adoptCF(dynamic_cf_cast<CFDictionaryRef>(CFPropertyListCreateWithData(kCFAllocatorDefault, adoptCF(CFDataCreate(kCFAllocatorDefault, bytes + sizeof(uint32_t), size - sizeof(uint32_t))).get(), kCFPropertyListImmutable, nullptr, nullptr)));
+    auto cfPropertyList = adoptCF(CFPropertyListCreateWithData(kCFAllocatorDefault, adoptCF(CFDataCreate(kCFAllocatorDefault, bytes + sizeof(uint32_t), size - sizeof(uint32_t))).get(), kCFPropertyListImmutable, nullptr, nullptr));
+    auto sessionStateDictionary = dynamic_cf_cast<CFDictionaryRef>(cfPropertyList.get());
     if (!sessionStateDictionary)
         return false;
 
-    if (auto backForwardListDictionary = dynamic_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(sessionStateDictionary.get(), sessionHistoryKey))) {
+    if (auto backForwardListDictionary = dynamic_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(sessionStateDictionary, sessionHistoryKey))) {
         if (!decodeSessionHistory(backForwardListDictionary, sessionState.backForwardListState))
             return false;
     }
 
-    if (auto provisionalURLString = dynamic_cf_cast<CFStringRef>(CFDictionaryGetValue(sessionStateDictionary.get(), provisionalURLKey))) {
+    if (auto provisionalURLString = dynamic_cf_cast<CFStringRef>(CFDictionaryGetValue(sessionStateDictionary, provisionalURLKey))) {
         sessionState.provisionalURL = WebCore::URL(WebCore::URL(), provisionalURLString);
         if (!sessionState.provisionalURL.isValid())
             return false;
     }
 
-    if (auto renderTreeSize = dynamic_cf_cast<CFNumberRef>(CFDictionaryGetValue(sessionStateDictionary.get(), renderTreeSizeKey)))
+    if (auto renderTreeSize = dynamic_cf_cast<CFNumberRef>(CFDictionaryGetValue(sessionStateDictionary, renderTreeSizeKey)))
         CFNumberGetValue(renderTreeSize, kCFNumberSInt64Type, &sessionState.renderTreeSize);
     else
         sessionState.renderTreeSize = 0;

Modified: trunk/Source/WebKit2/UIProcess/mac/ServicesController.mm (199959 => 199960)


--- trunk/Source/WebKit2/UIProcess/mac/ServicesController.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/UIProcess/mac/ServicesController.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -87,10 +87,10 @@
 
         static NSAttributedString *attributedStringWithRichContent;
         if (!attributedStringWithRichContent) {
-            NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
-            NSTextAttachmentCell *cell = [[NSTextAttachmentCell alloc] initImageCell:image.get()];
-            [attachment setAttachmentCell:cell];
-            NSMutableAttributedString *richString = (NSMutableAttributedString *)[NSMutableAttributedString attributedStringWithAttachment:attachment];
+            auto attachment = adoptNS([[NSTextAttachment alloc] init]);
+            auto cell = adoptNS([[NSTextAttachmentCell alloc] initImageCell:image.get()]);
+            [attachment setAttachmentCell:cell.get()];
+            NSMutableAttributedString *richString = (NSMutableAttributedString *)[NSMutableAttributedString attributedStringWithAttachment:attachment.get()];
             [richString appendAttributedString: attributedString];
             attributedStringWithRichContent = [richString retain];
         }

Modified: trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm (199959 => 199960)


--- trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm	2016-04-24 02:27:34 UTC (rev 199959)
+++ trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm	2016-04-24 02:49:49 UTC (rev 199960)
@@ -231,9 +231,9 @@
         else
             m_menu = adoptNS([[NSMenu alloc] init]);
         int itemPosition = 0;
-        NSMenuItem *groupEntry = [[NSMenuItem alloc] initWithTitle:menuItemTitleForTelephoneNumberGroup() action:nil keyEquivalent:@""];
+        auto groupEntry = adoptNS([[NSMenuItem alloc] initWithTitle:menuItemTitleForTelephoneNumberGroup() action:nil keyEquivalent:@""]);
         [groupEntry setEnabled:NO];
-        [m_menu insertItem:groupEntry atIndex:itemPosition++];
+        [m_menu insertItem:groupEntry.get() atIndex:itemPosition++];
         for (auto& menuItem : telephoneNumberMenuItems)
             [m_menu insertItem:menuItem.get() atIndex:itemPosition++];
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to