<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#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>
<title>[28503] trunk/WebKit</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/28503">28503</a></dd>
<dt>Author</dt> <dd>aroben@apple.com</dd>
<dt>Date</dt> <dd>2007-12-06 17:04:43 -0800 (Thu, 06 Dec 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix &lt;rdar://5615283&gt; Crash in WebFrame::receivedPolicyDecision

WebKit/mac:

        Remove some assertions we know can fire and replace them with a FIXME

        Reviewed by Anders.

        * WebCoreSupport/WebFrameLoaderClient.mm:

WebKit/win:

        Fix &lt;rdar://5615283&gt; Crash in WebFrame::receivedPolicyDecision

        It's possible for a second policy listener to be created while we're
        waiting for a decision on the first policy listener. In this case we
        would crash when the first policy listener had a decision made. Mac
        WebKit already handles this by invalidating any existing policy
        listener when creating a new one.

        A test case is coming in a future commit.

        Reviewed by Anders.

        * WebFrame.cpp:
        (WebFrame::setUpPolicyListener): Copy the Mac behavior of invalidating
        any existing policy listener, and remove some assertions that we know
        can fire.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebFrameLoaderClientmm">trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm</a></li>
<li><a href="#trunkWebKitwinChangeLog">trunk/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkWebKitwinWebFramecpp">trunk/WebKit/win/WebFrame.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (28502 => 28503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2007-12-07 00:50:32 UTC (rev 28502)
+++ trunk/WebKit/mac/ChangeLog        2007-12-07 01:04:43 UTC (rev 28503)
</span><span class="lines">@@ -1,3 +1,11 @@
</span><ins>+2007-12-06  Adam Roben  &lt;aroben@apple.com&gt;
+
+        Remove some assertions we know can fire and replace them with a FIXME
+
+        Reviewed by Anders.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+
</ins><span class="cx"> 2007-12-06  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Change the ASSERT added for the previous fix. The ASSERT was firing for 10.5.0.
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebFrameLoaderClientmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (28502 => 28503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2007-12-07 00:50:32 UTC (rev 28502)
+++ trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2007-12-07 01:04:43 UTC (rev 28503)
</span><span class="lines">@@ -1060,8 +1060,7 @@
</span><span class="cx"> 
</span><span class="cx"> RetainPtr&lt;WebFramePolicyListener&gt; WebFrameLoaderClient::setUpPolicyListener(FramePolicyFunction function)
</span><span class="cx"> {
</span><del>-    ASSERT(!m_policyListener);
-    ASSERT(!m_policyFunction);
</del><ins>+    // FIXME: &lt;rdar://5634381&gt; We need to support multiple active policy listeners.
</ins><span class="cx"> 
</span><span class="cx">     [m_policyListener.get() invalidate];
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/ChangeLog (28502 => 28503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/ChangeLog        2007-12-07 00:50:32 UTC (rev 28502)
+++ trunk/WebKit/win/ChangeLog        2007-12-07 01:04:43 UTC (rev 28503)
</span><span class="lines">@@ -1,5 +1,24 @@
</span><span class="cx"> 2007-12-06  Adam Roben  &lt;aroben@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Fix &lt;rdar://5615283&gt; Crash in WebFrame::receivedPolicyDecision
+
+        It's possible for a second policy listener to be created while we're
+        waiting for a decision on the first policy listener. In this case we
+        would crash when the first policy listener had a decision made. Mac
+        WebKit already handles this by invalidating any existing policy
+        listener when creating a new one.
+
+        A test case is coming in a future commit.
+
+        Reviewed by Anders.
+
+        * WebFrame.cpp:
+        (WebFrame::setUpPolicyListener): Copy the Mac behavior of invalidating
+        any existing policy listener, and remove some assertions that we know
+        can fire.
+
+2007-12-06  Adam Roben  &lt;aroben@apple.com&gt;
+
</ins><span class="cx">         Add SPI so that DumpRenderTree can turn on the Mac font ascent hack
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Hyatt.
</span></span></pre></div>
<a id="trunkWebKitwinWebFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebFrame.cpp (28502 => 28503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebFrame.cpp        2007-12-07 00:50:32 UTC (rev 28502)
+++ trunk/WebKit/win/WebFrame.cpp        2007-12-07 01:04:43 UTC (rev 28503)
</span><span class="lines">@@ -1985,9 +1985,11 @@
</span><span class="cx"> 
</span><span class="cx"> COMPtr&lt;WebFramePolicyListener&gt; WebFrame::setUpPolicyListener(WebCore::FramePolicyFunction function)
</span><span class="cx"> {
</span><del>-    ASSERT(!d-&gt;m_policyListener);
-    ASSERT(!d-&gt;m_policyFunction);
</del><ins>+    // FIXME: &lt;rdar://5634381&gt; We need to support multiple active policy listeners.
</ins><span class="cx"> 
</span><ins>+    if (d-&gt;m_policyListener)
+        d-&gt;m_policyListener-&gt;invalidate();
+
</ins><span class="cx">     Frame* coreFrame = core(this);
</span><span class="cx">     ASSERT(coreFrame);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>