WebCore:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 Apr 2006 23:11:40 +0000 (23:11 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 Apr 2006 23:11:40 +0000 (23:11 +0000)
        Reviewed by Eric.

        - remove WebCoreCookieAdapter, instead make mac implementation of
        CookieJar use Foundation directly.

        * WebCore.exp:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mac/CookieJar.mm:
        (WebCore::cookies):
        (WebCore::setCookies):
        (WebCore::cookiesEnabled):
        * platform/mac/WebCoreCookieAdapter.h: Removed.
        * platform/mac/WebCoreCookieAdapter.m: Removed.

WebKit:

        Reviewed by Eric.

        - remove WebCookieAdapter, WebCore can just use Foundation directly.

        * WebCoreSupport/WebCookieAdapter.h: Removed.
        * WebCoreSupport/WebCookieAdapter.m: Removed.
        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebFrameView.m:
        (-[WebFrameView initWithFrame:]):

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

WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/platform/mac/CookieJar.mm
WebCore/platform/mac/WebCoreCookieAdapter.h [deleted file]
WebCore/platform/mac/WebCoreCookieAdapter.m [deleted file]
WebKit/ChangeLog
WebKit/WebCoreSupport/WebCookieAdapter.h [deleted file]
WebKit/WebCoreSupport/WebCookieAdapter.m [deleted file]
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrameView.m

index a5cb855b2d4dbb60b24ee3e1ebf82e6951caeddf..d517c7d836f380b6f7e43bbc7838136564009914 100644 (file)
@@ -1,3 +1,19 @@
+2006-04-23  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Eric.
+
+        - remove WebCoreCookieAdapter, instead make mac implementation of
+        CookieJar use Foundation directly.
+
+        * WebCore.exp:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/mac/CookieJar.mm:
+        (WebCore::cookies):
+        (WebCore::setCookies):
+        (WebCore::cookiesEnabled):
+        * platform/mac/WebCoreCookieAdapter.h: Removed.
+        * platform/mac/WebCoreCookieAdapter.m: Removed.
+
 2006-04-21  Rob Buis  <buis@kde.org>
 
         Reviewed by hyatt.  Landed by eseidel.
index 8de91cc551db3e52f5a0d499d61d8313ba83cf0e..2b165c0dfec2214025b71b2c84c923a5fe706330 100644 (file)
 .objc_class_name_DOMTreeWalker
 .objc_class_name_DOMUIEvent
 .objc_class_name_WebCoreCache
-.objc_class_name_WebCoreCookieAdapter
 .objc_class_name_WebCoreEncodings
 .objc_class_name_WebCoreFrameBridge
 .objc_class_name_WebCoreFrameNamespaces
index 7871d85314f18f4cc2d3f016fdefc209fe7082db..041030657e9e3b2ea6c5c680c5ff80e25ad04195 100644 (file)
                93F1999D08245E59001E9ABC /* DeprecatedValueList.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786C202DE3B8601EA4122 /* DeprecatedValueList.h */; };
                93F1999E08245E59001E9ABC /* DeprecatedValueListImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F587853B02DE375901EA4122 /* DeprecatedValueListImpl.h */; };
                93F199A508245E59001E9ABC /* WebCoreCache.h in Headers */ = {isa = PBXBuildFile; fileRef = F5B2A4FC02E2220F018635CB /* WebCoreCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               93F199A608245E59001E9ABC /* WebCoreCookieAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = F587854902DE375901EA4122 /* WebCoreCookieAdapter.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93F199A708245E59001E9ABC /* WebCoreEncodings.h in Headers */ = {isa = PBXBuildFile; fileRef = F56234DF03026D7301629B47 /* WebCoreEncodings.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93F199A808245E59001E9ABC /* WebCoreFrameView.h in Headers */ = {isa = PBXBuildFile; fileRef = F587854C02DE375901EA4122 /* WebCoreFrameView.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93F199A908245E59001E9ABC /* WebCoreHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = F5517DC2031AB56301A80180 /* WebCoreHistory.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93F19A5308245E59001E9ABC /* KWQTextEdit.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587853802DE375901EA4122 /* KWQTextEdit.mm */; };
                93F19A5408245E59001E9ABC /* KWQTextStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587853902DE375901EA4122 /* KWQTextStream.cpp */; };
                93F19A5608245E59001E9ABC /* DeprecatedValueListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587853C02DE375901EA4122 /* DeprecatedValueListImpl.cpp */; };
-               93F19A5C08245E59001E9ABC /* WebCoreCookieAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = F587854A02DE375901EA4122 /* WebCoreCookieAdapter.m */; };
                93F19A5D08245E59001E9ABC /* WebCoreImageRendererFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = F587854F02DE375901EA4122 /* WebCoreImageRendererFactory.m */; };
                93F19A5E08245E59001E9ABC /* WebCoreTextRendererFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587855302DE375901EA4122 /* WebCoreTextRendererFactory.mm */; };
                93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = F587855502DE375901EA4122 /* WebCoreViewFactory.m */; };
                F587853902DE375901EA4122 /* KWQTextStream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQTextStream.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587853B02DE375901EA4122 /* DeprecatedValueListImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedValueListImpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587853C02DE375901EA4122 /* DeprecatedValueListImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedValueListImpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F587854902DE375901EA4122 /* WebCoreCookieAdapter.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreCookieAdapter.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F587854A02DE375901EA4122 /* WebCoreCookieAdapter.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebCoreCookieAdapter.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587854C02DE375901EA4122 /* WebCoreFrameView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFrameView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587854D02DE375901EA4122 /* WebCoreImageRenderer.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreImageRenderer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587854E02DE375901EA4122 /* WebCoreImageRendererFactory.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreImageRendererFactory.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                9352071B09BD3BBB00F2038D /* TextBoundaries.mm */,
                                6576F9D509B2484A000041F7 /* TextEncodingMac.cpp */,
                                6545F67509B830180013006F /* TransferJobMac.mm */,
-                               F587854902DE375901EA4122 /* WebCoreCookieAdapter.h */,
-                               F587854A02DE375901EA4122 /* WebCoreCookieAdapter.m */,
                                F5517DC2031AB56301A80180 /* WebCoreHistory.h */,
                                F5517DC3031AB56301A80180 /* WebCoreHistory.m */,
                                F587854D02DE375901EA4122 /* WebCoreImageRenderer.h */,
                                93F1999D08245E59001E9ABC /* DeprecatedValueList.h in Headers */,
                                93F1999E08245E59001E9ABC /* DeprecatedValueListImpl.h in Headers */,
                                93F199A508245E59001E9ABC /* WebCoreCache.h in Headers */,
-                               93F199A608245E59001E9ABC /* WebCoreCookieAdapter.h in Headers */,
                                93F199A708245E59001E9ABC /* WebCoreEncodings.h in Headers */,
                                93F199A808245E59001E9ABC /* WebCoreFrameView.h in Headers */,
                                93F199A908245E59001E9ABC /* WebCoreHistory.h in Headers */,
                                93F19A5308245E59001E9ABC /* KWQTextEdit.mm in Sources */,
                                93F19A5408245E59001E9ABC /* KWQTextStream.cpp in Sources */,
                                93F19A5608245E59001E9ABC /* DeprecatedValueListImpl.cpp in Sources */,
-                               93F19A5C08245E59001E9ABC /* WebCoreCookieAdapter.m in Sources */,
                                93F19A5D08245E59001E9ABC /* WebCoreImageRendererFactory.m in Sources */,
                                93F19A5E08245E59001E9ABC /* WebCoreTextRendererFactory.mm in Sources */,
                                93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */,
index 13e07d850ef1ab785b4230a33f68b884f6f0854d..4ea7275a91c70fe8cb1eb6c7b8800cf260350e41 100644 (file)
 #import "KURL.h"
 #import "BlockExceptions.h"
 #import "PlatformString.h"
-#import "WebCoreCookieAdapter.h"
+#include <Foundation/Foundation.h>
 
 namespace WebCore {
 
 String cookies(const KURL& url)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    return [[WebCoreCookieAdapter sharedAdapter] cookiesForURL:url.url().getNSString()];
+
+    NSURL *URL = url.getNSURL();
+    NSArray *cookiesForURL = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:URL];
+    NSDictionary *header = [NSHTTPCookie requestHeaderFieldsWithCookies:cookiesForURL];
+    return [header objectForKey:@"Cookie"];
+
     END_BLOCK_OBJC_EXCEPTIONS;
     return String();
 }
 
