Reviewed by Beth.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Aug 2006 06:45:34 +0000 (06:45 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Aug 2006 06:45:34 +0000 (06:45 +0000)
        - removed non-Loader WebKit dependencies from WebDataProtocol for
        real (whoops) and fix some typos.

        * Loader/WebDataProtocol.m:
        (isCaseInsensitiveEqual): Added.
        (+[WebDataProtocol _webIsDataProtocolURL:]): Avoid WebKit calls.
        (-[WebDataProtocol startLoading]): ditto
        * Loader/WebFrameLoader.m:
        (isCaseInsensitiveEqual): Fixed spelling from isCaseSensitiveEqual.
        (-[WebFrameLoader _canUseResourceForRequest:]): Use proper call.

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

WebKit/ChangeLog
WebKit/Loader/WebDataProtocol.m
WebKit/Loader/WebFrameLoader.m

index 49fe32d4459743e02e53ad63540362e8c0a808ff..3ab04bbdb7bbd2b7d847255115e231e30b9a4121 100644 (file)
@@ -1,3 +1,18 @@
+2006-08-13  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Beth.
+        
+        - removed non-Loader WebKit dependencies from WebDataProtocol for
+        real (whoops) and fix some typos.
+
+        * Loader/WebDataProtocol.m:
+        (isCaseInsensitiveEqual): Added.
+        (+[WebDataProtocol _webIsDataProtocolURL:]): Avoid WebKit calls.
+        (-[WebDataProtocol startLoading]): ditto
+        * Loader/WebFrameLoader.m:
+        (isCaseInsensitiveEqual): Fixed spelling from isCaseSensitiveEqual.
+        (-[WebFrameLoader _canUseResourceForRequest:]): Use proper call.
+
 2006-08-13  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Maciej
index 9ced8579d1b667e79373a43453535db862712355..6ec202f14cb3e1ca68ce54cf1bd49939a6563895 100644 (file)
@@ -30,8 +30,6 @@
 
 #import <Foundation/NSURLResponse.h>
 #import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebKitErrorsPrivate.h>
-#import <WebKit/WebKitNSStringExtras.h>
 
 NSString *WebDataProtocolScheme = @"applewebdata";
 static NSString *WebDataRequestPropertyKey = @"WebDataRequest";
@@ -225,11 +223,16 @@ static NSString *WebDataRequestPropertyKey = @"WebDataRequest";
 // that will handle our custom protocol.
 @implementation WebDataProtocol
 
+static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
+{
+    return [a caseInsensitiveCompare:b] == NSOrderedSame;
+}
+
 +(BOOL)_webIsDataProtocolURL:(NSURL *)URL
 {
     ASSERT(URL);
     NSString *scheme = [URL scheme];
-    return scheme && [scheme _webkit_isCaseInsensitiveEqualToString:WebDataProtocolScheme];
+    return scheme && isCaseInsensitiveEqual(scheme, WebDataProtocolScheme);
 }
 
 +(BOOL)canInitWithRequest:(NSURLRequest *)request
@@ -258,11 +261,13 @@ static NSString *WebDataRequestPropertyKey = @"WebDataRequest";
         [client URLProtocolDidFinishLoading:self];
         [response release];
     } else {
-        int resultCode;
-
-        resultCode = NSURLErrorResourceUnavailable;
-
-        [client URLProtocol:self didFailWithError:[NSError _webKitErrorWithDomain:NSURLErrorDomain code:resultCode URL:[request URL]]];
+        NSError *error = [[[NSError alloc] initWithDomain:NSURLErrorDomain code:NSURLErrorResourceUnavailable userInfo:[NSDictionary dictionaryWithObjectsAndKeys:
+            [request URL], @"NSErrorFailingURLKey",
+            [[request URL] absoluteString], @"NSErrorFailingURLStringKey",
+            nil, NSLocalizedDescriptionKey,
+            nil]] autorelease];
+        
+        [client URLProtocol:self didFailWithError:error];
     }
 }
 
index 22918abd21e7b965e35ee72168c7639d585aefa6..8a240a54445998f94ca3f47142322bde77b9cc01 100644 (file)
@@ -566,7 +566,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [self performSelector:@selector(deliverArchivedResources) withObject:nil afterDelay:0];
 }
 
-static BOOL isCaseSensitiveEqual(NSString *a, NSString *b)
+static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
 {
     return [a caseInsensitiveCompare:b] == NSOrderedSame;
 }
@@ -591,7 +591,7 @@ static BOOL isCaseSensitiveEqual(NSString *a, NSString *b)
         return NO;
     } else if ([theRequest valueForHTTPHeaderField:@"Cache-Control"] != nil) {
         return NO;
-    } else if (isCaseSensitiveEqual(@"POST", [theRequest HTTPMethod])) {
+    } else if (isCaseInsensitiveEqual(@"POST", [theRequest HTTPMethod])) {
         return NO;
     } else {
         return YES;