Diff
Modified: trunk/Source/WebCore/ChangeLog (137646 => 137647)
--- trunk/Source/WebCore/ChangeLog 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebCore/ChangeLog 2012-12-13 21:48:03 UTC (rev 137647)
@@ -178,6 +178,17 @@
2012-12-13 Alexey Proskuryakov <a...@apple.com>
+ <rdar://problem/12838354> Per-Tab WebProcess: DOM cookie access functions should respect private browsing
+ https://bugs.webkit.org/show_bug.cgi?id=104691
+
+ Reviewed by Sam Weinig.
+
+ * platform/network/NetworkingContext.h: Added a function that returns current
+ context type. Ideally, we would track contexts across processes in a generic manner,
+ but we only have two now, and don't need such complications.
+
+2012-12-13 Alexey Proskuryakov <a...@apple.com>
+
ResourceLoader::didReceiveAuthenticationChallenge uses a wrong client
https://bugs.webkit.org/show_bug.cgi?id=104935
<rdar://problem/12870361>
Modified: trunk/Source/WebCore/platform/network/NetworkingContext.h (137646 => 137647)
--- trunk/Source/WebCore/platform/network/NetworkingContext.h 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebCore/platform/network/NetworkingContext.h 2012-12-13 21:48:03 UTC (rev 137647)
@@ -80,6 +80,7 @@
#endif
#if PLATFORM(MAC) || USE(CFNETWORK)
+ virtual bool inPrivateBrowsingMode() const = 0;
virtual CFURLStorageSessionRef storageSession() const = 0;
#endif
Modified: trunk/Source/WebKit/mac/ChangeLog (137646 => 137647)
--- trunk/Source/WebKit/mac/ChangeLog 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit/mac/ChangeLog 2012-12-13 21:48:03 UTC (rev 137647)
@@ -1,3 +1,16 @@
+2012-12-13 Alexey Proskuryakov <a...@apple.com>
+
+ <rdar://problem/12838354> Per-Tab WebProcess: DOM cookie access functions should respect private browsing
+ https://bugs.webkit.org/show_bug.cgi?id=104691
+
+ Reviewed by Sam Weinig.
+
+ * WebCoreSupport/WebFrameNetworkingContext.h:
+ * WebCoreSupport/WebFrameNetworkingContext.mm:
+ (WebFrameNetworkingContext::inPrivateBrowsingMode):
+ (WebFrameNetworkingContext::storageSession):
+ Implemented inPrivateBrowsingMode().
+
2012-12-12 Mark Lam <mark....@apple.com>
Encapsulate externally used webdatabase APIs in DatabaseManager.
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.h (137646 => 137647)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.h 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.h 2012-12-13 21:48:03 UTC (rev 137647)
@@ -43,6 +43,7 @@
virtual bool needsSiteSpecificQuirks() const OVERRIDE;
virtual bool localFileContentSniffingEnabled() const OVERRIDE;
+ virtual bool inPrivateBrowsingMode() const OVERRIDE;
virtual CFURLStorageSessionRef storageSession() const OVERRIDE;
virtual WebCore::SchedulePairHashSet* scheduledRunLoopPairs() const OVERRIDE;
virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const OVERRIDE;
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm (137646 => 137647)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm 2012-12-13 21:48:03 UTC (rev 137647)
@@ -97,10 +97,14 @@
return defaultCFStorageSession;
}
+bool WebFrameNetworkingContext::inPrivateBrowsingMode() const
+{
+ return frame() && frame()->settings() && frame()->settings()->privateBrowsingEnabled();
+}
+
CFURLStorageSessionRef WebFrameNetworkingContext::storageSession() const
{
- bool privateBrowsingEnabled = frame() && frame()->settings() && frame()->settings()->privateBrowsingEnabled();
- if (privateBrowsingEnabled) {
+ if (inPrivateBrowsingMode()) {
ASSERT(privateBrowsingStorageSession);
return privateBrowsingStorageSession;
}
Modified: trunk/Source/WebKit/win/ChangeLog (137646 => 137647)
--- trunk/Source/WebKit/win/ChangeLog 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit/win/ChangeLog 2012-12-13 21:48:03 UTC (rev 137647)
@@ -1,3 +1,16 @@
+2012-12-13 Alexey Proskuryakov <a...@apple.com>
+
+ <rdar://problem/12838354> Per-Tab WebProcess: DOM cookie access functions should respect private browsing
+ https://bugs.webkit.org/show_bug.cgi?id=104691
+
+ Reviewed by Sam Weinig.
+
+ * WebCoreSupport/WebFrameNetworkingContext.cpp:
+ (WebFrameNetworkingContext::inPrivateBrowsingMode):
+ (WebFrameNetworkingContext::storageSession):
+ * WebCoreSupport/WebFrameNetworkingContext.h:
+ Implemented inPrivateBrowsingMode().
+
2012-12-12 Mark Lam <mark....@apple.com>
Encapsulate externally used webdatabase APIs in DatabaseManager.
Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp (137646 => 137647)
--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp 2012-12-13 21:48:03 UTC (rev 137647)
@@ -108,9 +108,14 @@
return defaultCFStorageSession;
}
+bool WebFrameNetworkingContext::inPrivateBrowsingMode() const
+{
+ return frame() && frame()->settings() && frame()->settings()->privateBrowsingEnabled();
+}
+
CFURLStorageSessionRef WebFrameNetworkingContext::storageSession() const
{
- bool privateBrowsingEnabled = frame() && frame()->settings() && frame()->settings()->privateBrowsingEnabled();
+ bool privateBrowsingEnabled = inPrivateBrowsingMode();
if (privateBrowsingEnabled) {
ASSERT(privateBrowsingStorageSession);
return privateBrowsingStorageSession;
Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h (137646 => 137647)
--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h 2012-12-13 21:48:03 UTC (rev 137647)
@@ -50,6 +50,7 @@
virtual WTF::String userAgent() const;
virtual WTF::String referrer() const;
#if USE(CFNETWORK)
+ virtual bool inPrivateBrowsingMode() const;
virtual CFURLStorageSessionRef storageSession() const;
#endif
virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const;
Modified: trunk/Source/WebKit2/ChangeLog (137646 => 137647)
--- trunk/Source/WebKit2/ChangeLog 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit2/ChangeLog 2012-12-13 21:48:03 UTC (rev 137647)
@@ -1,3 +1,46 @@
+2012-12-13 Alexey Proskuryakov <a...@apple.com>
+
+ <rdar://problem/12838354> Per-Tab WebProcess: DOM cookie access functions should respect private browsing
+ https://bugs.webkit.org/show_bug.cgi?id=104691
+
+ Reviewed by Sam Weinig.
+
+ Pass private browsing state from local context to remote one.
+
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ (WebKit::networkingContext):
+ (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
+ (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
+ (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
+ (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
+ (WebKit::NetworkConnectionToWebProcess::getRawCookies):
+ (WebKit::NetworkConnectionToWebProcess::deleteCookie):
+ (WebKit::NetworkConnectionToWebProcess::getHostnamesWithCookies):
+ (WebKit::NetworkConnectionToWebProcess::deleteCookiesForHostname):
+ (WebKit::NetworkConnectionToWebProcess::deleteAllCookies):
+ * NetworkProcess/NetworkConnectionToWebProcess.h:
+ * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+ * NetworkProcess/mac/RemoteNetworkingContext.h:
+ * NetworkProcess/mac/RemoteNetworkingContext.mm:
+ (WebKit::RemoteNetworkingContext::inPrivateBrowsingMode):
+ (WebKit::RemoteNetworkingContext::storageSession):
+ * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+ (WebKit::WebPlatformStrategies::cookiesForDOM):
+ (WebKit::WebPlatformStrategies::setCookiesFromDOM):
+ (WebKit::WebPlatformStrategies::cookiesEnabled):
+ (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
+ (WebKit::WebPlatformStrategies::getRawCookies):
+ (WebKit::WebPlatformStrategies::deleteCookie):
+ (WebKit::WebPlatformStrategies::getHostnamesWithCookies):
+ (WebKit::WebPlatformStrategies::deleteCookiesForHostname):
+ (WebKit::WebPlatformStrategies::deleteAllCookies):
+ * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
+ * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
+ (WebKit::WebFrameNetworkingContext::inPrivateBrowsingMode):
+ (WebKit::WebFrameNetworkingContext::storageSession):
+ * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h:
+ (WebFrameNetworkingContext::inPrivateBrowsingMode):
+
2012-12-13 Anders Carlsson <ander...@apple.com>
Get rid of DownloadManager::shared
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (137646 => 137647)
--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp 2012-12-13 21:48:03 UTC (rev 137647)
@@ -153,60 +153,72 @@
m_serialLoadingEnabled = enabled;
}
-void NetworkConnectionToWebProcess::cookiesForDOM(const KURL& firstParty, const KURL& url, String& result)
+static RemoteNetworkingContext* networkingContext(bool privateBrowsingEnabled)
{
+ // This networking context is only needed to get storage session from.
+ if (privateBrowsingEnabled) {
+ static RemoteNetworkingContext* context = RemoteNetworkingContext::create(false, false, true).leakRef();
+ return context;
+ } else {
+ static RemoteNetworkingContext* context = RemoteNetworkingContext::create(false, false, false).leakRef();
+ return context;
+ }
+}
+
+void NetworkConnectionToWebProcess::cookiesForDOM(bool privateBrowsingEnabled, const KURL& firstParty, const KURL& url, String& result)
+{
// FIXME (NetworkProcess): Use a correct storage session.
- result = WebCore::cookiesForDOM(RemoteNetworkingContext::create(false, false, false).get(), firstParty, url);
+ result = WebCore::cookiesForDOM(networkingContext(privateBrowsingEnabled), firstParty, url);
}
-void NetworkConnectionToWebProcess::setCookiesFromDOM(const KURL& firstParty, const KURL& url, const String& cookieString)
+void NetworkConnectionToWebProcess::setCookiesFromDOM(bool privateBrowsingEnabled, const KURL& firstParty, const KURL& url, const String& cookieString)
{
// FIXME (NetworkProcess): Use a correct storage session.
- WebCore::setCookiesFromDOM(RemoteNetworkingContext::create(false, false, false).get(), firstParty, url, cookieString);
+ WebCore::setCookiesFromDOM(networkingContext(privateBrowsingEnabled), firstParty, url, cookieString);
}
-void NetworkConnectionToWebProcess::cookiesEnabled(const KURL& firstParty, const KURL& url, bool& result)
+void NetworkConnectionToWebProcess::cookiesEnabled(bool privateBrowsingEnabled, const KURL& firstParty, const KURL& url, bool& result)
{
// FIXME (NetworkProcess): Use a correct storage session.
- result = WebCore::cookiesEnabled(RemoteNetworkingContext::create(false, false, false).get(), firstParty, url);
+ result = WebCore::cookiesEnabled(networkingContext(privateBrowsingEnabled), firstParty, url);
}
-void NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue(const KURL& firstParty, const KURL& url, String& result)
+void NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue(bool privateBrowsingEnabled, const KURL& firstParty, const KURL& url, String& result)
{
// FIXME (NetworkProcess): Use a correct storage session.
result = WebCore::cookieRequestHeaderFieldValue(0, firstParty, url);
}
-void NetworkConnectionToWebProcess::getRawCookies(const KURL& firstParty, const KURL& url, Vector<Cookie>& result)
+void NetworkConnectionToWebProcess::getRawCookies(bool privateBrowsingEnabled, const KURL& firstParty, const KURL& url, Vector<Cookie>& result)
{
// FIXME (NetworkProcess): Use a correct storage session.
- WebCore::getRawCookies(RemoteNetworkingContext::create(false, false, false).get(), firstParty, url, result);
+ WebCore::getRawCookies(networkingContext(privateBrowsingEnabled), firstParty, url, result);
}
-void NetworkConnectionToWebProcess::deleteCookie(const KURL& url, const String& cookieName)
+void NetworkConnectionToWebProcess::deleteCookie(bool privateBrowsingEnabled, const KURL& url, const String& cookieName)
{
// FIXME (NetworkProcess): Use a correct storage session.
- WebCore::deleteCookie(RemoteNetworkingContext::create(false, false, false).get(), url, cookieName);
+ WebCore::deleteCookie(networkingContext(privateBrowsingEnabled), url, cookieName);
}
-void NetworkConnectionToWebProcess::getHostnamesWithCookies(Vector<String>& hostnames)
+void NetworkConnectionToWebProcess::getHostnamesWithCookies(bool privateBrowsingEnabled, Vector<String>& hostnames)
{
// FIXME (NetworkProcess): Use a correct storage session.
HashSet<String> hostnamesSet;
- WebCore::getHostnamesWithCookies(RemoteNetworkingContext::create(false, false, false).get(), hostnamesSet);
+ WebCore::getHostnamesWithCookies(networkingContext(privateBrowsingEnabled), hostnamesSet);
WTF::copyToVector(hostnamesSet, hostnames);
}
-void NetworkConnectionToWebProcess::deleteCookiesForHostname(const String& hostname)
+void NetworkConnectionToWebProcess::deleteCookiesForHostname(bool privateBrowsingEnabled, const String& hostname)
{
// FIXME (NetworkProcess): Use a correct storage session.
- WebCore::deleteCookiesForHostname(RemoteNetworkingContext::create(false, false, false).get(), hostname);
+ WebCore::deleteCookiesForHostname(networkingContext(privateBrowsingEnabled), hostname);
}
-void NetworkConnectionToWebProcess::deleteAllCookies()
+void NetworkConnectionToWebProcess::deleteAllCookies(bool privateBrowsingEnabled)
{
// FIXME (NetworkProcess): Use a correct storage session.
- WebCore::deleteAllCookies(RemoteNetworkingContext::create(false, false, false).get());
+ WebCore::deleteAllCookies(networkingContext(privateBrowsingEnabled));
}
} // namespace WebKit
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h (137646 => 137647)
--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h 2012-12-13 21:48:03 UTC (rev 137647)
@@ -82,15 +82,15 @@
void suspendPendingRequests();
void resumePendingRequests();
void setSerialLoadingEnabled(bool);
- void cookiesForDOM(const WebCore::KURL& firstParty, const WebCore::KURL&, String& result);
- void setCookiesFromDOM(const WebCore::KURL& firstParty, const WebCore::KURL&, const String&);
- void cookiesEnabled(const WebCore::KURL& firstParty, const WebCore::KURL&, bool& result);
- void cookieRequestHeaderFieldValue(const WebCore::KURL& firstParty, const WebCore::KURL&, String& result);
- void getRawCookies(const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&);
- void deleteCookie(const WebCore::KURL&, const String& cookieName);
- void getHostnamesWithCookies(Vector<String>& hostnames);
- void deleteCookiesForHostname(const String& hostname);
- void deleteAllCookies();
+ void cookiesForDOM(bool privateBrowsingEnabled, const WebCore::KURL& firstParty, const WebCore::KURL&, String& result);
+ void setCookiesFromDOM(bool privateBrowsingEnabled, const WebCore::KURL& firstParty, const WebCore::KURL&, const String&);
+ void cookiesEnabled(bool privateBrowsingEnabled, const WebCore::KURL& firstParty, const WebCore::KURL&, bool& result);
+ void cookieRequestHeaderFieldValue(bool privateBrowsingEnabled, const WebCore::KURL& firstParty, const WebCore::KURL&, String& result);
+ void getRawCookies(bool privateBrowsingEnabled, const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&);
+ void deleteCookie(bool privateBrowsingEnabled, const WebCore::KURL&, const String& cookieName);
+ void getHostnamesWithCookies(bool privateBrowsingEnabled, Vector<String>& hostnames);
+ void deleteCookiesForHostname(bool privateBrowsingEnabled, const String& hostname);
+ void deleteAllCookies(bool privateBrowsingEnabled);
RefPtr<CoreIPC::Connection> m_connection;
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in (137646 => 137647)
--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in 2012-12-13 21:48:03 UTC (rev 137647)
@@ -39,15 +39,15 @@
SetSerialLoadingEnabled(bool enabled) -> ()
- CookiesForDOM(WebCore::KURL firstParty, WebCore::KURL url) -> (WTF::String result)
- SetCookiesFromDOM(WebCore::KURL firstParty, WebCore::KURL url, WTF::String cookieString)
- CookiesEnabled(WebCore::KURL firstParty, WebCore::KURL url) -> (bool enabled)
- CookieRequestHeaderFieldValue(WebCore::KURL firstParty, WebCore::KURL url) -> (WTF::String result)
- GetRawCookies(WebCore::KURL firstParty, WebCore::KURL url) -> (WTF::Vector<WebCore::Cookie> cookies)
- DeleteCookie(WebCore::KURL url, WTF::String cookieName)
- GetHostnamesWithCookies() -> (WTF::Vector<WTF::String> hostnames)
- DeleteCookiesForHostname(WTF::String hostname)
- DeleteAllCookies()
+ CookiesForDOM(bool privateBrowsingEnabled, WebCore::KURL firstParty, WebCore::KURL url) -> (WTF::String result)
+ SetCookiesFromDOM(bool privateBrowsingEnabled, WebCore::KURL firstParty, WebCore::KURL url, WTF::String cookieString)
+ CookiesEnabled(bool privateBrowsingEnabled, WebCore::KURL firstParty, WebCore::KURL url) -> (bool enabled)
+ CookieRequestHeaderFieldValue(bool privateBrowsingEnabled, WebCore::KURL firstParty, WebCore::KURL url) -> (WTF::String result)
+ GetRawCookies(bool privateBrowsingEnabled, WebCore::KURL firstParty, WebCore::KURL url) -> (WTF::Vector<WebCore::Cookie> cookies)
+ DeleteCookie(bool privateBrowsingEnabled, WebCore::KURL url, WTF::String cookieName)
+ GetHostnamesWithCookies(bool privateBrowsingEnabled) -> (WTF::Vector<WTF::String> hostnames)
+ DeleteCookiesForHostname(bool privateBrowsingEnabled, WTF::String hostname)
+ DeleteAllCookies(bool privateBrowsingEnabled)
}
#endif // ENABLE(NETWORK_PROCESS)
Modified: trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.h (137646 => 137647)
--- trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.h 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.h 2012-12-13 21:48:03 UTC (rev 137647)
@@ -49,6 +49,7 @@
virtual bool needsSiteSpecificQuirks() const OVERRIDE;
virtual bool localFileContentSniffingEnabled() const OVERRIDE;
+ virtual bool inPrivateBrowsingMode() const OVERRIDE;
virtual CFURLStorageSessionRef storageSession() const OVERRIDE;
virtual NSOperationQueue *scheduledOperationQueue() const OVERRIDE;
virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const OVERRIDE;
Modified: trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm (137646 => 137647)
--- trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm 2012-12-13 21:48:03 UTC (rev 137647)
@@ -63,9 +63,14 @@
return m_localFileContentSniffingEnabled;
}
+bool RemoteNetworkingContext::inPrivateBrowsingMode() const
+{
+ return m_privateBrowsingEnabled;
+}
+
CFURLStorageSessionRef RemoteNetworkingContext::storageSession() const
{
- if (m_privateBrowsingEnabled) {
+ if (inPrivateBrowsingMode()) {
ASSERT(privateBrowsingStorageSession);
return privateBrowsingStorageSession;
}
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp (137646 => 137647)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp 2012-12-13 21:48:03 UTC (rev 137647)
@@ -120,7 +120,7 @@
#if ENABLE(NETWORK_PROCESS)
if (WebProcess::shared().usesNetworkProcess()) {
String result;
- if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
+ if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(context->inPrivateBrowsingMode(), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
return String();
return result;
}
@@ -133,7 +133,7 @@
{
#if ENABLE(NETWORK_PROCESS)
if (WebProcess::shared().usesNetworkProcess()) {
- WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(firstParty, url, cookieString), 0);
+ WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(context->inPrivateBrowsingMode(), firstParty, url, cookieString), 0);
return;
}
#endif
@@ -146,7 +146,7 @@
#if ENABLE(NETWORK_PROCESS)
if (WebProcess::shared().usesNetworkProcess()) {
bool result;
- if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
+ if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(context->inPrivateBrowsingMode(), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
return false;
return result;
}
@@ -160,7 +160,7 @@
#if ENABLE(NETWORK_PROCESS)
if (WebProcess::shared().usesNetworkProcess()) {
String result;
- if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
+ if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(context->inPrivateBrowsingMode(), firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
return String();
return result;
}
@@ -173,7 +173,7 @@
{
#if ENABLE(NETWORK_PROCESS)
if (WebProcess::shared().usesNetworkProcess()) {
- if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
+ if (!WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(context->inPrivateBrowsingMode(), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
return false;
return true;
}
@@ -186,7 +186,7 @@
{
#if ENABLE(NETWORK_PROCESS)
if (WebProcess::shared().usesNetworkProcess()) {
- WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(url, cookieName), 0);
+ WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(context->inPrivateBrowsingMode(), url, cookieName), 0);
return;
}
#endif
@@ -199,7 +199,7 @@
#if ENABLE(NETWORK_PROCESS)
if (WebProcess::shared().usesNetworkProcess()) {
Vector<String> hostnamesVector;
- WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetHostnamesWithCookies(), Messages::NetworkConnectionToWebProcess::GetHostnamesWithCookies::Reply(hostnamesVector), 0);
+ WebProcess::shared().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetHostnamesWithCookies(context->inPrivateBrowsingMode()), Messages::NetworkConnectionToWebProcess::GetHostnamesWithCookies::Reply(hostnamesVector), 0);
for (unsigned i = 0; i != hostnamesVector.size(); ++i)
hostnames.add(hostnamesVector[i]);
return;
@@ -213,7 +213,7 @@
{
#if ENABLE(NETWORK_PROCESS)
if (WebProcess::shared().usesNetworkProcess()) {
- WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookiesForHostname(hostname), 0);
+ WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookiesForHostname(context->inPrivateBrowsingMode(), hostname), 0);
return;
}
#endif
@@ -225,7 +225,7 @@
{
#if ENABLE(NETWORK_PROCESS)
if (WebProcess::shared().usesNetworkProcess()) {
- WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteAllCookies(), 0);
+ WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteAllCookies(context->inPrivateBrowsingMode()), 0);
return;
}
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h (137646 => 137647)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h 2012-12-13 21:48:03 UTC (rev 137647)
@@ -48,6 +48,7 @@
virtual bool needsSiteSpecificQuirks() const OVERRIDE;
virtual bool localFileContentSniffingEnabled() const OVERRIDE;
+ virtual bool inPrivateBrowsingMode() const OVERRIDE;
virtual CFURLStorageSessionRef storageSession() const OVERRIDE;
virtual WebCore::SchedulePairHashSet* scheduledRunLoopPairs() const OVERRIDE;
virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const OVERRIDE;
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm (137646 => 137647)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm 2012-12-13 21:48:03 UTC (rev 137647)
@@ -103,10 +103,14 @@
return defaultCFStorageSession;
}
+bool WebFrameNetworkingContext::inPrivateBrowsingMode() const
+{
+ return frame() && frame()->settings() && frame()->settings()->privateBrowsingEnabled();
+}
+
CFURLStorageSessionRef WebFrameNetworkingContext::storageSession() const
{
- bool privateBrowsingEnabled = frame() && frame()->settings() && frame()->settings()->privateBrowsingEnabled();
- if (privateBrowsingEnabled) {
+ if (inPrivateBrowsingMode()) {
ASSERT(privateBrowsingStorageSession);
return privateBrowsingStorageSession;
}
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h (137646 => 137647)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h 2012-12-13 21:37:25 UTC (rev 137646)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h 2012-12-13 21:48:03 UTC (rev 137647)
@@ -23,6 +23,7 @@
#include "WebFrame.h"
#include <WebCore/FrameNetworkingContext.h>
+#include <WebCore/NotImplemented.h>
#include <WebCore/ResourceError.h>
#include <WebCore/ResourceRequest.h>
@@ -44,6 +45,7 @@
virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const;
#if USE(CFNETWORK)
+ virtual bool inPrivateBrowsingMode() const;
virtual CFURLStorageSessionRef storageSession() const;
#endif