-void setCookies(const KURL& url, const KURL& policyBaseURL, const String& cookies)
+void setCookies(const KURL& url, const KURL& policyBaseURL, const String& cookieStr)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [[WebCoreCookieAdapter sharedAdapter] setCookies:cookies
-        forURL:url.url().getNSString() policyBaseURL:policyBaseURL.url().getNSString()];
+
+    NSURL *URL = url.getNSURL();
+    
+    // <http://bugzilla.opendarwin.org/show_bug.cgi?id=6531>, <rdar://4409034>
+    // cookiesWithResponseHeaderFields doesn't parse cookies without a value
+    String cookieString = cookieStr.contains('=') ? cookieStr : cookieStr + "=";
+    
+    NSArray *cookies = [NSHTTPCookie cookiesWithResponseHeaderFields:[NSDictionary dictionaryWithObject:cookieString forKey:@"Set-Cookie"] forURL:URL];
+    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:cookies forURL:URL mainDocumentURL:policyBaseURL.getNSURL()];    
+
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
 bool cookiesEnabled()
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    return [[WebCoreCookieAdapter sharedAdapter] cookiesEnabled];
+
+    NSHTTPCookieAcceptPolicy cookieAcceptPolicy = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookieAcceptPolicy];
+    return cookieAcceptPolicy == NSHTTPCookieAcceptPolicyAlways || cookieAcceptPolicy == NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain;
+
     END_BLOCK_OBJC_EXCEPTIONS;
     return false;
 }
diff --git a/WebCore/platform/mac/WebCoreCookieAdapter.h b/WebCore/platform/mac/WebCoreCookieAdapter.h
deleted file mode 100644 (file)
index 051dae9..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Foundation/Foundation.h>
-
-@interface WebCoreCookieAdapter : NSObject
-{
-}
-
-+ (WebCoreCookieAdapter *)sharedAdapter;
-
-- (BOOL)cookiesEnabled;
-- (NSString *)cookiesForURL:(NSString *)URL;
-- (void)setCookies:(NSString *)cookies forURL:(NSString *)URL policyBaseURL:(NSString *)URL;
-
-@end
diff --git a/WebCore/platform/mac/WebCoreCookieAdapter.m b/WebCore/platform/mac/WebCoreCookieAdapter.m
deleted file mode 100644 (file)
index d6864d5..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "WebCoreCookieAdapter.h"
-#import <kxmlcore/Assertions.h>
-
-@implementation WebCoreCookieAdapter
-
-static WebCoreCookieAdapter *sharedAdapter;
-
-+ (WebCoreCookieAdapter *)sharedAdapter
-{
-    return sharedAdapter;
-}
-
-- init
-{
-    [super init];
-
-    ASSERT(!sharedAdapter);
-    sharedAdapter = [self retain];
-
-    return self;
-}
-
-- (BOOL)cookiesEnabled
-{
-    return FALSE;
-}
-
-- (NSString *)cookiesForURL:(NSString *)URL
-{
-    return nil;
-}
-
-- (void)setCookies:(NSString *)cookies forURL:(NSString *)URL policyBaseURL:(NSString *)policyBaseURL
-{
-}
-
-@end
index 5e1bc2bfc78d21a5be6be86ac4df724b120c97d7..bea02ae3b823b5266902381f8233901fe8d2af44 100644 (file)
@@ -1,3 +1,15 @@
+2006-04-23  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Eric.
+        
+        - remove WebCookieAdapter, WebCore can just use Foundation directly.
+
+        * WebCoreSupport/WebCookieAdapter.h: Removed.
+        * WebCoreSupport/WebCookieAdapter.m: Removed.
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebView/WebFrameView.m:
+        (-[WebFrameView initWithFrame:]):
+
 2006-04-23  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Adele.
