Title: [159663] trunk/Source
Revision
159663
Author
[email protected]
Date
2013-11-21 18:55:19 -0800 (Thu, 21 Nov 2013)

Log Message

<https://webkit.org/b/124700> Fix some deprecation warnings.

Reviewed by Anders Carlsson.

Source/WebCore:

* platform/mac/HTMLConverter.mm:
(fileWrapperForURL): Move off a deprecated NSFileWrapper method.

Source/WebKit/mac:

* Plugins/WebNetscapePluginStream.mm:
(WebNetscapePluginStream::startStream): Move off a deprecated NSData method.
* WebView/WebDataSource.mm:
(-[WebDataSource _fileWrapperForURL:]): Move off a deprecated NSFileWrapper method.
* WebView/WebHTMLView.mm:
(-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto.

Source/WebKit2:

* UIProcess/API/mac/WKView.mm:
(-[WKView namesOfPromisedFilesDroppedAtDestination:]): Move off a deprecated NSFileWrapper method.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (159662 => 159663)


--- trunk/Source/WebCore/ChangeLog	2013-11-22 02:53:04 UTC (rev 159662)
+++ trunk/Source/WebCore/ChangeLog	2013-11-22 02:55:19 UTC (rev 159663)
@@ -1,3 +1,12 @@
+2013-11-21  Mark Rowe  <[email protected]>
+
+        <https://webkit.org/b/124700> Fix some deprecation warnings.
+
+        Reviewed by Anders Carlsson.
+
+        * platform/mac/HTMLConverter.mm:
+        (fileWrapperForURL): Move off a deprecated NSFileWrapper method.
+
 2013-11-21  Daniel Bates  <[email protected]>
 
         [iOS] Build fix; export symbol for WebCore::provideDeviceOrientationTo()

Modified: trunk/Source/WebCore/platform/mac/HTMLConverter.mm (159662 => 159663)


--- trunk/Source/WebCore/platform/mac/HTMLConverter.mm	2013-11-22 02:53:04 UTC (rev 159662)
+++ trunk/Source/WebCore/platform/mac/HTMLConverter.mm	2013-11-22 02:55:19 UTC (rev 159663)
@@ -2537,11 +2537,9 @@
 #if !PLATFORM(IOS)
 static NSFileWrapper *fileWrapperForURL(DocumentLoader *dataSource, NSURL *URL)
 {
-    if ([URL isFileURL]) {
-        NSString *path = [[URL path] stringByResolvingSymlinksInPath];
-        return [[[NSFileWrapper alloc] initWithPath:path] autorelease];
-    }
-    
+    if ([URL isFileURL])
+        return [[[NSFileWrapper alloc] initWithURL:[URL URLByResolvingSymlinksInPath] options:0 error:nullptr] autorelease];
+
     RefPtr<ArchiveResource> resource = dataSource->subresource(URL);
     if (resource) {
         NSFileWrapper *wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:resource->data()->createNSData().get()] autorelease];

Modified: trunk/Source/WebKit/mac/ChangeLog (159662 => 159663)


--- trunk/Source/WebKit/mac/ChangeLog	2013-11-22 02:53:04 UTC (rev 159662)
+++ trunk/Source/WebKit/mac/ChangeLog	2013-11-22 02:55:19 UTC (rev 159663)
@@ -1,3 +1,16 @@
+2013-11-21  Mark Rowe  <[email protected]>
+
+        <https://webkit.org/b/124700> Fix some deprecation warnings.
+
+        Reviewed by Anders Carlsson.
+
+        * Plugins/WebNetscapePluginStream.mm:
+        (WebNetscapePluginStream::startStream): Move off a deprecated NSData method.
+        * WebView/WebDataSource.mm:
+        (-[WebDataSource _fileWrapperForURL:]): Move off a deprecated NSFileWrapper method.
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto.
+
 2013-11-20  Mark Lam  <[email protected]>
 
         Introducing VMEntryScope to update the VM stack limit.

Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginStream.mm (159662 => 159663)


--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginStream.mm	2013-11-22 02:53:04 UTC (rev 159662)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginStream.mm	2013-11-22 02:55:19 UTC (rev 159663)
@@ -231,7 +231,7 @@
     if (headers) {
         unsigned len = [headers length];
         m_headers = (char*) malloc(len + 1);
-        [headers getBytes:m_headers];
+        [headers getBytes:m_headers length:len];
         m_headers[len] = 0;
         m_stream.headers = m_headers;
     }

Modified: trunk/Source/WebKit/mac/WebView/WebDataSource.mm (159662 => 159663)


--- trunk/Source/WebKit/mac/WebView/WebDataSource.mm	2013-11-22 02:53:04 UTC (rev 159662)
+++ trunk/Source/WebKit/mac/WebView/WebDataSource.mm	2013-11-22 02:55:19 UTC (rev 159663)
@@ -166,11 +166,9 @@
 
 - (NSFileWrapper *)_fileWrapperForURL:(NSURL *)URL
 {
-    if ([URL isFileURL]) {
-        NSString *path = [[URL path] stringByResolvingSymlinksInPath];
-        return [[[NSFileWrapper alloc] initWithPath:path] autorelease];
-    }
-    
+    if ([URL isFileURL])
+        return [[[NSFileWrapper alloc] initWithURL:[URL URLByResolvingSymlinksInPath] options:0 error:nullptr] autorelease];
+
     WebResource *resource = [self subresourceForURL:URL];
     if (resource)
         return [resource _fileWrapperRepresentation];

Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (159662 => 159663)


--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm	2013-11-22 02:53:04 UTC (rev 159662)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm	2013-11-22 02:55:19 UTC (rev 159663)
@@ -3707,8 +3707,8 @@
     // FIXME: Report an error if we fail to create a file.
     NSString *path = [[dropDestination path] stringByAppendingPathComponent:[wrapper preferredFilename]];
     path = [[NSFileManager defaultManager] _webkit_pathWithUniqueFilenameForPath:path];
-    if (![wrapper writeToFile:path atomically:NO updateFilenames:YES])
-        LOG_ERROR("Failed to create image file via -[NSFileWrapper writeToFile:atomically:updateFilenames:]");
+    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:]");
     
     if (draggingImageURL)
         [[NSFileManager defaultManager] _webkit_setMetadataURL:[draggingImageURL absoluteString] referrer:nil atPath:path];

Modified: trunk/Source/WebKit2/ChangeLog (159662 => 159663)


--- trunk/Source/WebKit2/ChangeLog	2013-11-22 02:53:04 UTC (rev 159662)
+++ trunk/Source/WebKit2/ChangeLog	2013-11-22 02:55:19 UTC (rev 159663)
@@ -1,3 +1,12 @@
+2013-11-21  Mark Rowe  <[email protected]>
+
+        <https://webkit.org/b/124700> Fix some deprecation warnings.
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView namesOfPromisedFilesDroppedAtDestination:]): Move off a deprecated NSFileWrapper method.
+
 2013-11-21  Anders Carlsson  <[email protected]>
 
         Didn't mean to commit this.

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (159662 => 159663)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-11-22 02:53:04 UTC (rev 159662)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-11-22 02:55:19 UTC (rev 159663)
@@ -2721,9 +2721,9 @@
     // FIXME: Report an error if we fail to create a file.
     NSString *path = [[dropDestination path] stringByAppendingPathComponent:[wrapper.get() preferredFilename]];
     path = pathWithUniqueFilenameForPath(path);
-    if (![wrapper.get() writeToFile:path atomically:NO updateFilenames:YES])
-        LOG_ERROR("Failed to create image file via -[NSFileWrapper writeToFile:atomically:updateFilenames:]");
-    
+    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:]");
+
     if (!_data->_promisedURL.isEmpty())
         WebCore::setMetadataURL(_data->_promisedURL, "", String(path));
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to