Commit 01352df3 authored by mrowe@apple.com's avatar mrowe@apple.com
Browse files

<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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9b6c3a6c
2013-11-21 Mark Rowe <mrowe@apple.com>
<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 <dabates@apple.com>
 
[iOS] Build fix; export symbol for WebCore::provideDeviceOrientationTo()
......@@ -2537,11 +2537,9 @@ static NSInteger _colCompare(id block1, id block2, void *)
#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];
......
2013-11-21 Mark Rowe <mrowe@apple.com>
<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 <mark.lam@apple.com>
Introducing VMEntryScope to update the VM stack limit.
......
......@@ -231,7 +231,7 @@ void WebNetscapePluginStream::startStream(NSURL *url, long long expectedContentL
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;
}
......
......@@ -166,11 +166,9 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (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];
......
......@@ -3707,8 +3707,8 @@ static bool matchesExtensionOrEquivalent(NSString *filename, NSString *extension
// 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];
......
2013-11-21 Mark Rowe <mrowe@apple.com>
<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 <andersca@apple.com>
Didn't mean to commit this.
......
......@@ -2721,9 +2721,9 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
// 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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment