<!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>[204702] trunk/Source</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/204702">204702</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-08-21 23:02:52 -0700 (Sun, 21 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use Document&amp; instead of Document* when getting cookies
https://bugs.webkit.org/show_bug.cgi?id=161011

Patch by Alex Christensen &lt;achristensen@webkit.org&gt; on 2016-08-21
Reviewed by Darin Adler.

Source/WebCore:

No change in behavior.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientHandshakeMessage):
(WebCore::WebSocketHandshake::clientHandshakeRequest):
* dom/Document.cpp:
(WebCore::Document::cookie):
(WebCore::Document::setCookie):
(WebCore::Document::referrer):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::deleteCookie):
(WebCore::InspectorPageAgent::getResourceTree):
* loader/CookieJar.cpp:
(WebCore::networkingContext):
(WebCore::storageSession):
(WebCore::cookies):
(WebCore::setCookies):
(WebCore::cookiesEnabled):
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::getRawCookies):
(WebCore::deleteCookie):
(WebCore::addCookie):
* loader/CookieJar.h:
* page/Navigator.cpp:
(WebCore::Navigator::cookieEnabled):
(WebCore::Navigator::javaEnabled):

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::getCookies):
(WebKit::NetscapePluginInstanceProxy::setCookies):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView getVariable:forURL:value:length:]):
(-[WebNetscapePluginView setVariable:forURL:value:length:]):

Source/WebKit/win:

* Plugins/PluginView.cpp:
(WebCore::PluginView::getValueForURL):

Source/WebKit2:

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::getCookiesForFrame):
(WebKit::WebAutomationSessionProxy::deleteCookie):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::cookiesForURL):
(WebKit::PluginView::setCookiesForURL):
(WebKit::PluginView::getAuthenticationInfo):</pre>

<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebCoreModuleswebsocketsWebSocketHandshakecpp">trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderCookieJarcpp">trunk/Source/WebCore/loader/CookieJar.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderCookieJarh">trunk/Source/WebCore/loader/CookieJar.h</a></li>
<li><a href="#trunkSourceWebCorepageNavigatorcpp">trunk/Source/WebCore/page/Navigator.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacPluginsHostedNetscapePluginInstanceProxymm">trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm</a></li>
<li><a href="#trunkSourceWebKitmacPluginsWebNetscapePluginViewmm">trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginViewcpp">trunk/Source/WebKit/win/Plugins/PluginView.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxycpp">trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPluginViewcpp">trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebCore/ChangeLog        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -1,5 +1,42 @@
</span><span class="cx"> 2016-08-21  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        Use Document&amp; instead of Document* when getting cookies
+        https://bugs.webkit.org/show_bug.cgi?id=161011
+
+        Reviewed by Darin Adler.
+
+        No change in behavior.
+
+        * Modules/websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::processBuffer):
+        * Modules/websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::clientHandshakeMessage):
+        (WebCore::WebSocketHandshake::clientHandshakeRequest):
+        * dom/Document.cpp:
+        (WebCore::Document::cookie):
+        (WebCore::Document::setCookie):
+        (WebCore::Document::referrer):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::getCookies):
+        (WebCore::InspectorPageAgent::deleteCookie):
+        (WebCore::InspectorPageAgent::getResourceTree):
+        * loader/CookieJar.cpp:
+        (WebCore::networkingContext):
+        (WebCore::storageSession):
+        (WebCore::cookies):
+        (WebCore::setCookies):
+        (WebCore::cookiesEnabled):
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::getRawCookies):
+        (WebCore::deleteCookie):
+        (WebCore::addCookie):
+        * loader/CookieJar.h:
+        * page/Navigator.cpp:
+        (WebCore::Navigator::cookieEnabled):
+        (WebCore::Navigator::javaEnabled):
+
+2016-08-21  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
</ins><span class="cx">         URLParser should parse IPv4 addresses
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=161023
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebsocketsWebSocketChannelcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx">             if (m_identifier)
</span><span class="cx">                 InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(m_document, m_identifier, m_handshake-&gt;serverHandshakeResponse());
</span><span class="cx">             if (!m_handshake-&gt;serverSetCookie().isEmpty()) {
</span><del>-                if (cookiesEnabled(m_document)) {
</del><ins>+                if (m_document &amp;&amp; cookiesEnabled(*m_document)) {
</ins><span class="cx">                     // Exception (for sandboxed documents) ignored.
</span><span class="cx">                     m_document-&gt;setCookie(m_handshake-&gt;serverSetCookie(), IGNORE_EXCEPTION);
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebsocketsWebSocketHandshakecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -200,8 +200,8 @@
</span><span class="cx">         fields.append(&quot;Sec-WebSocket-Protocol: &quot; + m_clientProtocol);
</span><span class="cx"> 
</span><span class="cx">     URL url = httpURLForAuthenticationAndCookies();
</span><del>-    if (m_allowCookies) {
-        String cookie = cookieRequestHeaderFieldValue(m_document, url);
</del><ins>+    if (m_allowCookies &amp;&amp; m_document) {
+        String cookie = cookieRequestHeaderFieldValue(*m_document, url);
</ins><span class="cx">         if (!cookie.isEmpty())
</span><span class="cx">             fields.append(&quot;Cookie: &quot; + cookie);
</span><span class="cx">     }
</span><span class="lines">@@ -249,8 +249,8 @@
</span><span class="cx">         request.setHTTPHeaderField(HTTPHeaderName::SecWebSocketProtocol, m_clientProtocol);
</span><span class="cx"> 
</span><span class="cx">     URL url = httpURLForAuthenticationAndCookies();
</span><del>-    if (m_allowCookies) {
-        String cookie = cookieRequestHeaderFieldValue(m_document, url);
</del><ins>+    if (m_allowCookies &amp;&amp; m_document) {
+        String cookie = cookieRequestHeaderFieldValue(*m_document, url);
</ins><span class="cx">         if (!cookie.isEmpty())
</span><span class="cx">             request.setHTTPHeaderField(HTTPHeaderName::Cookie, cookie);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -4437,7 +4437,7 @@
</span><span class="cx">         return String();
</span><span class="cx"> 
</span><span class="cx">     if (!isDOMCookieCacheValid())
</span><del>-        setCachedDOMCookies(cookies(this, cookieURL));
</del><ins>+        setCachedDOMCookies(cookies(*this, cookieURL));
</ins><span class="cx"> 
</span><span class="cx">     return cachedDOMCookies();
</span><span class="cx"> }
</span><span class="lines">@@ -4461,7 +4461,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     invalidateDOMCookieCache();
</span><del>-    setCookies(this, cookieURL, value);
</del><ins>+    setCookies(*this, cookieURL, value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String Document::referrer() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -6415,7 +6415,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool HTMLMediaElement::mediaPlayerGetRawCookies(const URL&amp; url, Vector&lt;Cookie&gt;&amp; cookies) const
</span><span class="cx"> {
</span><del>-    return getRawCookies(&amp;document(), url, cookies);
</del><ins>+    return getRawCookies(document(), url, cookies);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -516,10 +516,12 @@
</span><span class="cx"> 
</span><span class="cx">     for (Frame* frame = &amp;mainFrame(); frame; frame = frame-&gt;tree().traverseNext()) {
</span><span class="cx">         Document* document = frame-&gt;document();
</span><ins>+        if (!document)
+            continue;
</ins><span class="cx"> 
</span><span class="cx">         for (auto&amp; url : allResourcesURLsForFrame(frame)) {
</span><span class="cx">             Vector&lt;Cookie&gt; docCookiesList;
</span><del>-            rawCookiesImplemented = getRawCookies(document, URL(ParsedURLString, url), docCookiesList);
</del><ins>+            rawCookiesImplemented = getRawCookies(*document, URL(ParsedURLString, url), docCookiesList);
</ins><span class="cx"> 
</span><span class="cx">             if (!rawCookiesImplemented) {
</span><span class="cx">                 // FIXME: We need duplication checking for the String representation of cookies.
</span><span class="lines">@@ -545,8 +547,10 @@
</span><span class="cx"> void InspectorPageAgent::deleteCookie(ErrorString&amp;, const String&amp; cookieName, const String&amp; url)
</span><span class="cx"> {
</span><span class="cx">     URL parsedURL(ParsedURLString, url);
</span><del>-    for (Frame* frame = &amp;m_page.mainFrame(); frame; frame = frame-&gt;tree().traverseNext())
-        WebCore::deleteCookie(frame-&gt;document(), parsedURL, cookieName);
</del><ins>+    for (Frame* frame = &amp;m_page.mainFrame(); frame; frame = frame-&gt;tree().traverseNext()) {
+        if (auto* document = frame-&gt;document())
+            WebCore::deleteCookie(*document, parsedURL, cookieName);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorPageAgent::getResourceTree(ErrorString&amp;, RefPtr&lt;Inspector::Protocol::Page::FrameResourceTree&gt;&amp; object)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderCookieJarcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/CookieJar.cpp (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/CookieJar.cpp        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebCore/loader/CookieJar.cpp        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -37,12 +37,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static NetworkingContext* networkingContext(const Document* document)
</del><ins>+static NetworkingContext* networkingContext(const Document&amp; document)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Returning 0 means falling back to default context. That's not a choice that is appropriate to do at runtime
</span><del>-    if (!document)
-        return nullptr;
-    Frame* frame = document-&gt;frame();
</del><ins>+    Frame* frame = document.frame();
</ins><span class="cx">     if (!frame)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -49,43 +47,43 @@
</span><span class="cx">     return frame-&gt;loader().networkingContext();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline NetworkStorageSession&amp; storageSession(const Document* document)
</del><ins>+inline NetworkStorageSession&amp; storageSession(const Document&amp; document)
</ins><span class="cx"> {
</span><span class="cx">     NetworkingContext* context = networkingContext(document);
</span><span class="cx">     return context ? context-&gt;storageSession() : NetworkStorageSession::defaultStorageSession();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String cookies(const Document* document, const URL&amp; url)
</del><ins>+String cookies(const Document&amp; document, const URL&amp; url)
</ins><span class="cx"> {
</span><del>-    return platformStrategies()-&gt;cookiesStrategy()-&gt;cookiesForDOM(storageSession(document), document-&gt;firstPartyForCookies(), url);
</del><ins>+    return platformStrategies()-&gt;cookiesStrategy()-&gt;cookiesForDOM(storageSession(document), document.firstPartyForCookies(), url);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void setCookies(Document* document, const URL&amp; url, const String&amp; cookieString)
</del><ins>+void setCookies(Document&amp; document, const URL&amp; url, const String&amp; cookieString)
</ins><span class="cx"> {
</span><del>-    platformStrategies()-&gt;cookiesStrategy()-&gt;setCookiesFromDOM(storageSession(document), document-&gt;firstPartyForCookies(), url, cookieString);
</del><ins>+    platformStrategies()-&gt;cookiesStrategy()-&gt;setCookiesFromDOM(storageSession(document), document.firstPartyForCookies(), url, cookieString);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool cookiesEnabled(const Document* document)
</del><ins>+bool cookiesEnabled(const Document&amp; document)
</ins><span class="cx"> {
</span><del>-    return platformStrategies()-&gt;cookiesStrategy()-&gt;cookiesEnabled(storageSession(document), document-&gt;firstPartyForCookies(), document-&gt;cookieURL());
</del><ins>+    return platformStrategies()-&gt;cookiesStrategy()-&gt;cookiesEnabled(storageSession(document), document.firstPartyForCookies(), document.cookieURL());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-String cookieRequestHeaderFieldValue(const Document* document, const URL&amp; url)
</del><ins>+String cookieRequestHeaderFieldValue(const Document&amp; document, const URL&amp; url)
</ins><span class="cx"> {
</span><del>-    return platformStrategies()-&gt;cookiesStrategy()-&gt;cookieRequestHeaderFieldValue(storageSession(document), document-&gt;firstPartyForCookies(), url);
</del><ins>+    return platformStrategies()-&gt;cookiesStrategy()-&gt;cookieRequestHeaderFieldValue(storageSession(document), document.firstPartyForCookies(), url);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool getRawCookies(const Document* document, const URL&amp; url, Vector&lt;Cookie&gt;&amp; cookies)
</del><ins>+bool getRawCookies(const Document&amp; document, const URL&amp; url, Vector&lt;Cookie&gt;&amp; cookies)
</ins><span class="cx"> {
</span><del>-    return platformStrategies()-&gt;cookiesStrategy()-&gt;getRawCookies(storageSession(document), document-&gt;firstPartyForCookies(), url, cookies);
</del><ins>+    return platformStrategies()-&gt;cookiesStrategy()-&gt;getRawCookies(storageSession(document), document.firstPartyForCookies(), url, cookies);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void deleteCookie(const Document* document, const URL&amp; url, const String&amp; cookieName)
</del><ins>+void deleteCookie(const Document&amp; document, const URL&amp; url, const String&amp; cookieName)
</ins><span class="cx"> {
</span><span class="cx">     platformStrategies()-&gt;cookiesStrategy()-&gt;deleteCookie(storageSession(document), url, cookieName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void addCookie(const Document* document, const URL&amp; url, const Cookie&amp; cookie)
</del><ins>+void addCookie(const Document&amp; document, const URL&amp; url, const Cookie&amp; cookie)
</ins><span class="cx"> {
</span><span class="cx">     platformStrategies()-&gt;cookiesStrategy()-&gt;addCookie(storageSession(document), url, cookie);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderCookieJarh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/CookieJar.h (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/CookieJar.h        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebCore/loader/CookieJar.h        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -39,14 +39,14 @@
</span><span class="cx"> // Functions in this file take a Document pointer to determine which cookie storage to use. We should merge that into call sites, and use PlatformCookieJar directly.
</span><span class="cx"> 
</span><span class="cx"> // These two functions implement document.cookie API, with special rules for HttpOnly cookies.
</span><del>-WEBCORE_EXPORT String cookies(const Document*, const URL&amp;);
-WEBCORE_EXPORT void setCookies(Document*, const URL&amp;, const String&amp; cookieString);
</del><ins>+WEBCORE_EXPORT String cookies(const Document&amp;, const URL&amp;);
+WEBCORE_EXPORT void setCookies(Document&amp;, const URL&amp;, const String&amp; cookieString);
</ins><span class="cx"> 
</span><del>-WEBCORE_EXPORT bool cookiesEnabled(const Document*);
-WEBCORE_EXPORT String cookieRequestHeaderFieldValue(const Document*, const URL&amp;);
-WEBCORE_EXPORT bool getRawCookies(const Document*, const URL&amp;, Vector&lt;Cookie&gt;&amp;);
-WEBCORE_EXPORT void deleteCookie(const Document*, const URL&amp;, const String&amp; cookieName);
-WEBCORE_EXPORT void addCookie(const Document*, const URL&amp;, const Cookie&amp;);
</del><ins>+WEBCORE_EXPORT bool cookiesEnabled(const Document&amp;);
+WEBCORE_EXPORT String cookieRequestHeaderFieldValue(const Document&amp;, const URL&amp;);
+WEBCORE_EXPORT bool getRawCookies(const Document&amp;, const URL&amp;, Vector&lt;Cookie&gt;&amp;);
+WEBCORE_EXPORT void deleteCookie(const Document&amp;, const URL&amp;, const String&amp; cookieName);
+WEBCORE_EXPORT void addCookie(const Document&amp;, const URL&amp;, const Cookie&amp;);
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Navigator.cpp (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Navigator.cpp        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebCore/page/Navigator.cpp        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -111,7 +111,11 @@
</span><span class="cx">     if (m_frame-&gt;page() &amp;&amp; !m_frame-&gt;page()-&gt;settings().cookieEnabled())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return cookiesEnabled(m_frame-&gt;document());
</del><ins>+    auto* document = m_frame-&gt;document();
+    if (!document)
+        return false;
+    
+    return cookiesEnabled(*document);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Navigator::javaEnabled() const
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-08-21  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Use Document&amp; instead of Document* when getting cookies
+        https://bugs.webkit.org/show_bug.cgi?id=161011
+
+        Reviewed by Darin Adler.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::getCookies):
+        (WebKit::NetscapePluginInstanceProxy::setCookies):
+        * Plugins/WebNetscapePluginView.mm:
+        (-[WebNetscapePluginView getVariable:forURL:value:length:]):
+        (-[WebNetscapePluginView setVariable:forURL:value:length:]):
+
</ins><span class="cx"> 2016-08-16  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename didLayout(LayoutMilestones) to didReachLayoutMilestone(), and related WK2 functions
</span></span></pre></div>
<a id="trunkSourceWebKitmacPluginsHostedNetscapePluginInstanceProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -1525,7 +1525,11 @@
</span><span class="cx">         return false;
</span><span class="cx">     
</span><span class="cx">     if (Frame* frame = core([m_pluginView webFrame])) {
</span><del>-        String cookieString = cookies(frame-&gt;document(), url); 
</del><ins>+        auto* document = frame-&gt;document();
+        if (!document)
+            return false;
+
+        String cookieString = cookies(*document, url);
</ins><span class="cx">         WTF::CString cookieStringUTF8 = cookieString.utf8();
</span><span class="cx">         if (cookieStringUTF8.isNull())
</span><span class="cx">             return false;
</span><span class="lines">@@ -1552,8 +1556,12 @@
</span><span class="cx">         String cookieString = String::fromUTF8(cookiesData, cookiesLength);
</span><span class="cx">         if (!cookieString)
</span><span class="cx">             return false;
</span><del>-        
-        WebCore::setCookies(frame-&gt;document(), url, cookieString);
</del><ins>+
+        auto* document = frame-&gt;document();
+        if (!document)
+            return false;
+
+        WebCore::setCookies(*document, url, cookieString);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacPluginsWebNetscapePluginViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -2127,7 +2127,11 @@
</span><span class="cx">                 break;
</span><span class="cx">             
</span><span class="cx">             if (Frame* frame = core([self webFrame])) {
</span><del>-                String cookieString = cookies(frame-&gt;document(), URL); 
</del><ins>+                auto* document = frame-&gt;document();
+                if (!document)
+                    break;
+
+                String cookieString = cookies(*document, URL);
</ins><span class="cx">                 CString cookieStringUTF8 = cookieString.utf8();
</span><span class="cx">                 if (cookieStringUTF8.isNull())
</span><span class="cx">                     return NPERR_GENERIC_ERROR;
</span><span class="lines">@@ -2177,7 +2181,8 @@
</span><span class="cx">                 break;
</span><span class="cx">             
</span><span class="cx">             if (Frame* frame = core([self webFrame])) {
</span><del>-                setCookies(frame-&gt;document(), URL, cookieString);
</del><ins>+                if (auto* document = frame-&gt;document())
+                    setCookies(*document, URL, cookieString);
</ins><span class="cx">                 return NPERR_NO_ERROR;
</span><span class="cx">             }
</span><span class="cx">             
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebKit/win/ChangeLog        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-08-21  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Use Document&amp; instead of Document* when getting cookies
+        https://bugs.webkit.org/show_bug.cgi?id=161011
+
+        Reviewed by Darin Adler.
+
+        * Plugins/PluginView.cpp:
+        (WebCore::PluginView::getValueForURL):
+
</ins><span class="cx"> 2016-08-16  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename didLayout(LayoutMilestones) to didReachLayoutMilestone(), and related WK2 functions
</span></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/Plugins/PluginView.cpp (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginView.cpp        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebKit/win/Plugins/PluginView.cpp        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -1281,8 +1281,8 @@
</span><span class="cx">         URL u(m_parentFrame-&gt;document()-&gt;baseURL(), url);
</span><span class="cx">         if (u.isValid()) {
</span><span class="cx">             Frame* frame = getFrame(parentFrame(), m_element);
</span><del>-            if (frame) {
-                const CString cookieStr = cookies(frame-&gt;document(), u).utf8();
</del><ins>+            if (frame &amp;&amp; frame-&gt;document()) {
+                const CString cookieStr = cookies(*frame-&gt;document(), u).utf8();
</ins><span class="cx">                 if (!cookieStr.isNull()) {
</span><span class="cx">                     const int size = cookieStr.length();
</span><span class="cx">                     *value = static_cast&lt;char*&gt;(NPN_MemAlloc(size+1));
</span><span class="lines">@@ -1343,8 +1343,8 @@
</span><span class="cx">         if (u.isValid()) {
</span><span class="cx">             const String cookieStr = String::fromUTF8(value, len);
</span><span class="cx">             Frame* frame = getFrame(parentFrame(), m_element);
</span><del>-            if (frame &amp;&amp; !cookieStr.isEmpty())
-                setCookies(frame-&gt;document(), u, cookieStr);
</del><ins>+            if (frame &amp;&amp; frame-&gt;document() &amp;&amp; !cookieStr.isEmpty())
+                setCookies(*frame-&gt;document(), u, cookieStr);
</ins><span class="cx">         } else
</span><span class="cx">             result = NPERR_INVALID_URL;
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebKit2/ChangeLog        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-08-21  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Use Document&amp; instead of Document* when getting cookies
+        https://bugs.webkit.org/show_bug.cgi?id=161011
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
+        (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
+        (WebKit::WebAutomationSessionProxy::deleteCookie):
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::cookiesForURL):
+        (WebKit::PluginView::setCookiesForURL):
+        (WebKit::PluginView::getAuthenticationInfo):
+
</ins><span class="cx"> 2016-08-20  Gyuyoung Kim  &lt;gyuyoung.kim@navercorp.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed EFL build fix since r204668
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -556,9 +556,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // This returns the same list of cookies as when evaluating `document.cookies` in JavaScript.
</span><del>-    WebCore::Document* document = frame-&gt;coreFrame()-&gt;document();
</del><ins>+    auto&amp; document = *frame-&gt;coreFrame()-&gt;document();
</ins><span class="cx">     Vector&lt;WebCore::Cookie&gt; foundCookies;
</span><del>-    WebCore::getRawCookies(document, document-&gt;cookieURL(), foundCookies);
</del><ins>+    WebCore::getRawCookies(document, document.cookieURL(), foundCookies);
</ins><span class="cx"> 
</span><span class="cx">     WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidGetCookiesForFrame(callbackID, foundCookies, String()), 0);
</span><span class="cx"> }
</span><span class="lines">@@ -579,8 +579,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    WebCore::Document* document = frame-&gt;coreFrame()-&gt;document();
-    WebCore::deleteCookie(document, document-&gt;cookieURL(), cookieName);
</del><ins>+    auto&amp; document = *frame-&gt;coreFrame()-&gt;document();
+    WebCore::deleteCookie(document, document.cookieURL(), cookieName);
</ins><span class="cx"> 
</span><span class="cx">     WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::WebAutomationSession::DidDeleteCookie(callbackID, String()), 0);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPluginViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (204701 => 204702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp        2016-08-22 05:42:12 UTC (rev 204701)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp        2016-08-22 06:02:52 UTC (rev 204702)
</span><span class="lines">@@ -1615,12 +1615,12 @@
</span><span class="cx"> 
</span><span class="cx"> String PluginView::cookiesForURL(const String&amp; urlString)
</span><span class="cx"> {
</span><del>-    return cookies(&amp;m_pluginElement-&gt;document(), URL(URL(), urlString));
</del><ins>+    return cookies(m_pluginElement-&gt;document(), URL(URL(), urlString));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PluginView::setCookiesForURL(const String&amp; urlString, const String&amp; cookieString)
</span><span class="cx"> {
</span><del>-    setCookies(&amp;m_pluginElement-&gt;document(), URL(URL(), urlString), cookieString);
</del><ins>+    setCookies(m_pluginElement-&gt;document(), URL(URL(), urlString), cookieString);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PluginView::getAuthenticationInfo(const ProtectionSpace&amp; protectionSpace, String&amp; username, String&amp; password)
</span></span></pre>
</div>
</div>

</body>
</html>