Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/mozilla/NSURL+Utils.m

Issue 2391653003: [Mac Fix-It] Removed usage of deprecated resource fork API. (Closed)
Patch Set: Addressed review comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/mozilla/NSURL+Utils.m
diff --git a/third_party/mozilla/NSURL+Utils.m b/third_party/mozilla/NSURL+Utils.m
index 300facdd9b767ead6f8ed98b62e323a84b478629..0ea5559a5013db9b6cf65db7ca48a414677b6cf7 100644
--- a/third_party/mozilla/NSURL+Utils.m
+++ b/third_party/mozilla/NSURL+Utils.m
@@ -64,44 +64,10 @@
//
+(NSURL*)URLFromInetloc:(NSString*)inFile
{
- FSRef ref;
- NSURL *ret = nil;
-
- if (inFile && FSPathMakeRef((UInt8 *)[inFile fileSystemRepresentation], &ref, NULL) == noErr) {
- short resRef;
-
- resRef = FSOpenResFile(&ref, fsRdPerm);
-
- if (resRef != -1) { // Has resouce fork.
- Handle urlResHandle;
-
- if ((urlResHandle = Get1Resource('url ', 256))) { // Has 'url ' resource with ID 256.
- long size;
-
- size = GetMaxResourceSize(urlResHandle);
-// Begin Google Modified
-// ret = [NSURL URLWithString:[NSString stringWithCString:(char *)*urlResHandle length:size]];
- NSString *urlString = [[[NSString alloc] initWithBytes:(void *)*urlResHandle
- length:size
- encoding:NSMacOSRomanStringEncoding] // best guess here
- autorelease];
- ret = [NSURL URLWithString:urlString];
-// End Google Modified
- }
-
- CloseResFile(resRef);
- }
-
- if (!ret) { // Look for valid plist data.
- NSDictionary *plist;
- if ((plist = [[NSDictionary alloc] initWithContentsOfFile:inFile])) {
- ret = [NSURL URLWithString:[plist objectForKey:@"URL"]];
- [plist release];
- }
- }
- }
-
- return ret;
+ //// Begin Google Modified
+ NSDictionary *plist = [NSDictionary dictionaryWithContentsOfFile:inFile];
+ return [NSURL URLWithString:[plist objectForKey:@"URL"]];
+ //// End Google Modified
}
//
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698