Title: [217511] trunk/Source/WebKit2
Revision
217511
Author
[email protected]
Date
2017-05-26 16:00:22 -0700 (Fri, 26 May 2017)

Log Message

[Cocoa] Simplify some WebViewImpl pasteboard code
https://bugs.webkit.org/show_bug.cgi?id=172668

Patch by Joseph Pecoraro <[email protected]> on 2017-05-26
Reviewed by Tim Horton.

* Shared/mac/PasteboardTypes.mm:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::setFileAndURLTypes):
(WebKit::WebViewImpl::setPromisedDataForAttachment):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (217510 => 217511)


--- trunk/Source/WebKit2/ChangeLog	2017-05-26 22:57:30 UTC (rev 217510)
+++ trunk/Source/WebKit2/ChangeLog	2017-05-26 23:00:22 UTC (rev 217511)
@@ -1,5 +1,17 @@
 2017-05-26  Joseph Pecoraro  <[email protected]>
 
+        [Cocoa] Simplify some WebViewImpl pasteboard code
+        https://bugs.webkit.org/show_bug.cgi?id=172668
+
+        Reviewed by Tim Horton.
+
+        * Shared/mac/PasteboardTypes.mm:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::setFileAndURLTypes):
+        (WebKit::WebViewImpl::setPromisedDataForAttachment):
+
+2017-05-26  Joseph Pecoraro  <[email protected]>
+
         JSContext Inspector: Improve the reliability of automatically pausing in auto-attach
         https://bugs.webkit.org/show_bug.cgi?id=172664
         <rdar://problem/32362933>

Modified: trunk/Source/WebKit2/Shared/mac/PasteboardTypes.mm (217510 => 217511)


--- trunk/Source/WebKit2/Shared/mac/PasteboardTypes.mm	2017-05-26 22:57:30 UTC (rev 217510)
+++ trunk/Source/WebKit2/Shared/mac/PasteboardTypes.mm	2017-05-26 23:00:22 UTC (rev 217511)
@@ -28,8 +28,6 @@
 
 #if PLATFORM(MAC)
 
-#import <wtf/RetainPtr.h>
-
 namespace WebKit {
 
 NSString * const PasteboardTypes::WebArchivePboardType = @"Apple Web Archive pasteboard type";

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (217510 => 217511)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm	2017-05-26 22:57:30 UTC (rev 217510)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm	2017-05-26 23:00:22 UTC (rev 217511)
@@ -3804,8 +3804,8 @@
     [pasteboard setString:visibleURL forType:NSStringPboardType];
     [pasteboard setString:visibleURL forType:PasteboardTypes::WebURLPboardType];
     [pasteboard setString:title forType:PasteboardTypes::WebURLNamePboardType];
-    [pasteboard setPropertyList:[NSArray arrayWithObjects:[NSArray arrayWithObject:visibleURL], [NSArray arrayWithObject:title], nil] forType:PasteboardTypes::WebURLsWithTitlesPboardType];
-    [pasteboard setPropertyList:[NSArray arrayWithObject:extension] forType:NSFilesPromisePboardType];
+    [pasteboard setPropertyList:@[@[visibleURL], @[title]] forType:PasteboardTypes::WebURLsWithTitlesPboardType];
+    [pasteboard setPropertyList:@[extension] forType:NSFilesPromisePboardType];
     m_promisedFilename = filename;
     m_promisedURL = url;
 }
@@ -3833,11 +3833,8 @@
     [types addObjectsFromArray:PasteboardTypes::forURL()];
     [pasteboard declareTypes:types.get() owner:m_view];
     setFileAndURLTypes(filename, extension, title, url, visibleURL, pasteboard);
-    
-    RetainPtr<NSMutableArray> paths = adoptNS([[NSMutableArray alloc] init]);
-    [paths addObject:title];
-    [pasteboard setPropertyList:paths.get() forType:NSFilenamesPboardType];
-    
+    [pasteboard setPropertyList:@[title] forType:NSFilenamesPboardType];
+
     m_promisedImage = nullptr;
 }
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to