Reviewed by Timothy Hatcher.
authorcwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2011 22:20:03 +0000 (22:20 +0000)
committercwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2011 22:20:03 +0000 (22:20 +0000)
Stop using -[NSString initWithContentsOfFile:]
https://bugs.webkit.org/show_bug.cgi?id=58763

-[NSString initWithContentsOfFile:] was deprecated in 10.4, so we should stop using it.

* WebView/WebView.mm:
(leakMailQuirksUserScriptContents):
(leakOutlookQuirksUserScriptContents):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84191 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm

index 1bea093f519537cf4e804c7450c771d02d3b4a81..6699a0e3e5e92942e5a4deced080883294fb8558 100644 (file)
@@ -1,3 +1,16 @@
+2011-04-17  Cameron Zwarich  <zwarich@apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Stop using -[NSString initWithContentsOfFile:]
+        https://bugs.webkit.org/show_bug.cgi?id=58763
+
+        -[NSString initWithContentsOfFile:] was deprecated in 10.4, so we should stop using it.
+
+        * WebView/WebView.mm:
+        (leakMailQuirksUserScriptContents):
+        (leakOutlookQuirksUserScriptContents):
+
 2011-04-17  David Kilzer  <ddkilzer@apple.com>
 
         <http://webkit.org/b/58463> Switch HTTP pipelining from user default to private setting
index ca1911c1d85c3b35621a971ca6a8b9a6a9224ede..8ee0c22d0f6fdc3264594358b943b11b30cb6f34 100644 (file)
@@ -643,7 +643,8 @@ static bool shouldEnableLoadDeferring()
 static NSString *leakMailQuirksUserScriptContents()
 {
     NSString *scriptPath = [[NSBundle bundleForClass:[WebView class]] pathForResource:@"MailQuirksUserScript" ofType:@"js"];
-    return [[NSString alloc] initWithContentsOfFile:scriptPath];
+    NSStringEncoding encoding;
+    return [[NSString alloc] initWithContentsOfFile:scriptPath usedEncoding:&encoding error:0];
 }
 
 - (void)_injectMailQuirksScript
@@ -663,7 +664,8 @@ static bool needsOutlookQuirksScript()
 static NSString *leakOutlookQuirksUserScriptContents()
 {
     NSString *scriptPath = [[NSBundle bundleForClass:[WebView class]] pathForResource:@"OutlookQuirksUserScript" ofType:@"js"];
-    return [[NSString alloc] initWithContentsOfFile:scriptPath];
+    NSStringEncoding encoding;
+    return [[NSString alloc] initWithContentsOfFile:scriptPath usedEncoding:&encoding error:0];
 }
 
 -(void)_injectOutlookQuirksScript