<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[186476] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/186476">186476</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-07-07 14:13:31 -0700 (Tue, 07 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>HTTP Auth cached after disabling private browsing/reset.
<rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
Reviewed by Tim Horton.
Source/WebCore:
Test: http/tests/security/private-browsing-http-auth.html
- Change most static CredentialStorage methods to be instance methods instead.
- Make a CredentialStorage objects be per-NetworkStorageSession.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::WebSocketChannel):
(WebCore::WebSocketChannel::connect): Only start the web socket load if a networking
context is available.
* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::defaultCredentialStorage): Returns the credential storage
from the default NetworkStorageSession.
(WebCore::CredentialStorage::set):
(WebCore::CredentialStorage::get):
(WebCore::CredentialStorage::remove):
(WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
(WebCore::CredentialStorage::clearCredentials):
(WebCore::protectionSpaceToCredentialMap): Deleted.
(WebCore::originsWithCredentials): Deleted.
(WebCore::pathToDefaultProtectionSpaceMap): Deleted.
(WebCore::findDefaultProtectionSpaceForURL): Deleted.
(WebCore::CredentialStorage::setPrivateMode): Deleted. Was a no-op anyways.
* platform/network/CredentialStorage.h:
* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::credentialStorage):
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
* platform/network/cf/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
(WebCore::SocketStreamHandle::getStoredCONNECTProxyCredentials):
(WebCore::getStoredCONNECTProxyCredentials): Deleted.
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::ResourceHandleManager::applyAuthenticationToRequest):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::applyAuthenticationToRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
Source/WebKit/mac:
* Misc/WebCache.h:
* Misc/WebCache.mm:
(+[WebCache clearCachedCredentials]): Clear the global CredentialStorage as well as the
storages belonging to each main frame of each WebView. This method is for DRT.
* Misc/WebDownload.mm:
(-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]):
* Plugins/WebBaseNetscapePluginView.mm:
(WebKit::getAuthenticationInfo):
* WebView/WebView.mm:
(-[WebView _clearCredentials]): Clear the storage belonging to the current networking session
of the main frame of this WebView.
* WebView/WebViewInternal.h:
Source/WebKit/win:
* WebDownloadCFNet.cpp:
(WebDownload::didReceiveAuthenticationChallenge):
Source/WebKit2:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::getAuthenticationInfo):
Tools:
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebViewToConsistentStateBeforeTesting): Clear in-memory credentials in between test runs.
LayoutTests:
* http/tests/security/private-browsing-http-auth-expected.txt: Added.
* http/tests/security/private-browsing-http-auth.html: Added.
* http/tests/security/resources/auth-echo.php: Added.
* http/tests/security/resources/basic-auth.php: Added.
* platform/wk2/TestExpectations:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformwk2TestExpectations">trunk/LayoutTests/platform/wk2/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebsocketsWebSocketChannelcpp">trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkCredentialStoragecpp">trunk/Source/WebCore/platform/network/CredentialStorage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkCredentialStorageh">trunk/Source/WebCore/platform/network/CredentialStorage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkNetworkStorageSessionh">trunk/Source/WebCore/platform/network/NetworkStorageSession.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfResourceHandleCFNetcpp">trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfSocketStreamHandleh">trunk/Source/WebCore/platform/network/cf/SocketStreamHandle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfSocketStreamHandleCFNetcpp">trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlResourceHandleCurlcpp">trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlResourceHandleManagercpp">trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm">trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupResourceHandleSoupcpp">trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebCacheh">trunk/Source/WebKit/mac/Misc/WebCache.h</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebCachemm">trunk/Source/WebKit/mac/Misc/WebCache.mm</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebDownloadmm">trunk/Source/WebKit/mac/Misc/WebDownload.mm</a></li>
<li><a href="#trunkSourceWebKitmacPluginsWebBaseNetscapePluginViewmm">trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewInternalh">trunk/Source/WebKit/mac/WebView/WebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebDownloadCFNetcpp">trunk/Source/WebKit/win/WebDownloadCFNet.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPluginViewcpp">trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreemacDumpRenderTreemm">trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestssecurityprivatebrowsinghttpauthexpectedtxt">trunk/LayoutTests/http/tests/security/private-browsing-http-auth-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityprivatebrowsinghttpauthhtml">trunk/LayoutTests/http/tests/security/private-browsing-http-auth.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityresourcesauthechophp">trunk/LayoutTests/http/tests/security/resources/auth-echo.php</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityresourcesbasicauthphp">trunk/LayoutTests/http/tests/security/resources/basic-auth.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/LayoutTests/ChangeLog        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-07-07 Brady Eidson <beidson@apple.com>
+
+ HTTP Auth cached after disabling private browsing/reset.
+ <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
+
+ Reviewed by Tim Horton.
+
+ * http/tests/security/private-browsing-http-auth-expected.txt: Added.
+ * http/tests/security/private-browsing-http-auth.html: Added.
+ * http/tests/security/resources/auth-echo.php: Added.
+ * http/tests/security/resources/basic-auth.php: Added.
+ * platform/wk2/TestExpectations:
+
</ins><span class="cx"> 2015-07-07 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION(169105): CSS Regions: renderer returns wrong selection root when it is inside a column flow.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityprivatebrowsinghttpauthexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/private-browsing-http-auth-expected.txt (0 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/private-browsing-http-auth-expected.txt         (rev 0)
+++ trunk/LayoutTests/http/tests/security/private-browsing-http-auth-expected.txt        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+http://127.0.0.1:8000/security/resources/basic-auth.php?username=webkit&password=rocks - didReceiveAuthenticationChallenge - Responding with webkit:rocks
+This test makes sure that auth credentials cached during a private browsing session do not leak out after private browsing is disabled.
+
+--------
+Frame: '<!--framePath //<!--frame0-->-->'
+--------
+Authenticated as user: webkit password: rocks
+
+--------
+Frame: '<!--framePath //<!--frame1-->-->'
+--------
+Resource loaded with HTTP authentication username '' and password ''
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityprivatebrowsinghttpauthhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/private-browsing-http-auth.html (0 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/private-browsing-http-auth.html         (rev 0)
+++ trunk/LayoutTests/http/tests/security/private-browsing-http-auth.html        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+<script>
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+ testRunner.setHandlesAuthenticationChallenges(true);
+ testRunner.setAuthenticationUsername("webkit");
+ testRunner.setAuthenticationPassword("rocks");
+ testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.waitUntilDone();
+}
+
+function firstFrameLoaded() {
+ if (window.testRunner) {
+ testRunner.setHandlesAuthenticationChallenges(false);
+         testRunner.setPrivateBrowsingEnabled(false);
+ }
+
+ // If the username and password were in the WebCore CredentialStorage, WebKit would automatically send them out for this resource.
+ // The credentials would be wrong, but it would send them out.
+ // Since the credentails that were cached from the first iframe load should have been forgotten after private browsing was disabled,
+ // no credentials should be sent out automatically this time.
+
+ var frame = document.createElement("iframe");
+ frame.setAttribute("src", "resources/auth-echo.php");
+ frame.setAttribute("onload", "secondFrameLoaded()");
+ document.body.appendChild(frame);
+}
+
+function secondFrameLoaded() {
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+</script>
+<body>
+This test makes sure that auth credentials cached during a private browsing session do not leak out after private browsing is disabled.
+<iframe src="resources/basic-auth.php?username=webkit&password=rocks" onload="firstFrameLoaded();"></iframe>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityresourcesauthechophp"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/resources/auth-echo.php (0 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/resources/auth-echo.php         (rev 0)
+++ trunk/LayoutTests/http/tests/security/resources/auth-echo.php        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<?php
+echo "Resource loaded with HTTP authentication username '", $_SERVER["PHP_AUTH_USER"], "' and password '", $_SERVER["PHP_AUTH_PW"], "'\n";
+?>
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityresourcesbasicauthphp"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/resources/basic-auth.php (0 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/resources/basic-auth.php         (rev 0)
+++ trunk/LayoutTests/http/tests/security/resources/basic-auth.php        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+<?php
+$expectedUsername = isset($_GET['username']) ? $_GET['username'] : 'username';
+$expectedPassword = isset($_GET['password']) ? $_GET['password'] : 'password';
+$realm = isset($_GET['realm']) ? $_GET['realm'] : $_SERVER['REQUEST_URI'];
+
+header("Cache-Control: no-store");
+header("Connection: close");
+if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != $expectedUsername ||
+ !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_PW'] != $expectedPassword) {
+ header("WWW-Authenticate: Basic realm=\"" . $realm . "\"");
+ header('HTTP/1.0 401 Unauthorized');
+ print 'Sent username:password of (' . $_SERVER['PHP_AUTH_USER'] . ':' . $_SERVER['PHP_AUTH_PW'] . ') which is not what was expected';
+ exit;
+}
+?>
+Authenticated as user: <?php print (string)$_SERVER['PHP_AUTH_USER']?> password: <?php print (string)$_SERVER['PHP_AUTH_PW']?>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wk2/TestExpectations (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wk2/TestExpectations        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/LayoutTests/platform/wk2/TestExpectations        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -421,6 +421,9 @@
</span><span class="cx"> # This test is not the cause of the problem, just the one that happens to currently be the victim.
</span><span class="cx"> svg/filters/filter-hidden-content.svg [ Pass Failure ]
</span><span class="cx">
</span><ins>+# No good way to test private browsing in WKTR right now
+http/tests/security/private-browsing-http-auth.html
+
</ins><span class="cx"> ### END OF (2) Classified failures without bug reports (yet)
</span><span class="cx"> ########################################
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/ChangeLog        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -1,3 +1,68 @@
</span><ins>+2015-07-07 Brady Eidson <beidson@apple.com>
+
+ HTTP Auth cached after disabling private browsing/reset.
+ <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
+
+ Reviewed by Tim Horton.
+
+ Test: http/tests/security/private-browsing-http-auth.html
+
+ - Change most static CredentialStorage methods to be instance methods instead.
+ - Make a CredentialStorage objects be per-NetworkStorageSession.
+
+ * Modules/websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::WebSocketChannel):
+ (WebCore::WebSocketChannel::connect): Only start the web socket load if a networking
+ context is available.
+
+ * platform/network/CredentialStorage.cpp:
+ (WebCore::CredentialStorage::defaultCredentialStorage): Returns the credential storage
+ from the default NetworkStorageSession.
+ (WebCore::CredentialStorage::set):
+ (WebCore::CredentialStorage::get):
+ (WebCore::CredentialStorage::remove):
+ (WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
+ (WebCore::CredentialStorage::clearCredentials):
+ (WebCore::protectionSpaceToCredentialMap): Deleted.
+ (WebCore::originsWithCredentials): Deleted.
+ (WebCore::pathToDefaultProtectionSpaceMap): Deleted.
+ (WebCore::findDefaultProtectionSpaceForURL): Deleted.
+ (WebCore::CredentialStorage::setPrivateMode): Deleted. Was a no-op anyways.
+ * platform/network/CredentialStorage.h:
+
+ * platform/network/NetworkStorageSession.h:
+ (WebCore::NetworkStorageSession::credentialStorage):
+
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::ResourceHandle::createCFURLConnection):
+ (WebCore::ResourceHandle::willSendRequest):
+ (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+ (WebCore::ResourceHandle::receivedCredential):
+
+ * platform/network/cf/SocketStreamHandle.h:
+ (WebCore::SocketStreamHandle::create):
+ * platform/network/cf/SocketStreamHandleCFNet.cpp:
+ (WebCore::SocketStreamHandle::SocketStreamHandle):
+ (WebCore::SocketStreamHandle::getStoredCONNECTProxyCredentials):
+ (WebCore::getStoredCONNECTProxyCredentials): Deleted.
+
+ * platform/network/curl/ResourceHandleCurl.cpp:
+ (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+ (WebCore::ResourceHandle::receivedCredential):
+ * platform/network/curl/ResourceHandleManager.cpp:
+ (WebCore::ResourceHandleManager::applyAuthenticationToRequest):
+
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::createNSURLConnection):
+ (WebCore::ResourceHandle::willSendRequest):
+ (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+ (WebCore::ResourceHandle::receivedCredential):
+
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::applyAuthenticationToRequest):
+ (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+ (WebCore::ResourceHandle::receivedCredential):
+
</ins><span class="cx"> 2015-07-07 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION(169105): CSS Regions: renderer returns wrong selection root when it is inside a column flow.
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebsocketsWebSocketChannelcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -81,6 +81,8 @@
</span><span class="cx"> , m_outgoingFrameQueueStatus(OutgoingFrameQueueOpen)
</span><span class="cx"> , m_blobLoaderStatus(BlobLoaderNotStarted)
</span><span class="cx"> {
</span><ins>+ ASSERT(m_document);
+
</ins><span class="cx"> if (Page* page = m_document->page())
</span><span class="cx"> m_identifier = page->progress().createUniqueIdentifier();
</span><span class="cx">
</span><span class="lines">@@ -103,8 +105,13 @@
</span><span class="cx"> m_handshake->addExtensionProcessor(m_deflateFramer.createExtensionProcessor());
</span><span class="cx"> if (m_identifier)
</span><span class="cx"> InspectorInstrumentation::didCreateWebSocket(m_document, m_identifier, url, m_document->url(), protocol);
</span><del>- ref();
- m_handle = SocketStreamHandle::create(m_handshake->url(), this);
</del><ins>+
+ if (Frame* frame = m_document->frame()) {
+ if (NetworkingContext* networkingContext = frame->loader().networkingContext()) {
+ ref();
+ m_handle = SocketStreamHandle::create(m_handshake->url(), this, *networkingContext);
+ }
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String WebSocketChannel::subprotocol()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkCredentialStoragecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/CredentialStorage.cpp (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/CredentialStorage.cpp        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/platform/network/CredentialStorage.cpp        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -26,15 +26,9 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "CredentialStorage.h"
</span><span class="cx">
</span><del>-#include "Credential.h"
</del><ins>+#include "NetworkStorageSession.h"
</ins><span class="cx"> #include "URL.h"
</span><del>-#include "ProtectionSpaceHash.h"
-#include <wtf/text/WTFString.h>
-#include <wtf/text/StringHash.h>
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/MainThread.h>
-#include <wtf/StdLibExtras.h>
</del><ins>+#include <wtf/NeverDestroyed.h>
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include "WebCoreThread.h"
</span><span class="lines">@@ -42,29 +36,11 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-typedef HashMap<ProtectionSpace, Credential> ProtectionSpaceToCredentialMap;
-static ProtectionSpaceToCredentialMap& protectionSpaceToCredentialMap()
</del><ins>+CredentialStorage& CredentialStorage::defaultCredentialStorage()
</ins><span class="cx"> {
</span><del>- ASSERT(isMainThread());
- DEPRECATED_DEFINE_STATIC_LOCAL(ProtectionSpaceToCredentialMap, map, ());
- return map;
</del><ins>+ return NetworkStorageSession::defaultStorageSession().credentialStorage();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static HashSet<String>& originsWithCredentials()
-{
- ASSERT(isMainThread());
- DEPRECATED_DEFINE_STATIC_LOCAL(HashSet<String>, set, ());
- return set;
-}
-
-typedef HashMap<String, ProtectionSpace> PathToDefaultProtectionSpaceMap;
-static PathToDefaultProtectionSpaceMap& pathToDefaultProtectionSpaceMap()
-{
- ASSERT(isMainThread());
- DEPRECATED_DEFINE_STATIC_LOCAL(PathToDefaultProtectionSpaceMap, map, ());
- return map;
-}
-
</del><span class="cx"> static String originStringFromURL(const URL& url)
</span><span class="cx"> {
</span><span class="cx"> if (url.port())
</span><span class="lines">@@ -96,7 +72,7 @@
</span><span class="cx"> ASSERT(protectionSpace.isProxy() || protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested || url.protocolIsInHTTPFamily());
</span><span class="cx"> ASSERT(protectionSpace.isProxy() || protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeClientCertificateRequested || url.isValid());
</span><span class="cx">
</span><del>- protectionSpaceToCredentialMap().set(protectionSpace, credential);
</del><ins>+ m_protectionSpaceToCredentialMap.set(protectionSpace, credential);
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> if (protectionSpace.authenticationScheme() != ProtectionSpaceAuthenticationSchemeClientCertificateRequested)
</span><span class="lines">@@ -104,46 +80,44 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> if (!protectionSpace.isProxy() && protectionSpace.authenticationScheme() != ProtectionSpaceAuthenticationSchemeClientCertificateRequested) {
</span><del>- originsWithCredentials().add(originStringFromURL(url));
</del><ins>+ m_originsWithCredentials.add(originStringFromURL(url));
</ins><span class="cx">
</span><span class="cx"> ProtectionSpaceAuthenticationScheme scheme = protectionSpace.authenticationScheme();
</span><span class="cx"> if (scheme == ProtectionSpaceAuthenticationSchemeHTTPBasic || scheme == ProtectionSpaceAuthenticationSchemeDefault) {
</span><span class="cx"> // The map can contain both a path and its subpath - while redundant, this makes lookups faster.
</span><del>- pathToDefaultProtectionSpaceMap().set(protectionSpaceMapKeyFromURL(url), protectionSpace);
</del><ins>+ m_pathToDefaultProtectionSpaceMap.set(protectionSpaceMapKeyFromURL(url), protectionSpace);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Credential CredentialStorage::get(const ProtectionSpace& protectionSpace)
</span><span class="cx"> {
</span><del>- return protectionSpaceToCredentialMap().get(protectionSpace);
</del><ins>+ return m_protectionSpaceToCredentialMap.get(protectionSpace);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CredentialStorage::remove(const ProtectionSpace& protectionSpace)
</span><span class="cx"> {
</span><del>- protectionSpaceToCredentialMap().remove(protectionSpace);
</del><ins>+ m_protectionSpaceToCredentialMap.remove(protectionSpace);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static PathToDefaultProtectionSpaceMap::iterator findDefaultProtectionSpaceForURL(const URL& url)
</del><ins>+HashMap<String, ProtectionSpace>::iterator CredentialStorage::findDefaultProtectionSpaceForURL(const URL& url)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(url.protocolIsInHTTPFamily());
</span><span class="cx"> ASSERT(url.isValid());
</span><span class="cx">
</span><del>- PathToDefaultProtectionSpaceMap& map = pathToDefaultProtectionSpaceMap();
-
</del><span class="cx"> // Don't spend time iterating the path for origins that don't have any credentials.
</span><del>- if (!originsWithCredentials().contains(originStringFromURL(url)))
- return map.end();
</del><ins>+ if (!m_originsWithCredentials.contains(originStringFromURL(url)))
+ return m_pathToDefaultProtectionSpaceMap.end();
</ins><span class="cx">
</span><span class="cx"> String directoryURL = protectionSpaceMapKeyFromURL(url);
</span><span class="cx"> unsigned directoryURLPathStart = url.pathStart();
</span><span class="cx"> while (true) {
</span><del>- PathToDefaultProtectionSpaceMap::iterator iter = map.find(directoryURL);
- if (iter != map.end())
</del><ins>+ PathToDefaultProtectionSpaceMap::iterator iter = m_pathToDefaultProtectionSpaceMap.find(directoryURL);
+ if (iter != m_pathToDefaultProtectionSpaceMap.end())
</ins><span class="cx"> return iter;
</span><span class="cx">
</span><span class="cx"> if (directoryURL.length() == directoryURLPathStart + 1) // path is "/" already, cannot shorten it any more
</span><del>- return map.end();
</del><ins>+ return m_pathToDefaultProtectionSpaceMap.end();
</ins><span class="cx">
</span><span class="cx"> size_t index = directoryURL.reverseFind('/', directoryURL.length() - 2);
</span><span class="cx"> ASSERT(index != notFound);
</span><span class="lines">@@ -158,34 +132,26 @@
</span><span class="cx"> ASSERT(url.protocolIsInHTTPFamily());
</span><span class="cx"> ASSERT(url.isValid());
</span><span class="cx"> PathToDefaultProtectionSpaceMap::iterator iter = findDefaultProtectionSpaceForURL(url);
</span><del>- if (iter == pathToDefaultProtectionSpaceMap().end())
</del><ins>+ if (iter == m_pathToDefaultProtectionSpaceMap.end())
</ins><span class="cx"> return false;
</span><del>- ASSERT(originsWithCredentials().contains(originStringFromURL(url)));
- protectionSpaceToCredentialMap().set(iter->value, credential);
</del><ins>+ ASSERT(m_originsWithCredentials.contains(originStringFromURL(url)));
+ m_protectionSpaceToCredentialMap.set(iter->value, credential);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Credential CredentialStorage::get(const URL& url)
</span><span class="cx"> {
</span><span class="cx"> PathToDefaultProtectionSpaceMap::iterator iter = findDefaultProtectionSpaceForURL(url);
</span><del>- if (iter == pathToDefaultProtectionSpaceMap().end())
</del><ins>+ if (iter == m_pathToDefaultProtectionSpaceMap.end())
</ins><span class="cx"> return Credential();
</span><del>- return protectionSpaceToCredentialMap().get(iter->value);
</del><ins>+ return m_protectionSpaceToCredentialMap.get(iter->value);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
</del><span class="cx"> void CredentialStorage::clearCredentials()
</span><span class="cx"> {
</span><del>- pathToDefaultProtectionSpaceMap().clear();
- originsWithCredentials().clear();
- protectionSpaceToCredentialMap().clear();
</del><ins>+ m_protectionSpaceToCredentialMap.clear();
+ m_originsWithCredentials.clear();
+ m_pathToDefaultProtectionSpaceMap.clear();
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx">
</span><del>-void CredentialStorage::setPrivateMode(bool mode)
-{
- if (!mode)
- protectionSpaceToCredentialMap().clear();
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkCredentialStorageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/CredentialStorage.h (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/CredentialStorage.h        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/platform/network/CredentialStorage.h        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -26,33 +26,49 @@
</span><span class="cx"> #ifndef CredentialStorage_h
</span><span class="cx"> #define CredentialStorage_h
</span><span class="cx">
</span><ins>+#include "Credential.h"
+#include "ProtectionSpaceHash.h"
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/text/StringHash.h>
+#include <wtf/text/WTFString.h>
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class Credential;
</del><span class="cx"> class URL;
</span><span class="cx"> class ProtectionSpace;
</span><span class="cx">
</span><span class="cx"> class CredentialStorage {
</span><span class="cx"> public:
</span><ins>+ WEBCORE_EXPORT static CredentialStorage& defaultCredentialStorage();
+
</ins><span class="cx"> // WebCore session credential storage.
</span><del>- static void set(const Credential&, const ProtectionSpace&, const URL&);
- WEBCORE_EXPORT static Credential get(const ProtectionSpace&);
- static void remove(const ProtectionSpace&);
</del><ins>+ void set(const Credential&, const ProtectionSpace&, const URL&);
+ WEBCORE_EXPORT Credential get(const ProtectionSpace&);
+ void remove(const ProtectionSpace&);
</ins><span class="cx">
</span><span class="cx"> // OS persistent storage.
</span><del>- WEBCORE_EXPORT static Credential getFromPersistentStorage(const ProtectionSpace&);
</del><ins>+ WEBCORE_EXPORT Credential getFromPersistentStorage(const ProtectionSpace&);
</ins><span class="cx">
</span><ins>+ WEBCORE_EXPORT void clearCredentials();
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>- static void saveToPersistentStorage(const ProtectionSpace&, const Credential&);
- WEBCORE_EXPORT static void clearCredentials();
</del><ins>+ void saveToPersistentStorage(const ProtectionSpace&, const Credential&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> // These methods work for authentication schemes that support sending credentials without waiting for a request. E.g., for HTTP Basic authentication scheme
</span><span class="cx"> // a client should assume that all paths at or deeper than the depth of a known protected resource share are within the same protection space.
</span><del>- static bool set(const Credential&, const URL&); // Returns true if the URL corresponds to a known protection space, so credentials could be updated.
- WEBCORE_EXPORT static Credential get(const URL&);
</del><ins>+ bool set(const Credential&, const URL&); // Returns true if the URL corresponds to a known protection space, so credentials could be updated.
+ WEBCORE_EXPORT Credential get(const URL&);
</ins><span class="cx">
</span><del>- static void setPrivateMode(bool);
</del><ins>+private:
+ HashMap<ProtectionSpace, Credential> m_protectionSpaceToCredentialMap;
+ HashSet<String> m_originsWithCredentials;
+
+ typedef HashMap<String, ProtectionSpace> PathToDefaultProtectionSpaceMap;
+ PathToDefaultProtectionSpaceMap m_pathToDefaultProtectionSpaceMap;
+
+ PathToDefaultProtectionSpaceMap::iterator findDefaultProtectionSpaceForURL(const URL&);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkNetworkStorageSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/NetworkStorageSession.h (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/NetworkStorageSession.h        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/platform/network/NetworkStorageSession.h        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #ifndef NetworkStorageSession_h
</span><span class="cx"> #define NetworkStorageSession_h
</span><span class="cx">
</span><ins>+#include "CredentialStorage.h"
+
</ins><span class="cx"> #include <wtf/RetainPtr.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="lines">@@ -47,6 +49,8 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT static void switchToNewTestingSession();
</span><span class="cx">
</span><ins>+ CredentialStorage& credentialStorage() { return m_credentialStorage; }
+
</ins><span class="cx"> #if PLATFORM(COCOA) || USE(CFNETWORK)
</span><span class="cx"> NetworkStorageSession(RetainPtr<CFURLStorageSessionRef>);
</span><span class="cx"> // May be null, in which case a Foundation default should be used.
</span><span class="lines">@@ -72,6 +76,8 @@
</span><span class="cx"> #else
</span><span class="cx"> RefPtr<NetworkingContext> m_context;
</span><span class="cx"> #endif
</span><ins>+
+ CredentialStorage m_credentialStorage;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfResourceHandleCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -132,12 +132,12 @@
</span><span class="cx"> if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
</span><span class="cx"> // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
</span><span class="cx"> // try and reuse the credential preemptively, as allowed by RFC 2617.
</span><del>- d->m_initialCredential = CredentialStorage::get(firstRequest().url());
</del><ins>+ d->m_initialCredential = d->m_context->storageSession().credentialStorage().get(firstRequest().url());
</ins><span class="cx"> } else {
</span><span class="cx"> // If there is already a protection space known for the URL, update stored credentials before sending a request.
</span><span class="cx"> // This makes it possible to implement logout by sending an XMLHttpRequest with known incorrect credentials, and aborting it immediately
</span><span class="cx"> // (so that an authentication dialog doesn't pop up).
</span><del>- CredentialStorage::set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url());
</del><ins>+ d->m_context->storageSession().credentialStorage().set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -293,7 +293,7 @@
</span><span class="cx"> // Only consider applying authentication credentials if this is actually a redirect and the redirect
</span><span class="cx"> // URL didn't include credentials of its own.
</span><span class="cx"> if (d->m_user.isEmpty() && d->m_pass.isEmpty() && !redirectResponse.isNull()) {
</span><del>- Credential credential = CredentialStorage::get(request.url());
</del><ins>+ Credential credential = d->m_context->storageSession().credentialStorage().get(request.url());
</ins><span class="cx"> if (!credential.isEmpty()) {
</span><span class="cx"> d->m_initialCredential = credential;
</span><span class="cx">
</span><span class="lines">@@ -358,7 +358,7 @@
</span><span class="cx"> URL urlToStore;
</span><span class="cx"> if (challenge.failureResponse().httpStatusCode() == 401)
</span><span class="cx"> urlToStore = challenge.failureResponse().url();
</span><del>- CredentialStorage::set(credential, challenge.protectionSpace(), urlToStore);
</del><ins>+ d->m_context->storageSession().credentialStorage().set(credential, challenge.protectionSpace(), urlToStore);
</ins><span class="cx">
</span><span class="cx"> CFURLConnectionUseCredential(d->m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
</span><span class="cx"> d->m_user = String();
</span><span class="lines">@@ -372,16 +372,16 @@
</span><span class="cx"> // The stored credential wasn't accepted, stop using it.
</span><span class="cx"> // There is a race condition here, since a different credential might have already been stored by another ResourceHandle,
</span><span class="cx"> // but the observable effect should be very minor, if any.
</span><del>- CredentialStorage::remove(challenge.protectionSpace());
</del><ins>+ d->m_context->storageSession().credentialStorage().remove(challenge.protectionSpace());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!challenge.previousFailureCount()) {
</span><del>- Credential credential = CredentialStorage::get(challenge.protectionSpace());
</del><ins>+ Credential credential = d->m_context->storageSession().credentialStorage().get(challenge.protectionSpace());
</ins><span class="cx"> if (!credential.isEmpty() && credential != d->m_initialCredential) {
</span><span class="cx"> ASSERT(credential.persistence() == CredentialPersistenceNone);
</span><span class="cx"> if (challenge.failureResponse().httpStatusCode() == 401) {
</span><span class="cx"> // Store the credential back, possibly adding it as a default for this directory.
</span><del>- CredentialStorage::set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</del><ins>+ d->m_context->storageSession().credentialStorage().set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</ins><span class="cx"> }
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> CFURLConnectionUseCredential(d->m_connection.get(), credential.cfCredential(), challenge.cfURLAuthChallengeRef());
</span><span class="lines">@@ -435,7 +435,7 @@
</span><span class="cx"> URL urlToStore;
</span><span class="cx"> if (challenge.failureResponse().httpStatusCode() == 401)
</span><span class="cx"> urlToStore = challenge.failureResponse().url();
</span><del>- CredentialStorage::set(webCredential, challenge.protectionSpace(), urlToStore);
</del><ins>+ d->m_context->storageSession().credentialStorage().set(webCredential, challenge.protectionSpace(), urlToStore);
</ins><span class="cx">
</span><span class="cx"> if (d->m_connection) {
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfSocketStreamHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/SocketStreamHandle.h (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/SocketStreamHandle.h        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/platform/network/cf/SocketStreamHandle.h        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -43,11 +43,13 @@
</span><span class="cx">
</span><span class="cx"> class AuthenticationChallenge;
</span><span class="cx"> class Credential;
</span><ins>+class NetworkingContext;
+class ProtectionSpace;
</ins><span class="cx"> class SocketStreamHandleClient;
</span><span class="cx">
</span><span class="cx"> class SocketStreamHandle : public ThreadSafeRefCounted<SocketStreamHandle>, public SocketStreamHandleBase, public AuthenticationClient {
</span><span class="cx"> public:
</span><del>- static PassRefPtr<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient* client) { return adoptRef(new SocketStreamHandle(url, client)); }
</del><ins>+ static PassRefPtr<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient* client, NetworkingContext& networkingContext) { return adoptRef(new SocketStreamHandle(url, client, networkingContext)); }
</ins><span class="cx">
</span><span class="cx"> virtual ~SocketStreamHandle();
</span><span class="cx">
</span><span class="lines">@@ -58,7 +60,7 @@
</span><span class="cx"> virtual int platformSend(const char* data, int length);
</span><span class="cx"> virtual void platformClose();
</span><span class="cx">
</span><del>- SocketStreamHandle(const URL&, SocketStreamHandleClient*);
</del><ins>+ SocketStreamHandle(const URL&, SocketStreamHandleClient*, NetworkingContext&);
</ins><span class="cx"> void createStreams();
</span><span class="cx"> void scheduleStreams();
</span><span class="cx"> void chooseProxy();
</span><span class="lines">@@ -84,6 +86,8 @@
</span><span class="cx">
</span><span class="cx"> void reportErrorToClient(CFErrorRef);
</span><span class="cx">
</span><ins>+ bool getStoredCONNECTProxyCredentials(const ProtectionSpace&, String& login, String& password);
+
</ins><span class="cx"> // No authentication for streams per se, but proxy may ask for credentials.
</span><span class="cx"> virtual void receivedCredential(const AuthenticationChallenge&, const Credential&);
</span><span class="cx"> virtual void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
</span><span class="lines">@@ -108,6 +112,8 @@
</span><span class="cx"> RetainPtr<CFWriteStreamRef> m_writeStream;
</span><span class="cx">
</span><span class="cx"> RetainPtr<CFURLRef> m_httpsURL; // ws(s): replaced with https:
</span><ins>+
+ Ref<NetworkingContext> m_networkingContext;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfSocketStreamHandleCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "Credential.h"
</span><span class="cx"> #include "CredentialStorage.h"
</span><span class="cx"> #include "Logging.h"
</span><ins>+#include "NetworkingContext.h"
</ins><span class="cx"> #include "ProtectionSpace.h"
</span><span class="cx"> #include "SocketStreamError.h"
</span><span class="cx"> #include "SocketStreamHandleClient.h"
</span><span class="lines">@@ -61,11 +62,12 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-SocketStreamHandle::SocketStreamHandle(const URL& url, SocketStreamHandleClient* client)
</del><ins>+SocketStreamHandle::SocketStreamHandle(const URL& url, SocketStreamHandleClient* client, NetworkingContext& networkingContext)
</ins><span class="cx"> : SocketStreamHandleBase(url, client)
</span><span class="cx"> , m_connectingSubstate(New)
</span><span class="cx"> , m_connectionType(Unknown)
</span><span class="cx"> , m_sentStoredCredentials(false)
</span><ins>+ , m_networkingContext(networkingContext)
</ins><span class="cx"> {
</span><span class="cx"> LOG(Network, "SocketStreamHandle %p new client %p", this, m_client);
</span><span class="cx">
</span><span class="lines">@@ -331,14 +333,14 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool getStoredCONNECTProxyCredentials(const ProtectionSpace& protectionSpace, String& login, String& password)
</del><ins>+bool SocketStreamHandle::getStoredCONNECTProxyCredentials(const ProtectionSpace& protectionSpace, String& login, String& password)
</ins><span class="cx"> {
</span><span class="cx"> // FIXME (<rdar://problem/10416495>): Proxy credentials should be retrieved from AuthBrokerAgent.
</span><span class="cx">
</span><span class="cx"> // Try system credential storage first, matching HTTP behavior (CFNetwork only asks the client for password if it couldn't find it in Keychain).
</span><del>- Credential storedCredential = CredentialStorage::getFromPersistentStorage(protectionSpace);
</del><ins>+ Credential storedCredential = m_networkingContext->storageSession().credentialStorage().getFromPersistentStorage(protectionSpace);
</ins><span class="cx"> if (storedCredential.isEmpty())
</span><del>- storedCredential = CredentialStorage::get(protectionSpace);
</del><ins>+ storedCredential = m_networkingContext->storageSession().credentialStorage().get(protectionSpace);
</ins><span class="cx">
</span><span class="cx"> if (storedCredential.isEmpty())
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlResourceHandleCurlcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx"> URL urlToStore;
</span><span class="cx"> if (challenge.failureResponse().httpStatusCode() == 401)
</span><span class="cx"> urlToStore = challenge.failureResponse().url();
</span><del>- CredentialStorage::set(credential, challenge.protectionSpace(), urlToStore);
</del><ins>+ CredentialStorage::defaultCredentialStorage().set(credential, challenge.protectionSpace(), urlToStore);
</ins><span class="cx">
</span><span class="cx"> String userpass = credential.user() + ":" + credential.password();
</span><span class="cx"> curl_easy_setopt(d->m_handle, CURLOPT_USERPWD, userpass.utf8().data());
</span><span class="lines">@@ -209,16 +209,16 @@
</span><span class="cx"> // The stored credential wasn't accepted, stop using it.
</span><span class="cx"> // There is a race condition here, since a different credential might have already been stored by another ResourceHandle,
</span><span class="cx"> // but the observable effect should be very minor, if any.
</span><del>- CredentialStorage::remove(challenge.protectionSpace());
</del><ins>+ CredentialStorage::defaultCredentialStorage().remove(challenge.protectionSpace());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!challenge.previousFailureCount()) {
</span><del>- Credential credential = CredentialStorage::get(challenge.protectionSpace());
</del><ins>+ Credential credential = CredentialStorage::defaultCredentialStorage().get(challenge.protectionSpace());
</ins><span class="cx"> if (!credential.isEmpty() && credential != d->m_initialCredential) {
</span><span class="cx"> ASSERT(credential.persistence() == CredentialPersistenceNone);
</span><span class="cx"> if (challenge.failureResponse().httpStatusCode() == 401) {
</span><span class="cx"> // Store the credential back, possibly adding it as a default for this directory.
</span><del>- CredentialStorage::set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</del><ins>+ CredentialStorage::defaultCredentialStorage().set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</ins><span class="cx"> }
</span><span class="cx"> String userpass = credential.user() + ":" + credential.password();
</span><span class="cx"> curl_easy_setopt(d->m_handle, CURLOPT_USERPWD, userpass.utf8().data());
</span><span class="lines">@@ -246,7 +246,7 @@
</span><span class="cx"> if (shouldUseCredentialStorage()) {
</span><span class="cx"> if (challenge.failureResponse().httpStatusCode() == 401) {
</span><span class="cx"> URL urlToStore = challenge.failureResponse().url();
</span><del>- CredentialStorage::set(credential, challenge.protectionSpace(), urlToStore);
</del><ins>+ CredentialStorage::defaultCredentialStorage().set(credential, challenge.protectionSpace(), urlToStore);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlResourceHandleManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -967,13 +967,13 @@
</span><span class="cx"> if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
</span><span class="cx"> // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
</span><span class="cx"> // try and reuse the credential preemptively, as allowed by RFC 2617.
</span><del>- d->m_initialCredential = CredentialStorage::get(request.url());
</del><ins>+ d->m_initialCredential = CredentialStorage::defaultCredentialStorage().get(request.url());
</ins><span class="cx"> } else {
</span><span class="cx"> // If there is already a protection space known for the URL, update stored credentials
</span><span class="cx"> // before sending a request. This makes it possible to implement logout by sending an
</span><span class="cx"> // XMLHttpRequest with known incorrect credentials, and aborting it immediately (so that
</span><span class="cx"> // an authentication dialog doesn't pop up).
</span><del>- CredentialStorage::set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), request.url());
</del><ins>+ CredentialStorage::defaultCredentialStorage().set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), request.url());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -160,12 +160,12 @@
</span><span class="cx"> if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
</span><span class="cx"> // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
</span><span class="cx"> // try and reuse the credential preemptively, as allowed by RFC 2617.
</span><del>- d->m_initialCredential = CredentialStorage::get(firstRequest().url());
</del><ins>+ d->m_initialCredential = d->m_context->storageSession().credentialStorage().get(firstRequest().url());
</ins><span class="cx"> } else {
</span><span class="cx"> // If there is already a protection space known for the URL, update stored credentials before sending a request.
</span><span class="cx"> // This makes it possible to implement logout by sending an XMLHttpRequest with known incorrect credentials, and aborting it immediately
</span><span class="cx"> // (so that an authentication dialog doesn't pop up).
</span><del>- CredentialStorage::set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url());
</del><ins>+ d->m_context->storageSession().credentialStorage().set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -478,7 +478,7 @@
</span><span class="cx"> // Only consider applying authentication credentials if this is actually a redirect and the redirect
</span><span class="cx"> // URL didn't include credentials of its own.
</span><span class="cx"> if (d->m_user.isEmpty() && d->m_pass.isEmpty() && !redirectResponse.isNull()) {
</span><del>- Credential credential = CredentialStorage::get(request.url());
</del><ins>+ Credential credential = d->m_context->storageSession().credentialStorage().get(request.url());
</ins><span class="cx"> if (!credential.isEmpty()) {
</span><span class="cx"> d->m_initialCredential = credential;
</span><span class="cx">
</span><span class="lines">@@ -562,16 +562,16 @@
</span><span class="cx"> // The stored credential wasn't accepted, stop using it.
</span><span class="cx"> // There is a race condition here, since a different credential might have already been stored by another ResourceHandle,
</span><span class="cx"> // but the observable effect should be very minor, if any.
</span><del>- CredentialStorage::remove(challenge.protectionSpace());
</del><ins>+ d->m_context->storageSession().credentialStorage().remove(challenge.protectionSpace());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!challenge.previousFailureCount()) {
</span><del>- Credential credential = CredentialStorage::get(challenge.protectionSpace());
</del><ins>+ Credential credential = d->m_context->storageSession().credentialStorage().get(challenge.protectionSpace());
</ins><span class="cx"> if (!credential.isEmpty() && credential != d->m_initialCredential) {
</span><span class="cx"> ASSERT(credential.persistence() == CredentialPersistenceNone);
</span><span class="cx"> if (challenge.failureResponse().httpStatusCode() == 401) {
</span><span class="cx"> // Store the credential back, possibly adding it as a default for this directory.
</span><del>- CredentialStorage::set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</del><ins>+ d->m_context->storageSession().credentialStorage().set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</ins><span class="cx"> }
</span><span class="cx"> [challenge.sender() useCredential:credential.nsCredential() forAuthenticationChallenge:mac(challenge)];
</span><span class="cx"> return;
</span><span class="lines">@@ -656,7 +656,7 @@
</span><span class="cx"> URL urlToStore;
</span><span class="cx"> if (challenge.failureResponse().httpStatusCode() == 401)
</span><span class="cx"> urlToStore = challenge.failureResponse().url();
</span><del>- CredentialStorage::set(webCredential, ProtectionSpace([d->m_currentMacChallenge protectionSpace]), urlToStore);
</del><ins>+ d->m_context->storageSession().credentialStorage().set(webCredential, ProtectionSpace([d->m_currentMacChallenge protectionSpace]), urlToStore);
</ins><span class="cx"> [[d->m_currentMacChallenge sender] useCredential:webCredential.nsCredential() forAuthenticationChallenge:d->m_currentMacChallenge];
</span><span class="cx"> } else
</span><span class="cx"> [[d->m_currentMacChallenge sender] useCredential:credential.nsCredential() forAuthenticationChallenge:d->m_currentMacChallenge];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupResourceHandleSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -378,13 +378,13 @@
</span><span class="cx">
</span><span class="cx"> if (handle->shouldUseCredentialStorage()) {
</span><span class="cx"> if (d->m_user.isEmpty() && d->m_pass.isEmpty())
</span><del>- d->m_initialCredential = CredentialStorage::get(request.url());
</del><ins>+ d->m_initialCredential = CredentialStorage::defaultCredentialStorage().get(request.url());
</ins><span class="cx"> else if (!redirect) {
</span><span class="cx"> // If there is already a protection space known for the URL, update stored credentials
</span><span class="cx"> // before sending a request. This makes it possible to implement logout by sending an
</span><span class="cx"> // XMLHttpRequest with known incorrect credentials, and aborting it immediately (so that
</span><span class="cx"> // an authentication dialog doesn't pop up).
</span><del>- CredentialStorage::set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), request.url());
</del><ins>+ CredentialStorage::defaultCredentialStorage().set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), request.url());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1137,17 +1137,17 @@
</span><span class="cx"> // The stored credential wasn't accepted, stop using it. There is a race condition
</span><span class="cx"> // here, since a different credential might have already been stored by another
</span><span class="cx"> // ResourceHandle, but the observable effect should be very minor, if any.
</span><del>- CredentialStorage::remove(challenge.protectionSpace());
</del><ins>+ CredentialStorage::defaultCredentialStorage().remove(challenge.protectionSpace());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!challenge.previousFailureCount()) {
</span><del>- Credential credential = CredentialStorage::get(challenge.protectionSpace());
</del><ins>+ Credential credential = CredentialStorage::defaultCredentialStorage().get(challenge.protectionSpace());
</ins><span class="cx"> if (!credential.isEmpty() && credential != d->m_initialCredential) {
</span><span class="cx"> ASSERT(credential.persistence() == CredentialPersistenceNone);
</span><span class="cx">
</span><span class="cx"> // Store the credential back, possibly adding it as a default for this directory.
</span><span class="cx"> if (isAuthenticationFailureStatusCode(challenge.failureResponse().httpStatusCode()))
</span><del>- CredentialStorage::set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</del><ins>+ CredentialStorage::defaultCredentialStorage().set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</ins><span class="cx">
</span><span class="cx"> soup_auth_authenticate(challenge.soupAuth(), credential.user().utf8().data(), credential.password().utf8().data());
</span><span class="cx"> return;
</span><span class="lines">@@ -1200,7 +1200,7 @@
</span><span class="cx"> // we place the credentials in the store even though libsoup will never fire the authenticate signal again for
</span><span class="cx"> // this protection space.
</span><span class="cx"> if (credential.persistence() == CredentialPersistenceForSession || credential.persistence() == CredentialPersistencePermanent)
</span><del>- CredentialStorage::set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</del><ins>+ CredentialStorage::defaultCredentialStorage().set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx"> if (credential.persistence() == CredentialPersistencePermanent) {
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2015-07-07 Brady Eidson <beidson@apple.com>
+
+ HTTP Auth cached after disabling private browsing/reset.
+ <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
+
+ Reviewed by Tim Horton.
+
+ * Misc/WebCache.h:
+ * Misc/WebCache.mm:
+ (+[WebCache clearCachedCredentials]): Clear the global CredentialStorage as well as the
+ storages belonging to each main frame of each WebView. This method is for DRT.
+
+ * Misc/WebDownload.mm:
+ (-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]):
+
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (WebKit::getAuthenticationInfo):
+
+ * WebView/WebView.mm:
+ (-[WebView _clearCredentials]): Clear the storage belonging to the current networking session
+ of the main frame of this WebView.
+ * WebView/WebViewInternal.h:
+
</ins><span class="cx"> 2015-07-04 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Drop RefPtr::clear() method
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebCache.h (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebCache.h        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit/mac/Misc/WebCache.h        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><span class="cx"> + (void)emptyInMemoryResources;
</span><span class="cx"> + (void)sizeOfDeadResources:(int *)resources;
</span><del>-+ (void)clearCachedCredentials;
</del><span class="cx"> // SPI to add a CGImageRef directly to the WebCore cache.
</span><span class="cx"> + (bool)addImageToCache:(CGImageRef)image forURL:(NSURL *)url;
</span><span class="cx"> + (bool)addImageToCache:(CGImageRef)image forURL:(NSURL *)url forFrame:(WebFrame *)frame;
</span><span class="lines">@@ -46,5 +45,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> + (void)setDisabled:(BOOL)disabled;
</span><span class="cx"> + (BOOL)isDisabled;
</span><ins>++ (void)clearCachedCredentials;
</ins><span class="cx">
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebCachemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebCache.mm (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebCache.mm        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit/mac/Misc/WebCache.mm        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #import "WebView.h"
</span><span class="cx"> #import "WebViewInternal.h"
</span><span class="cx"> #import <WebCore/ApplicationCacheStorage.h>
</span><ins>+#import <WebCore/CredentialStorage.h>
</ins><span class="cx"> #import <WebCore/CrossOriginPreflightResultCache.h>
</span><span class="cx"> #import <WebCore/MemoryCache.h>
</span><span class="cx"> #import <runtime/InitializeThreading.h>
</span><span class="lines">@@ -42,7 +43,6 @@
</span><span class="cx"> #import "MemoryMeasure.h"
</span><span class="cx"> #import "WebFrameInternal.h"
</span><span class="cx"> #import <WebCore/CachedImage.h>
</span><del>-#import <WebCore/CredentialStorage.h>
</del><span class="cx"> #import <WebCore/Frame.h>
</span><span class="cx"> #import <WebCore/PageCache.h>
</span><span class="cx"> #import <WebCore/WebCoreThreadRun.h>
</span><span class="lines">@@ -158,11 +158,6 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-+ (void)clearCachedCredentials
-{
- WebCore::CredentialStorage::clearCredentials();
-}
-
</del><span class="cx"> + (bool)addImageToCache:(CGImageRef)image forURL:(NSURL *)url
</span><span class="cx"> {
</span><span class="cx"> return [WebCache addImageToCache:image forURL:url forFrame:nil];
</span><span class="lines">@@ -227,4 +222,10 @@
</span><span class="cx"> return WebCore::MemoryCache::singleton().disabled();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>++ (void)clearCachedCredentials
+{
+ [WebView _makeAllWebViewsPerformSelector:@selector(_clearCredentials)];
+ WebCore::CredentialStorage::defaultCredentialStorage().clearCredentials();
+}
+
</ins><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebDownloadmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebDownload.mm (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebDownload.mm        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit/mac/Misc/WebDownload.mm        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> // Try previously stored credential first.
</span><span class="cx"> if (![challenge previousFailureCount]) {
</span><del>- NSURLCredential *credential = CredentialStorage::get(ProtectionSpace([challenge protectionSpace])).nsCredential();
</del><ins>+ NSURLCredential *credential = CredentialStorage::defaultCredentialStorage().get(ProtectionSpace([challenge protectionSpace])).nsCredential();
</ins><span class="cx"> if (credential) {
</span><span class="cx"> [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebKitmacPluginsWebBaseNetscapePluginViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -927,7 +927,7 @@
</span><span class="cx">
</span><span class="cx"> RetainPtr<NSURLProtectionSpace> protectionSpace = adoptNS([[NSURLProtectionSpace alloc] initWithHost:host port:port protocol:protocol realm:realm authenticationMethod:authenticationMethod]);
</span><span class="cx">
</span><del>- NSURLCredential *credential = CredentialStorage::get(ProtectionSpace(protectionSpace.get())).nsCredential();
</del><ins>+ NSURLCredential *credential = CredentialStorage::defaultCredentialStorage().get(ProtectionSpace(protectionSpace.get())).nsCredential();
</ins><span class="cx"> if (!credential)
</span><span class="cx"> credential = [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:protectionSpace.get()];
</span><span class="cx"> if (!credential)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -8275,6 +8275,19 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)_clearCredentials
+{
+ Frame* frame = [self _mainCoreFrame];
+ if (!frame)
+ return;
+
+ NetworkingContext* networkingContext = frame->loader().networkingContext();
+ if (!networkingContext)
+ return;
+
+ networkingContext->storageSession().credentialStorage().clearCredentials();
+}
+
</ins><span class="cx"> - (BOOL)_needsOneShotDrawingSynchronization
</span><span class="cx"> {
</span><span class="cx"> return _private->needsOneShotDrawingSynchronization;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewInternal.h (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewInternal.h        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit/mac/WebView/WebViewInternal.h        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -103,6 +103,8 @@
</span><span class="cx"> - (WebCore::Frame*)_mainCoreFrame;
</span><span class="cx"> - (WebFrame *)_selectedOrMainFrame;
</span><span class="cx">
</span><ins>+- (void)_clearCredentials;
+
</ins><span class="cx"> - (WebCore::KeyboardUIMode)_keyboardUIMode;
</span><span class="cx">
</span><span class="cx"> - (BOOL)_becomingFirstResponderFromOutside;
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit/win/ChangeLog        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-07-07 Brady Eidson <beidson@apple.com>
+
+ HTTP Auth cached after disabling private browsing/reset.
+ <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
+
+ Reviewed by Tim Horton.
+
+ * WebDownloadCFNet.cpp:
+ (WebDownload::didReceiveAuthenticationChallenge):
+
</ins><span class="cx"> 2015-07-04 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Drop RefPtr::clear() method
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebDownloadCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebDownloadCFNet.cpp (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebDownloadCFNet.cpp        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit/win/WebDownloadCFNet.cpp        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -386,7 +386,7 @@
</span><span class="cx"> {
</span><span class="cx"> // Try previously stored credential first.
</span><span class="cx"> if (!CFURLAuthChallengeGetPreviousFailureCount(challenge)) {
</span><del>- Credential credential = CredentialStorage::get(core(CFURLAuthChallengeGetProtectionSpace(challenge)));
</del><ins>+ Credential credential = CredentialStorage::defaultCredentialStorage().get(core(CFURLAuthChallengeGetProtectionSpace(challenge)));
</ins><span class="cx"> if (!credential.isEmpty()) {
</span><span class="cx"> RetainPtr<CFURLCredentialRef> cfCredential = adoptCF(createCF(credential));
</span><span class="cx"> CFURLDownloadUseCredential(m_download.get(), cfCredential.get(), challenge);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit2/ChangeLog        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-07-07 Brady Eidson <beidson@apple.com>
+
+ HTTP Auth cached after disabling private browsing/reset.
+ <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
+
+ Reviewed by Tim Horton.
+
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::getAuthenticationInfo):
+
</ins><span class="cx"> 2015-07-07 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Make sure to remove the download message receiver before freeing it
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPluginViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -1572,9 +1572,9 @@
</span><span class="cx">
</span><span class="cx"> bool PluginView::getAuthenticationInfo(const ProtectionSpace& protectionSpace, String& username, String& password)
</span><span class="cx"> {
</span><del>- Credential credential = CredentialStorage::get(protectionSpace);
</del><ins>+ Credential credential = CredentialStorage::defaultCredentialStorage().get(protectionSpace);
</ins><span class="cx"> if (credential.isEmpty())
</span><del>- credential = CredentialStorage::getFromPersistentStorage(protectionSpace);
</del><ins>+ credential = CredentialStorage::defaultCredentialStorage().getFromPersistentStorage(protectionSpace);
</ins><span class="cx">
</span><span class="cx"> if (!credential.hasPassword())
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Tools/ChangeLog        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-07-07 Brady Eidson <beidson@apple.com>
+
+ HTTP Auth cached after disabling private browsing/reset.
+ <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
+
+ Reviewed by Tim Horton.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetWebViewToConsistentStateBeforeTesting): Clear in-memory credentials in between test runs.
+
</ins><span class="cx"> 2015-07-06 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> [Content Extensions] Remove memory page reporting
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (186475 => 186476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2015-07-07 20:16:41 UTC (rev 186475)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2015-07-07 21:13:31 UTC (rev 186476)
</span><span class="lines">@@ -1823,6 +1823,8 @@
</span><span class="cx"> [[webView window] setAutodisplay:NO];
</span><span class="cx"> #endif
</span><span class="cx"> [webView setTracksRepaints:NO];
</span><ins>+
+ [WebCache clearCachedCredentials];
</ins><span class="cx">
</span><span class="cx"> resetWebPreferencesToConsistentValues();
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>