+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48083
+ <rdar://problem/8489082> Need WebKit2 API for private browsing (48083)
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ Added CookieStorage.h to build files that contain headers.
+
+ * WebCore.xcodeproj/project.pbxproj: Added CookieStorage.h and CookieStorageMac.mm.
+
+ * WebCore.exp.in: Export _wkSetCookieStoragePrivateBrowsingEnabled (WebKit initializes WKSI
+ on WebCore's behalf).
+
+ * platform/mac/WebCoreSystemInterface.h:
+ * platform/mac/WebCoreSystemInterface.mm:
+ More work for passing the function pointer down to WebCore.
+
+ * page/Settings.cpp: (WebCore::Settings::setPrivateBrowsingEnabled): Tell cookie manager to
+ when to use private browsing mode. Note that although this is a per-page setting, it
+ actually has global effect.
+
+ * page/Settings.h: Extended a comment about what private browsing does.
+
+ * platform/android/TemporaryLinkStubs.cpp: (setCookieStoragePrivateBrowsingEnabled):
+ * platform/chromium/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/efl/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/gtk/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/haiku/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/qt/TemporaryLinkStubsQt.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ Added an empty implementation for ports that don't implement private browsing, or implement
+ it in ways I cannot discover.
+
+ * platform/network/CookieStorage.h: Added. I'm not entirely sure how this is different from
+ CookieJar.h, just following a precedent already set by Windows port with CookieStorageWin.h.
+
+ * platform/network/mac/CookieStorageMac.mm: Added.
+ (WebCore::setCookieStoragePrivateBrowsingEnabled): Call a WKSI function to enable private
+ browsing mode for cookies.
+
+ * platform/network/cf/CookieStorageCFNet.cpp:
+ (WebCore::currentCookieStorage): Added ASSERT(isMainThread()).
+ (WebCore::setCurrentCookieStorage): Ditto.
+ (WebCore::setCookieStoragePrivateBrowsingEnabled): Set cookie storage to a private one
+ when in private browsing mode. ResourceHandle applies the storage to each individual request.
+
+ * platform/network/cf/CookieStorageCFNet.h: Added a comment explaining that these functions
+ are only for WebKit1.
+
2010-10-23 David Kilzer <ddkilzer@apple.com>
<http://webkit.org/b/48181> Add missing include of MacErrors.h
WebCore/platform/network/BlobResourceHandle.cpp \
WebCore/platform/network/BlobResourceHandle.h \
WebCore/platform/network/BlobStorageData.h \
+ WebCore/platform/network/CookieStorage.h \
WebCore/platform/network/Credential.cpp \
WebCore/platform/network/Credential.h \
WebCore/platform/network/DNS.h \
_wkSetCGFontRenderingMode
_wkSetCONNECTProxyAuthorizationForStream
_wkSetCONNECTProxyForStream
+_wkSetCookieStoragePrivateBrowsingEnabled
_wkSetDragImage
_wkSetNSURLConnectionDefersCallbacks
_wkSetNSURLRequestShouldContentSniff
'platform/network/BlobData.h',
'platform/network/BlobRegistry.h',
'platform/network/BlobStorageData.h',
+ 'platform/network/CookieStorage.h',
'platform/network/Credential.cpp',
'platform/network/Credential.h',
'platform/network/DNS.h',
platform/network/BlobRegistryImpl.h \
platform/network/BlobResourceHandle.h \
platform/network/BlobStorageData.h \
+ platform/network/CookieStorage.h \
platform/network/Credential.h \
platform/network/FormDataBuilder.h \
platform/network/FormData.h \
>\r
</File>\r
<File\r
+ RelativePath="..\platform\network\CookieStorage.h"\r
+ >\r
+ </File>\r
+ <File\r
RelativePath="..\platform\network\Credential.cpp"\r
>\r
</File>\r
E1284BD61044A01E00EAEB52 /* DOMPageTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E1284BD41044A01E00EAEB52 /* DOMPageTransitionEvent.h */; };
E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = E12EDB7A0B308A78002704B6 /* EventTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E12EDBE90B308E0B002704B6 /* EventTarget.cpp */; };
+ E13F01EB1270E10D00DFBA71 /* CookieStorage.h in Resources */ = {isa = PBXBuildFile; fileRef = E13F01EA1270E10D00DFBA71 /* CookieStorage.h */; };
+ E13F01F11270E19000DFBA71 /* CookieStorageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */; };
E15A36D71104572000B7B639 /* XMLNSNames.h in Headers */ = {isa = PBXBuildFile; fileRef = E15A36D61104572000B7B639 /* XMLNSNames.h */; };
E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15A36D81104572700B7B639 /* XMLNSNames.cpp */; };
E169803D1133542D00894115 /* CRuntimeObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E169803C1133542D00894115 /* CRuntimeObject.h */; };
E1284BD41044A01E00EAEB52 /* DOMPageTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPageTransitionEvent.h; sourceTree = "<group>"; };
E12EDB7A0B308A78002704B6 /* EventTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTarget.h; sourceTree = "<group>"; };
E12EDBE90B308E0B002704B6 /* EventTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTarget.cpp; sourceTree = "<group>"; };
+ E13F01EA1270E10D00DFBA71 /* CookieStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookieStorage.h; sourceTree = "<group>"; };
+ E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookieStorageMac.mm; sourceTree = "<group>"; };
E15A36D61104572000B7B639 /* XMLNSNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLNSNames.h; sourceTree = "<group>"; };
E15A36D81104572700B7B639 /* XMLNSNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLNSNames.cpp; sourceTree = "<group>"; };
E169803C1133542D00894115 /* CRuntimeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRuntimeObject.h; sourceTree = "<group>"; };
2EB4BCD1121F03E300EC4885 /* BlobResourceHandle.h */,
2EDEF1F2121B0EFC00726DB2 /* BlobStorageData.h */,
514C76580CE923A1007EF3CD /* Credential.cpp */,
+ E13F01EA1270E10D00DFBA71 /* CookieStorage.h */,
514C76590CE923A1007EF3CD /* Credential.h */,
51A052321058774F00CC9E95 /* CredentialStorage.cpp */,
51A052311058774F00CC9E95 /* CredentialStorage.h */,
934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */,
514C76420CE9234E007EF3CD /* AuthenticationMac.h */,
514C76430CE9234E007EF3CD /* AuthenticationMac.mm */,
+ E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */,
E1B4CD2410B322E200BFFD7E /* CredentialStorageMac.mm */,
514C76440CE9234E007EF3CD /* FormDataStreamMac.h */,
514C76450CE9234E007EF3CD /* FormDataStreamMac.mm */,
85136CA80AED665900F90A3D /* westResizeCursor.png in Resources */,
1AB1AE7A0C051FDE00139F4F /* zoomInCursor.png in Resources */,
1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */,
+ E13F01EB1270E10D00DFBA71 /* CookieStorage.h in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9728C3131268E4390041E89B /* MarkupAccumulator.cpp in Sources */,
E18772F1126E2629003DD586 /* Language.cpp in Sources */,
7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */,
+ E13F01F11270E19000DFBA71 /* CookieStorageMac.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
#include "BackForwardList.h"
#include "CachedResourceLoader.h"
+#include "CookieStorage.h"
#include "DOMTimer.h"
#include "Database.h"
#include "Frame.h"
if (m_privateBrowsingEnabled == privateBrowsingEnabled)
return;
+ // FIXME: We can only enable cookie private browsing mode globally, so it's misleading to have it as a per-page setting.
+ setCookieStoragePrivateBrowsingEnabled(privateBrowsingEnabled);
+
m_privateBrowsingEnabled = privateBrowsingEnabled;
m_page->privateBrowsingStateChanged();
}
// - Application Cache
// - Back/Forward Page History
// - Page Search Results
+ // - HTTP Cookies
+ // - Plug-ins (that support NPNVprivateModeBool)
void setPrivateBrowsingEnabled(bool);
bool privateBrowsingEnabled() const { return m_privateBrowsingEnabled; }
#include "ContextMenu.h"
#include "ContextMenuItem.h"
#include "CookieJar.h"
+#include "CookieStorage.h"
#include "Cursor.h"
#include "Database.h"
#include "DocumentFragment.h"
notImplemented();
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
#endif
#include "config.h"
+#include "CookieStorage.h"
#include "KURL.h"
#include "NotImplemented.h"
#include "SharedBuffer.h"
return 0;
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
} // namespace WebCore
#include "config.h"
#include "AXObjectCache.h"
+#include "CookieStorage.h"
#include "Editor.h"
#include "FTPDirectoryDocument.h"
#include "FrameView.h"
return FLT_MAX;
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
}
#include "config.h"
#include "AXObjectCache.h"
+#include "CookieStorage.h"
#include "DNS.h"
#include "Editor.h"
#include "FrameView.h"
void getSupportedKeySizes(Vector<String>&) { notImplemented(); }
String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) { return String(); }
float userIdleTime() { notImplemented(); return FLT_MAX; } // return an arbitrarily high userIdleTime so that releasing pages from the page cache isn't postponed
+void setCookieStoragePrivateBrowsingEnabled(bool) { notImplemented(); }
}
#include "config.h"
+#include "CookieStorage.h"
#include "KURL.h"
#include "NotImplemented.h"
#include "PlatformString.h"
return String();
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
} // namespace WebCore
extern void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
extern void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
+extern void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
extern void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
+void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
void (*wkSetDragImage)(NSImage*, NSPoint offset);
void (*wkSetPatternBaseCTM)(CGContextRef, CGAffineTransform);
void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
--- /dev/null
+/*
+ * Copyright (C) 2010 Apple 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 INC. 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 INC. 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.
+ */
+
+#ifndef CookieStorage_h
+#define CookieStorage_h
+
+namespace WebCore {
+
+void setCookieStoragePrivateBrowsingEnabled(bool);
+
+}
+
+#endif
CFHTTPCookieStorageRef currentCookieStorage()
{
+ ASSERT(isMainThread());
+
if (s_cookieStorage)
return s_cookieStorage.get();
return wkGetDefaultHTTPCookieStorage();
void setCurrentCookieStorage(CFHTTPCookieStorageRef cookieStorage)
{
+ ASSERT(isMainThread());
+
s_cookieStorage = cookieStorage;
}
+void setCookieStoragePrivateBrowsingEnabled(bool enabled)
+{
+ ASSERT(isMainThread());
+
+ if (enabled)
+ s_cookieStorage.adoptPtr(wkCreatePrivateHTTPCookieStorage());
+ else
+ s_cookieStorage = 0;
+}
+
}
namespace WebCore {
CFHTTPCookieStorageRef currentCookieStorage();
-
+
+ // Needed for WebKit1 API only.
void setCurrentCookieStorage(CFHTTPCookieStorageRef cookieStorage);
}
--- /dev/null
+/*
+ * Copyright (C) 2008 Apple 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.
+ */
+
+#include "config.h"
+#include "CookieStorage.h"
+
+#import "WebCoreSystemInterface.h"
+
+namespace WebCore {
+
+void setCookieStoragePrivateBrowsingEnabled(bool enabled)
+{
+ wkSetCookieStoragePrivateBrowsingEnabled(enabled);
+}
+
+}
#include "AXObjectCache.h"
#include "CachedResource.h"
#include "CookieJar.h"
+#include "CookieStorage.h"
#include "Cursor.h"
#include "DNS.h"
#include "FTPDirectoryDocument.h"
}
#endif
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
}
// vim: ts=4 sw=4 et
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48083
+ <rdar://problem/8489082> Need WebKit2 API for private browsing (48083)
+
+ * WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): Initialize the new method.
+
2010-10-22 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
INIT(SetCGFontRenderingMode);
INIT(SetCONNECTProxyAuthorizationForStream);
INIT(SetCONNECTProxyForStream);
+ INIT(SetCookieStoragePrivateBrowsingEnabled);
INIT(SetDragImage);
INIT(SetNSURLConnectionDefersCallbacks);
INIT(SetNSURLRequestShouldContentSniff);
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48083
+ <rdar://problem/8489082> Need WebKit2 API for private browsing (48083)
+
+ * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface):
+ Initialize the new method.
+
2010-10-21 Timothy Hatcher <timothy@apple.com>
Stub out WebInspectorFrontendClient.
INIT(SetCGFontRenderingMode);
INIT(SetCONNECTProxyAuthorizationForStream);
INIT(SetCONNECTProxyForStream);
+ INIT(SetCookieStoragePrivateBrowsingEnabled);
INIT(SetDragImage);
INIT(SetNSURLConnectionDefersCallbacks);
INIT(SetNSURLRequestShouldContentSniff);
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48083
+ <rdar://problem/8489082> Need WebKit2 API for private browsing (48083)
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+ * win/include/WebKitSystemInterface/WebKitSystemInterface.h:
+ * win/lib/WebKitSystemInterface.lib:
+ * win/lib/WebKitSystemInterface_debug.lib:
+ Updated WebKitSystemInterface with necessary methods.
+
2010-10-22 Adam Roben <aroben@apple.com>
Turn on ENABLE_3D_RENDERING on all Windows builds
Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
+void WKSetCookieStoragePrivateBrowsingEnabled(BOOL enabled);
+
unsigned WKGetNSAutoreleasePoolCount(void);
void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
void* wkGetSSLPeerCertificateData(CFDictionaryRef);
void* wkGetSSLCertificateChainContext(CFDictionaryRef);
CFHTTPCookieStorageRef wkGetDefaultHTTPCookieStorage();
+CFHTTPCookieStorageRef wkCreatePrivateHTTPCookieStorage();
void wkSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool);
CFStringRef wkCopyFoundationCacheDirectory();
void wkSetClientCertificateInSSLProperties(CFMutableDictionaryRef, CFDataRef);