diff --git a/WebKit/WebCoreSupport/WebCookieAdapter.h b/WebKit/WebCoreSupport/WebCookieAdapter.h
deleted file mode 100644 (file)
index a2fb1da..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Foundation/Foundation.h>
-#import <WebCore/WebCoreCookieAdapter.h>
-
-@interface WebCookieAdapter : WebCoreCookieAdapter
-{
-}
-
-+ (void)createSharedAdapter;
-
-@end
diff --git a/WebKit/WebCoreSupport/WebCookieAdapter.m b/WebKit/WebCoreSupport/WebCookieAdapter.m
deleted file mode 100644 (file)
index a5b5adf..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "WebCookieAdapter.h"
-
-#import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebNSURLExtras.h>
-#import <Foundation/NSHTTPCookie.h>
-#import <Foundation/NSHTTPCookieStorage.h>
-
-@implementation WebCookieAdapter
-
-+ (void)createSharedAdapter
-{
-    if (![self sharedAdapter]) {
-        [[[self alloc] init] release];
-    }
-    ASSERT([[self sharedAdapter] isKindOfClass:self]);
-}
-
-- (BOOL)cookiesEnabled
-{
-    BOOL result;
-
-    NSHTTPCookieAcceptPolicy cookieAcceptPolicy = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookieAcceptPolicy];
-    result = (cookieAcceptPolicy == NSHTTPCookieAcceptPolicyAlways || cookieAcceptPolicy == NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain);
-    
-    return result;
-}
-
-- (NSString *)cookiesForURL:(NSString *)URLString
-{
-    NSURL *URL = [NSURL _web_URLWithDataAsString:URLString];
-    NSArray *cookiesForURL = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:URL];
-    NSDictionary *header = [NSHTTPCookie requestHeaderFieldsWithCookies:cookiesForURL];
-    return [header objectForKey:@"Cookie"];
-}
-
-- (void)setCookies:(NSString *)cookieString forURL:(NSString *)URLString policyBaseURL:(NSString *)policyBaseURL
-{
-    NSURL *URL = [NSURL _web_URLWithDataAsString:URLString];
-    
-    // <http://bugzilla.opendarwin.org/show_bug.cgi?id=6531>, <rdar://4409034>
-    // cookiesWithResponseHeaderFields doesn't parse cookies without a value
-    if ([cookieString rangeOfString:@"="].location == NSNotFound)
-        cookieString = [cookieString stringByAppendingString:@"="];
-    
-    NSArray *cookies = [NSHTTPCookie cookiesWithResponseHeaderFields:[NSDictionary dictionaryWithObject:cookieString forKey:@"Set-Cookie"] forURL:URL];
-    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:cookies forURL:URL mainDocumentURL:[NSURL _web_URLWithDataAsString:policyBaseURL]];    
-}
-
-@end
index 0c2825d2b8ace192134ce6f43ec780273a331852..7cc4e5608b33463088bbe6c8757e0771ce50c7fc 100644 (file)
@@ -89,7 +89,6 @@
                939810390824BF01008DF038 /* WebPluginPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E4AF4B036659440000E506 /* WebPluginPackage.h */; };
                9398103A0824BF01008DF038 /* WebPluginViewFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 848DFF860365FE6A00CA2ACA /* WebPluginViewFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
                9398103C0824BF01008DF038 /* WebFrameBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = F5AFB45E02B94DC8018635CA /* WebFrameBridge.h */; };
-               9398103D0824BF01008DF038 /* WebCookieAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = F5488CF402CB04EE01FF6274 /* WebCookieAdapter.h */; };
                9398103E0824BF01008DF038 /* WebFileButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 9311022803667CF1008635CE /* WebFileButton.h */; };
                939810400824BF01008DF038 /* WebImageRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CE1F8A002A5C6F30ECA2ACD /* WebImageRenderer.h */; };
                939810410824BF01008DF038 /* WebImageRendererFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CE1F8A202A5C6F30ECA2ACD /* WebImageRendererFactory.h */; };
                939810DC0824BF01008DF038 /* WebPluginPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF4C036659440000E506 /* WebPluginPackage.m */; };
                939810DD0824BF01008DF038 /* npapi.m in Sources */ = {isa = PBXBuildFile; fileRef = F5F717230288493C018635CA /* npapi.m */; };
                939810DE0824BF01008DF038 /* WebFrameBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = F5AFB45F02B94DC8018635CA /* WebFrameBridge.m */; };
