[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-changes
Subject:    [webkit-changes] [158370] trunk/Source/WebKit/win
From:       paroga () webkit ! org
Date:       2013-10-31 18:02:54
Message-ID: 20131031180254.84386303A03 () svn ! webkit ! org
[Download RAW message or body]

[Attachment #2 (text/html)]

<!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>[158370] trunk/Source/WebKit/win</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/158370">158370</a></dd> \
<dt>Author</dt> <dd>paroga@webkit.org</dd> <dt>Date</dt> <dd>2013-10-31 11:02:54 \
-0700 (Thu, 31 Oct 2013)</dd> </dl>

<h3>Log Message</h3>
<pre>[WIN] Make WebHistory compile without USE(CF)
https://bugs.webkit.org/show_bug.cgi?id=122010

Reviewed by Brent Fulgham.

Add an alternative code path for !USE(CF) to be able to
compile WebHistory without the CoreFoundation library.

* COMVariantSetter.h: Add support for setting a Vector.
* WebHistory.cpp:
(createUserInfoFromArray):
(createUserInfoFromHistoryItem):
(WebHistory::removeAllItems):
(WebHistory::removeItem):
(WebHistory::addItem):
(WebHistory::visitedURL):
* WebHistory.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitwinCOMVariantSetterh">trunk/Source/WebKit/win/COMVariantSetter.h</a></li>
 <li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
 <li><a href="#trunkSourceWebKitwinWebHistorycpp">trunk/Source/WebKit/win/WebHistory.cpp</a></li>
 <li><a href="#trunkSourceWebKitwinWebHistoryh">trunk/Source/WebKit/win/WebHistory.h</a></li>
 </ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitwinCOMVariantSetterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/COMVariantSetter.h (158369 \
=> 158370)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/COMVariantSetter.h	2013-10-31 17:48:33 \
                UTC (rev 158369)
+++ trunk/Source/WebKit/win/COMVariantSetter.h	2013-10-31 18:02:54 UTC (rev 158370)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &lt;WebCore/COMPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><ins>+#include &lt;wtf/Vector.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; struct COMVariantSetter {};
</span><span class="cx"> 
</span><span class="lines">@@ -120,6 +121,24 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;typename T&gt; struct \
COMVariantSetter&lt;Vector&lt;T&gt;&gt; : COMVariantSetterBase&lt;Vector&lt;T&gt;&gt; \
{ +    static const VARTYPE VariantType = VT_ARRAY | \
COMVariantSetter&lt;T&gt;::VariantType; +
+    static void setVariant(VARIANT* variant, const Vector&lt;T&gt;&amp; value)
+    {
+        ASSERT(V_VT(variant) == VT_EMPTY);
+
+        SAFEARRAY* safeArray = \
::SafeArrayCreateVector(COMVariantSetter&lt;T&gt;::VariantType, 0, value.size()); +   \
for (LONG i = 0; i &lt; value.size(); ++i) { +            COMVariant item(value[i]);
+            ::SafeArrayPutElement(safeArray, &amp;i, &amp;item);
+        }
+
+        V_VT(variant) = VariantType;
+        V_ARRAY(variant) = safeArray;
+    }
+};
+
</ins><span class="cx"> template&lt;typename COMType, typename UnderlyingType&gt;
</span><span class="cx"> struct COMIUnknownVariantSetter : \
COMVariantSetterBase&lt;UnderlyingType&gt; </span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (158369 => \
158370)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog	2013-10-31 17:48:33 UTC (rev \
                158369)
+++ trunk/Source/WebKit/win/ChangeLog	2013-10-31 18:02:54 UTC (rev 158370)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2013-10-31  Patrick Gansterer  &lt;paroga@webkit.org&gt;
+
+        [WIN] Make WebHistory compile without USE(CF)
+        https://bugs.webkit.org/show_bug.cgi?id=122010
+
+        Reviewed by Brent Fulgham.
+
+        Add an alternative code path for !USE(CF) to be able to
+        compile WebHistory without the CoreFoundation library.
+
+        * COMVariantSetter.h: Add support for setting a Vector.
+        * WebHistory.cpp:
+        (createUserInfoFromArray):
+        (createUserInfoFromHistoryItem):
+        (WebHistory::removeAllItems):
+        (WebHistory::removeItem):
+        (WebHistory::addItem):
+        (WebHistory::visitedURL):
+        * WebHistory.h:
+
</ins><span class="cx"> 2013-10-30  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebKit/win/WebKitGraphics.h:void \
WebDrawText(WebTextRenderInfo*); is never called </span></span></pre></div>
<a id="trunkSourceWebKitwinWebHistorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebHistory.cpp (158369 => \
158370)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebHistory.cpp	2013-10-31 17:48:33 UTC \
                (rev 158369)
+++ trunk/Source/WebKit/win/WebHistory.cpp	2013-10-31 18:02:54 UTC (rev 158370)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include &quot;WebKitDLL.h&quot;
</span><span class="cx"> #include &quot;WebHistory.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;CFDictionaryPropertyBag.h&quot;
</del><span class="cx"> #include &quot;MemoryStream.h&quot;
</span><span class="cx"> #include &quot;WebKit.h&quot;
</span><span class="cx"> #include &quot;MarshallingHelpers.h&quot;
</span><span class="lines">@@ -35,7 +34,6 @@
</span><span class="cx"> #include &quot;WebKit.h&quot;
</span><span class="cx"> #include &quot;WebNotificationCenter.h&quot;
</span><span class="cx"> #include &quot;WebPreferences.h&quot;
</span><del>-#include &lt;CoreFoundation/CoreFoundation.h&gt;
</del><span class="cx"> #include &lt;WebCore/BString.h&gt;
</span><span class="cx"> #include &lt;WebCore/HistoryItem.h&gt;
</span><span class="cx"> #include &lt;WebCore/URL.h&gt;
</span><span class="lines">@@ -46,6 +44,13 @@
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+#if USE(CF)
+#include &quot;CFDictionaryPropertyBag.h&quot;
+#include &lt;CoreFoundation/CoreFoundation.h&gt;
+#else
+#include &quot;COMPropertyBag.h&quot;
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace std;
</span><span class="cx"> 
</span><span class="lines">@@ -55,25 +60,36 @@
</span><span class="cx">     return (diff &lt; .000001 &amp;&amp; diff &gt; \
-.000001); </span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static COMPtr&lt;CFDictionaryPropertyBag&gt; \
createUserInfoFromArray(BSTR notificationStr, CFArrayRef arrayItem) \
</del><ins>+static COMPtr&lt;IPropertyBag&gt; createUserInfoFromArray(BSTR \
notificationStr, IWebHistoryItem** data, size_t size) </ins><span class="cx"> {
</span><ins>+#if USE(CF)
+    RetainPtr&lt;CFArrayRef&gt; arrayItem = \
adoptCF(CFArrayCreate(kCFAllocatorDefault, (const void**)data, size, \
&amp;MarshallingHelpers::kIUnknownArrayCallBacks)); +
</ins><span class="cx">     RetainPtr&lt;CFMutableDictionaryRef&gt; dictionary = \
adoptCF( </span><span class="cx">         CFDictionaryCreateMutable(0, 0, \
&amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks)); \
</span><span class="cx">  </span><span class="cx">     RetainPtr&lt;CFStringRef&gt; \
key = adoptCF(MarshallingHelpers::BSTRToCFStringRef(notificationStr)); </span><del>-  \
CFDictionaryAddValue(dictionary.get(), key.get(), arrayItem); </del><ins>+    \
CFDictionaryAddValue(dictionary.get(), key.get(), arrayItem.get()); </ins><span \
class="cx">  </span><span class="cx">     COMPtr&lt;CFDictionaryPropertyBag&gt; \
result = CFDictionaryPropertyBag::createInstance(); </span><span class="cx">     \
result-&gt;setDictionary(dictionary.get()); </span><del>-    return result;
</del><ins>+    return COMPtr&lt;IPropertyBag&gt;(AdoptCOM, result.leakRef());
+#else
+    Vector&lt;COMPtr&lt;IWebHistoryItem&gt;, 1&gt; arrayItem;
+    arrayItem.reserveInitialCapacity(size);
+    for (size_t i = 0; i &lt; size; ++i)
+        arrayItem[i] = data[i];
+
+    HashMap&lt;String, Vector&lt;COMPtr&lt;IWebHistoryItem&gt;&gt;&gt; dictionary;
+    String key(notificationStr, ::SysStringLen(notificationStr));
+    dictionary.set(key, std::move(arrayItem));
+    return COMPtr&lt;IPropertyBag&gt;(AdoptCOM, \
COMPropertyBag&lt;Vector&lt;COMPtr&lt;IWebHistoryItem&gt;&gt;&gt;::adopt(dictionary));
 +#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static COMPtr&lt;CFDictionaryPropertyBag&gt; \
createUserInfoFromHistoryItem(BSTR notificationStr, IWebHistoryItem* item) \
</del><ins>+static inline COMPtr&lt;IPropertyBag&gt; \
createUserInfoFromHistoryItem(BSTR notificationStr, IWebHistoryItem* item) \
</ins><span class="cx"> { </span><del>-    // reference counting of item added to the \
                array is managed by the CFArray value callbacks
-    RetainPtr&lt;CFArrayRef&gt; itemList = adoptCF(CFArrayCreate(0, (const void**) \
                &amp;item, 1, &amp;MarshallingHelpers::kIUnknownArrayCallBacks));
-    COMPtr&lt;CFDictionaryPropertyBag&gt; info = \
                createUserInfoFromArray(notificationStr, itemList.get());
-    return info;
</del><ins>+    return createUserInfoFromArray(notificationStr, &amp;item, 1);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline void addDayToSystemTime(SYSTEMTIME&amp; \
systemTime) </span><span class="lines">@@ -306,13 +322,12 @@
</span><span class="cx">     \
itemsVector.reserveInitialCapacity(m_entriesByURL.size()); </span><span class="cx">   \
for (auto it = m_entriesByURL.begin(); it != m_entriesByURL.end(); ++it) </span><span \
class="cx">         itemsVector.append(it-&gt;value.get()); </span><del>-    \
RetainPtr&lt;CFArrayRef&gt; allItems = adoptCF(CFArrayCreate(kCFAllocatorDefault, \
(const void**)itemsVector.data(), itemsVector.size(), \
&amp;MarshallingHelpers::kIUnknownArrayCallBacks)); </del><ins>+    \
COMPtr&lt;IPropertyBag&gt; userInfo = \
createUserInfoFromArray(getNotificationString(kWebHistoryAllItemsRemovedNotification), \
itemsVector.data(), itemsVector.size()); </ins><span class="cx"> 
</span><span class="cx">     m_entriesByURL.clear();
</span><span class="cx"> 
</span><span class="cx">     PageGroup::removeAllVisitedLinks();
</span><span class="cx"> 
</span><del>-    COMPtr&lt;CFDictionaryPropertyBag&gt; userInfo = \
createUserInfoFromArray(getNotificationString(kWebHistoryAllItemsRemovedNotification), \
allItems.get()); </del><span class="cx">     return \
postNotification(kWebHistoryAllItemsRemovedNotification, userInfo.get()); \
</span><span class="cx"> } </span><span class="cx"> 
</span><span class="lines">@@ -472,7 +487,7 @@
</span><span class="cx">     if (FAILED(hr))
</span><span class="cx">         return hr;
</span><span class="cx"> 
</span><del>-    COMPtr&lt;CFDictionaryPropertyBag&gt; userInfo = \
createUserInfoFromHistoryItem( </del><ins>+    COMPtr&lt;IPropertyBag&gt; userInfo = \
createUserInfoFromHistoryItem( </ins><span class="cx">         \
getNotificationString(kWebHistoryItemsRemovedNotification), entry); </span><span \
class="cx">     hr = postNotification(kWebHistoryItemsRemovedNotification, \
userInfo.get()); </span><span class="cx"> 
</span><span class="lines">@@ -520,7 +535,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_entriesByURL.set(urlString, entry);
</span><span class="cx"> 
</span><del>-    COMPtr&lt;CFDictionaryPropertyBag&gt; userInfo = \
createUserInfoFromHistoryItem( </del><ins>+    COMPtr&lt;IPropertyBag&gt; userInfo = \
createUserInfoFromHistoryItem( </ins><span class="cx">         \
getNotificationString(kWebHistoryItemsAddedNotification), entry); </span><span \
class="cx">     hr = postNotification(kWebHistoryItemsAddedNotification, \
userInfo.get()); </span><span class="cx"> 
</span><span class="lines">@@ -576,7 +591,7 @@
</span><span class="cx">     COMPtr&lt;WebHistoryItem&gt; item(Query, entry);
</span><span class="cx">     item-&gt;historyItem()-&gt;setRedirectURLs(nullptr);
</span><span class="cx"> 
</span><del>-    COMPtr&lt;CFDictionaryPropertyBag&gt; userInfo = \
createUserInfoFromHistoryItem( </del><ins>+    COMPtr&lt;IPropertyBag&gt; userInfo = \
createUserInfoFromHistoryItem( </ins><span class="cx">         \
getNotificationString(kWebHistoryItemsAddedNotification), entry); </span><span \
class="cx">     postNotification(kWebHistoryItemsAddedNotification, userInfo.get()); \
</span><span class="cx"> } </span></span></pre></div>
<a id="trunkSourceWebKitwinWebHistoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebHistory.h (158369 => \
158370)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebHistory.h	2013-10-31 17:48:33 UTC \
                (rev 158369)
+++ trunk/Source/WebKit/win/WebHistory.h	2013-10-31 18:02:54 UTC (rev 158370)
</span><span class="lines">@@ -27,11 +27,9 @@
</span><span class="cx"> #define WebHistory_H
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebKit.h&quot;
</span><del>-#include &lt;CoreFoundation/CoreFoundation.h&gt;
</del><span class="cx"> #include &lt;WebCore/COMPtr.h&gt;
</span><span class="cx"> #include &lt;memory&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><del>-#include &lt;wtf/RetainPtr.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     class URL;
</span></span></pre>
</div>
</div>

</body>
</html>



_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic