<!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& instead of Document* when getting cookies
https://bugs.webkit.org/show_bug.cgi?id=161011
Patch by Alex Christensen <achristensen@webkit.org> 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 <achristensen@webkit.org>
</span><span class="cx">
</span><ins>+ Use Document& 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 <achristensen@webkit.org>
+
</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->serverHandshakeResponse());
</span><span class="cx"> if (!m_handshake->serverSetCookie().isEmpty()) {
</span><del>- if (cookiesEnabled(m_document)) {
</del><ins>+ if (m_document && cookiesEnabled(*m_document)) {
</ins><span class="cx"> // Exception (for sandboxed documents) ignored.
</span><span class="cx"> m_document->setCookie(m_handshake->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("Sec-WebSocket-Protocol: " + 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 && m_document) {
+ String cookie = cookieRequestHeaderFieldValue(*m_document, url);
</ins><span class="cx"> if (!cookie.isEmpty())
</span><span class="cx"> fields.append("Cookie: " + 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 && 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& url, Vector<Cookie>& cookies) const
</span><span class="cx"> {
</span><del>- return getRawCookies(&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 = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
</span><span class="cx"> Document* document = frame->document();
</span><ins>+ if (!document)
+ continue;
</ins><span class="cx">
</span><span class="cx"> for (auto& url : allResourcesURLsForFrame(frame)) {
</span><span class="cx"> Vector<Cookie> 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&, const String& cookieName, const String& url)
</span><span class="cx"> {
</span><span class="cx"> URL parsedURL(ParsedURLString, url);
</span><del>- for (Frame* frame = &m_page.mainFrame(); frame; frame = frame->tree().traverseNext())
- WebCore::deleteCookie(frame->document(), parsedURL, cookieName);
</del><ins>+ for (Frame* frame = &m_page.mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ if (auto* document = frame->document())
+ WebCore::deleteCookie(*document, parsedURL, cookieName);
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorPageAgent::getResourceTree(ErrorString&, RefPtr<Inspector::Protocol::Page::FrameResourceTree>& 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& 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->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->loader().networkingContext();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline NetworkStorageSession& storageSession(const Document* document)
</del><ins>+inline NetworkStorageSession& storageSession(const Document& document)
</ins><span class="cx"> {
</span><span class="cx"> NetworkingContext* context = networkingContext(document);
</span><span class="cx"> return context ? context->storageSession() : NetworkStorageSession::defaultStorageSession();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String cookies(const Document* document, const URL& url)
</del><ins>+String cookies(const Document& document, const URL& url)
</ins><span class="cx"> {
</span><del>- return platformStrategies()->cookiesStrategy()->cookiesForDOM(storageSession(document), document->firstPartyForCookies(), url);
</del><ins>+ return platformStrategies()->cookiesStrategy()->cookiesForDOM(storageSession(document), document.firstPartyForCookies(), url);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void setCookies(Document* document, const URL& url, const String& cookieString)
</del><ins>+void setCookies(Document& document, const URL& url, const String& cookieString)
</ins><span class="cx"> {
</span><del>- platformStrategies()->cookiesStrategy()->setCookiesFromDOM(storageSession(document), document->firstPartyForCookies(), url, cookieString);
</del><ins>+ platformStrategies()->cookiesStrategy()->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& document)
</ins><span class="cx"> {
</span><del>- return platformStrategies()->cookiesStrategy()->cookiesEnabled(storageSession(document), document->firstPartyForCookies(), document->cookieURL());
</del><ins>+ return platformStrategies()->cookiesStrategy()->cookiesEnabled(storageSession(document), document.firstPartyForCookies(), document.cookieURL());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-String cookieRequestHeaderFieldValue(const Document* document, const URL& url)
</del><ins>+String cookieRequestHeaderFieldValue(const Document& document, const URL& url)
</ins><span class="cx"> {
</span><del>- return platformStrategies()->cookiesStrategy()->cookieRequestHeaderFieldValue(storageSession(document), document->firstPartyForCookies(), url);
</del><ins>+ return platformStrategies()->cookiesStrategy()->cookieRequestHeaderFieldValue(storageSession(document), document.firstPartyForCookies(), url);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool getRawCookies(const Document* document, const URL& url, Vector<Cookie>& cookies)
</del><ins>+bool getRawCookies(const Document& document, const URL& url, Vector<Cookie>& cookies)
</ins><span class="cx"> {
</span><del>- return platformStrategies()->cookiesStrategy()->getRawCookies(storageSession(document), document->firstPartyForCookies(), url, cookies);
</del><ins>+ return platformStrategies()->cookiesStrategy()->getRawCookies(storageSession(document), document.firstPartyForCookies(), url, cookies);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void deleteCookie(const Document* document, const URL& url, const String& cookieName)
</del><ins>+void deleteCookie(const Document& document, const URL& url, const String& cookieName)
</ins><span class="cx"> {
</span><span class="cx"> platformStrategies()->cookiesStrategy()->deleteCookie(storageSession(document), url, cookieName);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void addCookie(const Document* document, const URL& url, const Cookie& cookie)
</del><ins>+void addCookie(const Document& document, const URL& url, const Cookie& cookie)
</ins><span class="cx"> {
</span><span class="cx"> platformStrategies()->cookiesStrategy()->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&);
-WEBCORE_EXPORT void setCookies(Document*, const URL&, const String& cookieString);
</del><ins>+WEBCORE_EXPORT String cookies(const Document&, const URL&);
+WEBCORE_EXPORT void setCookies(Document&, const URL&, const String& cookieString);
</ins><span class="cx">
</span><del>-WEBCORE_EXPORT bool cookiesEnabled(const Document*);
-WEBCORE_EXPORT String cookieRequestHeaderFieldValue(const Document*, const URL&);
-WEBCORE_EXPORT bool getRawCookies(const Document*, const URL&, Vector<Cookie>&);
-WEBCORE_EXPORT void deleteCookie(const Document*, const URL&, const String& cookieName);
-WEBCORE_EXPORT void addCookie(const Document*, const URL&, const Cookie&);
</del><ins>+WEBCORE_EXPORT bool cookiesEnabled(const Document&);
+WEBCORE_EXPORT String cookieRequestHeaderFieldValue(const Document&, const URL&);
+WEBCORE_EXPORT bool getRawCookies(const Document&, const URL&, Vector<Cookie>&);
+WEBCORE_EXPORT void deleteCookie(const Document&, const URL&, const String& cookieName);
+WEBCORE_EXPORT void addCookie(const Document&, const URL&, const Cookie&);
</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->page() && !m_frame->page()->settings().cookieEnabled())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- return cookiesEnabled(m_frame->document());
</del><ins>+ auto* document = m_frame->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 <achristensen@webkit.org>
+
+ Use Document& 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 <simon.fraser@apple.com>
</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->document(), url);
</del><ins>+ auto* document = frame->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->document(), url, cookieString);
</del><ins>+
+ auto* document = frame->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->document(), URL);
</del><ins>+ auto* document = frame->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->document(), URL, cookieString);
</del><ins>+ if (auto* document = frame->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 <achristensen@webkit.org>
+
+ Use Document& 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 <simon.fraser@apple.com>
</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->document()->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->document(), u).utf8();
</del><ins>+ if (frame && frame->document()) {
+ const CString cookieStr = cookies(*frame->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<char*>(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 && !cookieStr.isEmpty())
- setCookies(frame->document(), u, cookieStr);
</del><ins>+ if (frame && frame->document() && !cookieStr.isEmpty())
+ setCookies(*frame->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 <achristensen@webkit.org>
+
+ Use Document& 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 <gyuyoung.kim@navercorp.com>
</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->coreFrame()->document();
</del><ins>+ auto& document = *frame->coreFrame()->document();
</ins><span class="cx"> Vector<WebCore::Cookie> foundCookies;
</span><del>- WebCore::getRawCookies(document, document->cookieURL(), foundCookies);
</del><ins>+ WebCore::getRawCookies(document, document.cookieURL(), foundCookies);
</ins><span class="cx">
</span><span class="cx"> WebProcess::singleton().parentProcessConnection()->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->coreFrame()->document();
- WebCore::deleteCookie(document, document->cookieURL(), cookieName);
</del><ins>+ auto& document = *frame->coreFrame()->document();
+ WebCore::deleteCookie(document, document.cookieURL(), cookieName);
</ins><span class="cx">
</span><span class="cx"> WebProcess::singleton().parentProcessConnection()->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& urlString)
</span><span class="cx"> {
</span><del>- return cookies(&m_pluginElement->document(), URL(URL(), urlString));
</del><ins>+ return cookies(m_pluginElement->document(), URL(URL(), urlString));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PluginView::setCookiesForURL(const String& urlString, const String& cookieString)
</span><span class="cx"> {
</span><del>- setCookies(&m_pluginElement->document(), URL(URL(), urlString), cookieString);
</del><ins>+ setCookies(m_pluginElement->document(), URL(URL(), urlString), cookieString);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool PluginView::getAuthenticationInfo(const ProtectionSpace& protectionSpace, String& username, String& password)
</span></span></pre>
</div>
</div>
</body>
</html>