-               939810DF0824BF01008DF038 /* WebCookieAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = F5488CF502CB04EE01FF6274 /* WebCookieAdapter.m */; };
                939810E00824BF01008DF038 /* WebFileButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9311022903667CF1008635CE /* WebFileButton.m */; };
                939810E20824BF01008DF038 /* WebImageRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CE1F8A102A5C6F30ECA2ACD /* WebImageRenderer.m */; };
                939810E30824BF01008DF038 /* WebImageRendererFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */; };
                F53444CE02E87CBA018635CA /* WebKitStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitStatistics.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F53444CF02E87CBA018635CA /* WebKitStatistics.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitStatistics.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F53444D202E87D4B018635CA /* WebKitStatisticsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitStatisticsPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F5488CF402CB04EE01FF6274 /* WebCookieAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCookieAdapter.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F5488CF502CB04EE01FF6274 /* WebCookieAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebCookieAdapter.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F560BEBC030DAF4401C1A526 /* WebSearchableTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebSearchableTextView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F560BEBD030DAF4401C1A526 /* WebSearchableTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebSearchableTextView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F5883BDE025E5C6A01000102 /* nullplugin.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = nullplugin.tiff; path = Resources/nullplugin.tiff; sourceTree = "<group>"; };
                                65C7F42B0979DE640022E453 /* WebPageBridge.m */,
                                F5AFB45E02B94DC8018635CA /* WebFrameBridge.h */,
                                F5AFB45F02B94DC8018635CA /* WebFrameBridge.m */,
-                               F5488CF402CB04EE01FF6274 /* WebCookieAdapter.h */,
-                               F5488CF502CB04EE01FF6274 /* WebCookieAdapter.m */,
                                9305892A070868B300E79D96 /* WebDashboardRegion.h */,
                                9311022803667CF1008635CE /* WebFileButton.h */,
                                9311022903667CF1008635CE /* WebFileButton.m */,
                                939810390824BF01008DF038 /* WebPluginPackage.h in Headers */,
                                9398103A0824BF01008DF038 /* WebPluginViewFactory.h in Headers */,
                                9398103C0824BF01008DF038 /* WebFrameBridge.h in Headers */,
-                               9398103D0824BF01008DF038 /* WebCookieAdapter.h in Headers */,
                                9398103E0824BF01008DF038 /* WebFileButton.h in Headers */,
                                939810400824BF01008DF038 /* WebImageRenderer.h in Headers */,
                                939810410824BF01008DF038 /* WebImageRendererFactory.h in Headers */,
                                939810DC0824BF01008DF038 /* WebPluginPackage.m in Sources */,
                                939810DD0824BF01008DF038 /* npapi.m in Sources */,
                                939810DE0824BF01008DF038 /* WebFrameBridge.m in Sources */,
-                               939810DF0824BF01008DF038 /* WebCookieAdapter.m in Sources */,
                                939810E00824BF01008DF038 /* WebFileButton.m in Sources */,
                                939810E20824BF01008DF038 /* WebImageRenderer.m in Sources */,
                                939810E30824BF01008DF038 /* WebImageRendererFactory.m in Sources */,
index a7560ac38b659d8cd1f7c50f4c51812543558397..917e2be90e6220ddb61c69a6eeed17c2d12ae4a7 100644 (file)
@@ -30,7 +30,6 @@
 
 #import <JavaScriptCore/Assertions.h>
 #import "WebClipView.h"
-#import "WebCookieAdapter.h"
 #import "WebDataSource.h"
 #import "WebDocument.h"
 #import "WebDynamicScrollBarsView.h"
@@ -313,7 +312,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
         [WebViewFactory createSharedFactory];
         [WebTextRendererFactory createSharedFactory];
         [WebImageRendererFactory createSharedFactory];
-        [WebCookieAdapter createSharedAdapter];
         [WebKeyGenerator createSharedGenerator];
     }