<!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>[28822] trunk/WebKit/win</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/28822">28822</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2007-12-17 17:30:07 -0800 (Mon, 17 Dec 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Reviewed by Sam.

        - &lt;rdar://4516170&gt; Back/Forward Cache on Windows

        * WebFrame.cpp:
        (WebFrame::forceLayout): Implemented this. Just calling through to
        Frame::forceLayout matches the Mac pretty well and should be enough
        for now. Without this we won't repaint the new page when we go back
        and forward.
        (WebFrame::dispatchWillSubmitForm): Use COMPtr's AdoptCOM constructor
        instead of the adoptRef function.
        (WebFrame::restoreViewState): Removed unneeded notImplemented() call.
        This is implemented as much as it needs to be.
        (WebFrame::shouldGoToHistoryItem): Ditto.
        (WebFrame::saveViewStateToItem): Ditto.
        (WebFrame::canCachePage): Ditto, also changed it to return true. This
        is what was preventing the back/forward cache from running, and there's
        no need for any additional checks in the Windows version.

        * WebView.cpp:
        (PreferencesChangedOrRemovedObserver::onNotify): Fix backwards null check
        that was preventing this notification from ever being sent, which in turn
        meant that page cache had a capacity of 0.
        (WebView::initWithFrame): Removed unneeded setUsesPageCache(false) code.
        This actually was ineffective and ended up doing no harm, but we don't
        need it.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitwinChangeLog">trunk/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkWebKitwinWebFramecpp">trunk/WebKit/win/WebFrame.cpp</a></li>
<li><a href="#trunkWebKitwinWebViewcpp">trunk/WebKit/win/WebView.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/ChangeLog (28821 => 28822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/ChangeLog        2007-12-17 23:10:21 UTC (rev 28821)
+++ trunk/WebKit/win/ChangeLog        2007-12-18 01:30:07 UTC (rev 28822)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2007-12-17  Darin Adler  &lt;darin@apple.com&gt;
+
+        Reviewed by Sam.
+
+        - &lt;rdar://4516170&gt; Back/Forward Cache on Windows
+
+        * WebFrame.cpp:
+        (WebFrame::forceLayout): Implemented this. Just calling through to
+        Frame::forceLayout matches the Mac pretty well and should be enough
+        for now. Without this we won't repaint the new page when we go back
+        and forward.
+        (WebFrame::dispatchWillSubmitForm): Use COMPtr's AdoptCOM constructor
+        instead of the adoptRef function.
+        (WebFrame::restoreViewState): Removed unneeded notImplemented() call.
+        This is implemented as much as it needs to be.
+        (WebFrame::shouldGoToHistoryItem): Ditto.
+        (WebFrame::saveViewStateToItem): Ditto.
+        (WebFrame::canCachePage): Ditto, also changed it to return true. This
+        is what was preventing the back/forward cache from running, and there's
+        no need for any additional checks in the Windows version.
+
+        * WebView.cpp:
+        (PreferencesChangedOrRemovedObserver::onNotify): Fix backwards null check
+        that was preventing this notification from ever being sent, which in turn
+        meant that page cache had a capacity of 0.
+        (WebView::initWithFrame): Removed unneeded setUsesPageCache(false) code.
+        This actually was ineffective and ended up doing no harm, but we don't
+        need it.
+
</ins><span class="cx"> 2007-12-16  Alexey Proskuryakov  &lt;ap@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin.
</span></span></pre></div>
<a id="trunkWebKitwinWebFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebFrame.cpp (28821 => 28822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebFrame.cpp        2007-12-17 23:10:21 UTC (rev 28821)
+++ trunk/WebKit/win/WebFrame.cpp        2007-12-18 01:30:07 UTC (rev 28822)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -1501,7 +1501,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebFrame::forceLayout()
</span><span class="cx"> {
</span><del>-    notImplemented();
</del><ins>+    core(this)-&gt;forceLayout(true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebFrame::forceLayoutForNonHTML()
</span><span class="lines">@@ -1646,8 +1646,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    COMPtr&lt;IDOMElement&gt; formElement;
-    formElement.adoptRef(DOMElement::createInstance(formState-&gt;form()));
</del><ins>+    COMPtr&lt;IDOMElement&gt; formElement(AdoptCOM, DOMElement::createInstance(formState-&gt;form()));
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: The FormValuesPropertyBag constructor should take a const pointer
</span><span class="cx">     FormValuesPropertyBag formValuesPropBag(const_cast&lt;HashMap&lt;String, String&gt;*&gt;(&amp;formState-&gt;values()));
</span><span class="lines">@@ -1771,8 +1770,6 @@
</span><span class="cx"> 
</span><span class="cx"> void WebFrame::restoreViewState()
</span><span class="cx"> {
</span><del>-    // FIXME: Need to restore view state for page caching
-    notImplemented();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebFrame::provisionalLoadStarted()
</span><span class="lines">@@ -1891,20 +1888,16 @@
</span><span class="cx"> 
</span><span class="cx"> bool WebFrame::shouldGoToHistoryItem(HistoryItem*) const
</span><span class="cx"> {
</span><del>-    notImplemented();
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebFrame::saveViewStateToItem(HistoryItem*)
</span><span class="cx"> {
</span><del>-    // FIXME: Need to save view state for page caching
-    notImplemented();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebFrame::canCachePage() const
</span><span class="cx"> {
</span><del>-    notImplemented();
-    return false;
</del><ins>+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;DocumentLoader&gt; WebFrame::createDocumentLoader(const ResourceRequest&amp; request, const SubstituteData&amp; substituteData)
</span></span></pre></div>
<a id="trunkWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebView.cpp (28821 => 28822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebView.cpp        2007-12-17 23:10:21 UTC (rev 28821)
+++ trunk/WebKit/win/WebView.cpp        2007-12-18 01:30:07 UTC (rev 28822)
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx">         return hr;
</span><span class="cx"> 
</span><span class="cx">     COMPtr&lt;IWebPreferences&gt; preferences(Query, unkPrefs);
</span><del>-    if (preferences)
</del><ins>+    if (!preferences)
</ins><span class="cx">         return E_NOINTERFACE;
</span><span class="cx"> 
</span><span class="cx">     WebCacheModel cacheModel;
</span><span class="lines">@@ -2033,9 +2033,6 @@
</span><span class="cx">     WebKitSetWebDatabasesPathIfNecessary();
</span><span class="cx"> 
</span><span class="cx">     m_page = new Page(new WebChromeClient(this), new WebContextMenuClient(this), new WebEditorClient(this), new WebDragClient(this), new WebInspectorClient(this));
</span><del>-    // FIXME: 4931464 - When we do cache pages on Windows this needs to be removed so the &quot;should I cache this page?&quot; check
-    // in FrameLoader::provisionalLoadStarted() doesn't always fail
-    m_page-&gt;settings()-&gt;setUsesPageCache(false);
</del><span class="cx"> 
</span><span class="cx">     if (m_uiDelegate) {
</span><span class="cx">         COMPtr&lt;IWebUIDelegate2&gt; uiDelegate2;
</span></span></pre>
</div>
</div>

</body>
</html>