[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 <WebCore/COMPtr.h>
</span><span class="cx"> #include <wtf/Assertions.h>
</span><span class="cx"> #include <wtf/Forward.h>
</span><ins>+#include <wtf/Vector.h>
</ins><span class="cx">
</span><span class="cx"> template<typename T> 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<typename T> struct \
COMVariantSetter<Vector<T>> : COMVariantSetterBase<Vector<T>> \
{ + static const VARTYPE VariantType = VT_ARRAY | \
COMVariantSetter<T>::VariantType; +
+ static void setVariant(VARIANT* variant, const Vector<T>& value)
+ {
+ ASSERT(V_VT(variant) == VT_EMPTY);
+
+ SAFEARRAY* safeArray = \
::SafeArrayCreateVector(COMVariantSetter<T>::VariantType, 0, value.size()); + \
for (LONG i = 0; i < value.size(); ++i) { + COMVariant item(value[i]);
+ ::SafeArrayPutElement(safeArray, &i, &item);
+ }
+
+ V_VT(variant) = VariantType;
+ V_ARRAY(variant) = safeArray;
+ }
+};
+
</ins><span class="cx"> template<typename COMType, typename UnderlyingType>
</span><span class="cx"> struct COMIUnknownVariantSetter : \
COMVariantSetterBase<UnderlyingType> </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 <paroga@webkit.org>
+
+ [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 <mmaxfield@apple.com>
</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 "WebKitDLL.h"
</span><span class="cx"> #include "WebHistory.h"
</span><span class="cx">
</span><del>-#include "CFDictionaryPropertyBag.h"
</del><span class="cx"> #include "MemoryStream.h"
</span><span class="cx"> #include "WebKit.h"
</span><span class="cx"> #include "MarshallingHelpers.h"
</span><span class="lines">@@ -35,7 +34,6 @@
</span><span class="cx"> #include "WebKit.h"
</span><span class="cx"> #include "WebNotificationCenter.h"
</span><span class="cx"> #include "WebPreferences.h"
</span><del>-#include <CoreFoundation/CoreFoundation.h>
</del><span class="cx"> #include <WebCore/BString.h>
</span><span class="cx"> #include <WebCore/HistoryItem.h>
</span><span class="cx"> #include <WebCore/URL.h>
</span><span class="lines">@@ -46,6 +44,13 @@
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><ins>+#if USE(CF)
+#include "CFDictionaryPropertyBag.h"
+#include <CoreFoundation/CoreFoundation.h>
+#else
+#include "COMPropertyBag.h"
+#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 < .000001 && diff > \
-.000001); </span><span class="cx"> }
</span><span class="cx">
</span><del>-static COMPtr<CFDictionaryPropertyBag> \
createUserInfoFromArray(BSTR notificationStr, CFArrayRef arrayItem) \
</del><ins>+static COMPtr<IPropertyBag> createUserInfoFromArray(BSTR \
notificationStr, IWebHistoryItem** data, size_t size) </ins><span class="cx"> {
</span><ins>+#if USE(CF)
+ RetainPtr<CFArrayRef> arrayItem = \
adoptCF(CFArrayCreate(kCFAllocatorDefault, (const void**)data, size, \
&MarshallingHelpers::kIUnknownArrayCallBacks)); +
</ins><span class="cx"> RetainPtr<CFMutableDictionaryRef> dictionary = \
adoptCF( </span><span class="cx"> CFDictionaryCreateMutable(0, 0, \
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); \
</span><span class="cx"> </span><span class="cx"> RetainPtr<CFStringRef> \
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<CFDictionaryPropertyBag> \
result = CFDictionaryPropertyBag::createInstance(); </span><span class="cx"> \
result->setDictionary(dictionary.get()); </span><del>- return result;
</del><ins>+ return COMPtr<IPropertyBag>(AdoptCOM, result.leakRef());
+#else
+ Vector<COMPtr<IWebHistoryItem>, 1> arrayItem;
+ arrayItem.reserveInitialCapacity(size);
+ for (size_t i = 0; i < size; ++i)
+ arrayItem[i] = data[i];
+
+ HashMap<String, Vector<COMPtr<IWebHistoryItem>>> dictionary;
+ String key(notificationStr, ::SysStringLen(notificationStr));
+ dictionary.set(key, std::move(arrayItem));
+ return COMPtr<IPropertyBag>(AdoptCOM, \
COMPropertyBag<Vector<COMPtr<IWebHistoryItem>>>::adopt(dictionary));
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static COMPtr<CFDictionaryPropertyBag> \
createUserInfoFromHistoryItem(BSTR notificationStr, IWebHistoryItem* item) \
</del><ins>+static inline COMPtr<IPropertyBag> \
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<CFArrayRef> itemList = adoptCF(CFArrayCreate(0, (const void**) \
&item, 1, &MarshallingHelpers::kIUnknownArrayCallBacks));
- COMPtr<CFDictionaryPropertyBag> info = \
createUserInfoFromArray(notificationStr, itemList.get());
- return info;
</del><ins>+ return createUserInfoFromArray(notificationStr, &item, 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline void addDayToSystemTime(SYSTEMTIME& \
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->value.get()); </span><del>- \
RetainPtr<CFArrayRef> allItems = adoptCF(CFArrayCreate(kCFAllocatorDefault, \
(const void**)itemsVector.data(), itemsVector.size(), \
&MarshallingHelpers::kIUnknownArrayCallBacks)); </del><ins>+ \
COMPtr<IPropertyBag> 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<CFDictionaryPropertyBag> 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<CFDictionaryPropertyBag> userInfo = \
createUserInfoFromHistoryItem( </del><ins>+ COMPtr<IPropertyBag> 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<CFDictionaryPropertyBag> userInfo = \
createUserInfoFromHistoryItem( </del><ins>+ COMPtr<IPropertyBag> 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<WebHistoryItem> item(Query, entry);
</span><span class="cx"> item->historyItem()->setRedirectURLs(nullptr);
</span><span class="cx">
</span><del>- COMPtr<CFDictionaryPropertyBag> userInfo = \
createUserInfoFromHistoryItem( </del><ins>+ COMPtr<IPropertyBag> 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 "WebKit.h"
</span><del>-#include <CoreFoundation/CoreFoundation.h>
</del><span class="cx"> #include <WebCore/COMPtr.h>
</span><span class="cx"> #include <memory>
</span><span class="cx"> #include <wtf/Forward.h>
</span><del>-#include <wtf/RetainPtr.h>
</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