<!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>[179170] trunk</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/179170">179170</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2015-01-26 22:24:09 -0800 (Mon, 26 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
https://bugs.webkit.org/show_bug.cgi?id=87426
<rdar://problem/11527899>
Reviewed by Darin Adler.
Source/WebCore:
Revise COMPtr to work better with our HashMap implementation:
(1) Add a specialization for IsSmartPtr.
(2) Remove PtrHash specialization.
(3) Refresh HashTrails specialization for COMPtr to match what we
do for RefPtr.
* platform/win/COMPtr.h:
Source/WebKit/win:
Revise COMPtr to work better with our HashMap implementation. Use
modern loop syntax.
* WebHistory.cpp:
(WebHistory::visitedURL): Adjust for new COMPtr changes.
* WebPreferences.cpp:
(WebPreferences::getInstanceForIdentifier): Ditto.
(WebPreferences::removeReferenceForIdentifier): Ditto.
* WebView.cpp:
(WebView::setEditable): Ditto.
Source/WTF:
Revise internal containers to use std::addressof in preference to
to using the '&' operator.
* wtf/Deque.h:
(WTF::inlineCapacity>::append):
(WTF::inlineCapacity>::prepend):
(WTF::inlineCapacity>::removeFirst):
(WTF::inlineCapacity>::removeLast):
(WTF::inlineCapacity>::remove):
(WTF::inlineCapacity>::after):
(WTF::inlineCapacity>::before):
* wtf/GetPtr.h:
* wtf/HashTable.h:
(WTF::HashTableBucketInitializer<false>::initialize):
* wtf/HashTraits.h:
(WTF::SimpleClassHashTraits::constructDeletedValue):
(WTF::CustomHashTraits::constructDeletedValue):
* wtf/ListHashSet.h:
(WTF::ListHashSetConstIterator::get):
* wtf/Vector.h:
(WTF::Vector::swap):
(WTF::OverflowHandler>::append):
(WTF::OverflowHandler>::tryAppend):
(WTF::OverflowHandler>::insert):
Tools:
Revise COMPtr to work better with our HashMap implementation. Use
modern loop syntax.
* DumpRenderTree/win/AccessibilityControllerWin.cpp:
(AccessibilityController::~AccessibilityController):
(AccessibilityController::winNotificationReceived):
* DumpRenderTree/win/DumpRenderTree.cpp:
(dumpBackForwardListForAllWindows):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfDequeh">trunk/Source/WTF/wtf/Deque.h</a></li>
<li><a href="#trunkSourceWTFwtfGetPtrh">trunk/Source/WTF/wtf/GetPtr.h</a></li>
<li><a href="#trunkSourceWTFwtfHashTableh">trunk/Source/WTF/wtf/HashTable.h</a></li>
<li><a href="#trunkSourceWTFwtfHashTraitsh">trunk/Source/WTF/wtf/HashTraits.h</a></li>
<li><a href="#trunkSourceWTFwtfListHashSeth">trunk/Source/WTF/wtf/ListHashSet.h</a></li>
<li><a href="#trunkSourceWTFwtfVectorh">trunk/Source/WTF/wtf/Vector.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformwinCOMPtrh">trunk/Source/WebCore/platform/win/COMPtr.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="#trunkSourceWebKitwinWebPreferencescpp">trunk/Source/WebKit/win/WebPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreewinAccessibilityControllerWincpp">trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinDumpRenderTreecpp">trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WTF/ChangeLog        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2015-01-26 Brent Fulgham <bfulgham@apple.com>
+
+ [Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
+ https://bugs.webkit.org/show_bug.cgi?id=87426
+ <rdar://problem/11527899>
+
+ Reviewed by Darin Adler.
+
+ Revise internal containers to use std::addressof in preference to
+ to using the '&' operator.
+
+ * wtf/Deque.h:
+ (WTF::inlineCapacity>::append):
+ (WTF::inlineCapacity>::prepend):
+ (WTF::inlineCapacity>::removeFirst):
+ (WTF::inlineCapacity>::removeLast):
+ (WTF::inlineCapacity>::remove):
+ (WTF::inlineCapacity>::after):
+ (WTF::inlineCapacity>::before):
+ * wtf/GetPtr.h:
+ * wtf/HashTable.h:
+ (WTF::HashTableBucketInitializer<false>::initialize):
+ * wtf/HashTraits.h:
+ (WTF::SimpleClassHashTraits::constructDeletedValue):
+ (WTF::CustomHashTraits::constructDeletedValue):
+ * wtf/ListHashSet.h:
+ (WTF::ListHashSetConstIterator::get):
+ * wtf/Vector.h:
+ (WTF::Vector::swap):
+ (WTF::OverflowHandler>::append):
+ (WTF::OverflowHandler>::tryAppend):
+ (WTF::OverflowHandler>::insert):
+
</ins><span class="cx"> 2015-01-24 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Provide implementation for WTF::DefaultHash<bool>
</span></span></pre></div>
<a id="trunkSourceWTFwtfDequeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Deque.h (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Deque.h        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WTF/wtf/Deque.h        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -411,7 +411,7 @@
</span><span class="cx"> {
</span><span class="cx"> checkValidity();
</span><span class="cx"> expandCapacityIfNeeded();
</span><del>- new (NotNull, &m_buffer.buffer()[m_end]) T(std::forward<U>(value));
</del><ins>+ new (NotNull, std::addressof(m_buffer.buffer()[m_end])) T(std::forward<U>(value));
</ins><span class="cx"> if (m_end == m_buffer.capacity() - 1)
</span><span class="cx"> m_end = 0;
</span><span class="cx"> else
</span><span class="lines">@@ -428,7 +428,7 @@
</span><span class="cx"> m_start = m_buffer.capacity() - 1;
</span><span class="cx"> else
</span><span class="cx"> --m_start;
</span><del>- new (NotNull, &m_buffer.buffer()[m_start]) T(std::forward<U>(value));
</del><ins>+ new (NotNull, std::addressof(m_buffer.buffer()[m_start])) T(std::forward<U>(value));
</ins><span class="cx"> checkValidity();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -438,7 +438,7 @@
</span><span class="cx"> checkValidity();
</span><span class="cx"> invalidateIterators();
</span><span class="cx"> ASSERT(!isEmpty());
</span><del>- TypeOperations::destruct(&m_buffer.buffer()[m_start], &m_buffer.buffer()[m_start + 1]);
</del><ins>+ TypeOperations::destruct(std::addressof(m_buffer.buffer()[m_start]), std::addressof(m_buffer.buffer()[m_start + 1]));
</ins><span class="cx"> if (m_start == m_buffer.capacity() - 1)
</span><span class="cx"> m_start = 0;
</span><span class="cx"> else
</span><span class="lines">@@ -456,7 +456,7 @@
</span><span class="cx"> m_end = m_buffer.capacity() - 1;
</span><span class="cx"> else
</span><span class="cx"> --m_end;
</span><del>- TypeOperations::destruct(&m_buffer.buffer()[m_end], &m_buffer.buffer()[m_end + 1]);
</del><ins>+ TypeOperations::destruct(std::addressof(m_buffer.buffer()[m_end]), std::addressof(m_buffer.buffer()[m_end + 1]));
</ins><span class="cx"> checkValidity();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -484,7 +484,7 @@
</span><span class="cx"> invalidateIterators();
</span><span class="cx">
</span><span class="cx"> T* buffer = m_buffer.buffer();
</span><del>- TypeOperations::destruct(&buffer[position], &buffer[position + 1]);
</del><ins>+ TypeOperations::destruct(std::addressof(buffer[position]), std::addressof(buffer[position + 1]));
</ins><span class="cx">
</span><span class="cx"> // Find which segment of the circular buffer contained the remove element, and only move elements in that part.
</span><span class="cx"> if (position >= m_start) {
</span><span class="lines">@@ -641,7 +641,7 @@
</span><span class="cx"> {
</span><span class="cx"> checkValidity();
</span><span class="cx"> ASSERT(m_index != m_deque->m_end);
</span><del>- return &m_deque->m_buffer.buffer()[m_index];
</del><ins>+ return std::addressof(m_deque->m_buffer.buffer()[m_index]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<typename T, size_t inlineCapacity>
</span><span class="lines">@@ -650,8 +650,8 @@
</span><span class="cx"> checkValidity();
</span><span class="cx"> ASSERT(m_index != m_deque->m_start);
</span><span class="cx"> if (!m_index)
</span><del>- return &m_deque->m_buffer.buffer()[m_deque->m_buffer.capacity() - 1];
- return &m_deque->m_buffer.buffer()[m_index - 1];
</del><ins>+ return std::addressof(m_deque->m_buffer.buffer()[m_deque->m_buffer.capacity() - 1]);
+ return std::addressof(m_deque->m_buffer.buffer()[m_index - 1]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WTF
</span></span></pre></div>
<a id="trunkSourceWTFwtfGetPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/GetPtr.h (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/GetPtr.h        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WTF/wtf/GetPtr.h        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> template <typename T>
</span><span class="cx"> struct GetPtrHelperBase<T, false /* isSmartPtr */> {
</span><span class="cx"> typedef T* PtrType;
</span><del>- static T* getPtr(T& p) { return &p; }
</del><ins>+ static T* getPtr(T& p) { return std::addressof(p); }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> template <typename T>
</span></span></pre></div>
<a id="trunkSourceWTFwtfHashTableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/HashTable.h (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/HashTable.h        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WTF/wtf/HashTable.h        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -766,7 +766,7 @@
</span><span class="cx"> template<> struct HashTableBucketInitializer<false> {
</span><span class="cx"> template<typename Traits, typename Value> static void initialize(Value& bucket)
</span><span class="cx"> {
</span><del>- new (NotNull, &bucket) Value(Traits::emptyValue());
</del><ins>+ new (NotNull, std::addressof(bucket)) Value(Traits::emptyValue());
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWTFwtfHashTraitsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/HashTraits.h (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/HashTraits.h        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WTF/wtf/HashTraits.h        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">
</span><span class="cx"> template<typename T> struct SimpleClassHashTraits : GenericHashTraits<T> {
</span><span class="cx"> static const bool emptyValueIsZero = true;
</span><del>- static void constructDeletedValue(T& slot) { new (NotNull, &slot) T(HashTableDeletedValue); }
</del><ins>+ static void constructDeletedValue(T& slot) { new (NotNull, std::addressof(slot)) T(HashTableDeletedValue); }
</ins><span class="cx"> static bool isDeletedValue(const T& value) { return value.isHashTableDeletedValue(); }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx"> typedef std::nullptr_t EmptyValueType;
</span><span class="cx"> static EmptyValueType emptyValue() { return nullptr; }
</span><span class="cx">
</span><del>- static void constructDeletedValue(std::unique_ptr<T, Deleter>& slot) { new (NotNull, &slot) std::unique_ptr<T, Deleter> { reinterpret_cast<T*>(-1) }; }
</del><ins>+ static void constructDeletedValue(std::unique_ptr<T, Deleter>& slot) { new (NotNull, std::addressof(slot)) std::unique_ptr<T, Deleter> { reinterpret_cast<T*>(-1) }; }
</ins><span class="cx"> static bool isDeletedValue(const std::unique_ptr<T, Deleter>& value) { return value.get() == reinterpret_cast<T*>(-1); }
</span><span class="cx">
</span><span class="cx"> typedef T* PeekType;
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx">
</span><span class="cx"> static void constructDeletedValue(T& slot)
</span><span class="cx"> {
</span><del>- new (NotNull, &slot) T(T::DeletedValue);
</del><ins>+ new (NotNull, std::addressof(slot)) T(T::DeletedValue);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static bool isDeletedValue(const T& value)
</span></span></pre></div>
<a id="trunkSourceWTFwtfListHashSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/ListHashSet.h (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/ListHashSet.h        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WTF/wtf/ListHashSet.h        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -254,7 +254,7 @@
</span><span class="cx">
</span><span class="cx"> const ValueType* get() const
</span><span class="cx"> {
</span><del>- return &m_position->m_value;
</del><ins>+ return std::addressof(m_position->m_value);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const ValueType& operator*() const { return *get(); }
</span></span></pre></div>
<a id="trunkSourceWTFwtfVectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Vector.h (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Vector.h        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WTF/wtf/Vector.h        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -753,7 +753,7 @@
</span><span class="cx"> void swap(Vector<T, inlineCapacity, OverflowHandler>& other)
</span><span class="cx"> {
</span><span class="cx"> #if ASAN_ENABLED
</span><del>- if (this == &other) // ASan will crash if we try to restrict access to the same buffer twice.
</del><ins>+ if (this == std::addressof(other)) // ASan will crash if we try to restrict access to the same buffer twice.
</ins><span class="cx"> return;
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -1170,7 +1170,7 @@
</span><span class="cx"> CRASH();
</span><span class="cx"> asanBufferSizeWillChangeTo(newSize);
</span><span class="cx"> T* dest = end();
</span><del>- VectorCopier<std::is_trivial<T>::value, U>::uninitializedCopy(data, &data[dataSize], dest);
</del><ins>+ VectorCopier<std::is_trivial<T>::value, U>::uninitializedCopy(data, std::addressof(data[dataSize]), dest);
</ins><span class="cx"> m_size = newSize;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1188,7 +1188,7 @@
</span><span class="cx"> return false;
</span><span class="cx"> asanBufferSizeWillChangeTo(newSize);
</span><span class="cx"> T* dest = end();
</span><del>- VectorCopier<std::is_trivial<T>::value, U>::uninitializedCopy(data, &data[dataSize], dest);
</del><ins>+ VectorCopier<std::is_trivial<T>::value, U>::uninitializedCopy(data, std::addressof(data[dataSize]), dest);
</ins><span class="cx"> m_size = newSize;
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -1255,7 +1255,7 @@
</span><span class="cx"> asanBufferSizeWillChangeTo(newSize);
</span><span class="cx"> T* spot = begin() + position;
</span><span class="cx"> TypeOperations::moveOverlapping(spot, end(), spot + dataSize);
</span><del>- VectorCopier<std::is_trivial<T>::value, U>::uninitializedCopy(data, &data[dataSize], spot);
</del><ins>+ VectorCopier<std::is_trivial<T>::value, U>::uninitializedCopy(data, std::addressof(data[dataSize]), spot);
</ins><span class="cx"> m_size = newSize;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WebCore/ChangeLog        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-01-26 Brent Fulgham <bfulgham@apple.com>
+
+ [Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
+ https://bugs.webkit.org/show_bug.cgi?id=87426
+ <rdar://problem/11527899>
+
+ Reviewed by Darin Adler.
+
+ Revise COMPtr to work better with our HashMap implementation:
+ (1) Add a specialization for IsSmartPtr.
+ (2) Remove PtrHash specialization.
+ (3) Refresh HashTrails specialization for COMPtr to match what we
+ do for RefPtr.
+
+ * platform/win/COMPtr.h:
+
</ins><span class="cx"> 2015-01-26 Sylvain Galineau <galineau@adobe.com>
</span><span class="cx">
</span><span class="cx"> The computed value of line-height:normal is incorrect
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinCOMPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/COMPtr.h (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/COMPtr.h        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WebCore/platform/win/COMPtr.h        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx">
</span><span class="cx"> template<typename T> class COMPtr {
</span><span class="cx"> public:
</span><ins>+ typedef T* PtrType;
</ins><span class="cx"> COMPtr() : m_ptr(0) { }
</span><span class="cx"> COMPtr(T* ptr) : m_ptr(ptr) { if (m_ptr) m_ptr->AddRef(); }
</span><span class="cx"> COMPtr(AdoptCOMTag, T* ptr) : m_ptr(ptr) { }
</span><span class="lines">@@ -223,22 +224,22 @@
</span><span class="cx">
</span><span class="cx"> namespace WTF {
</span><span class="cx">
</span><del>- template<typename P> struct HashTraits<COMPtr<P> > : GenericHashTraits<COMPtr<P> > {
- static const bool emptyValueIsZero = true;
- static void constructDeletedValue(COMPtr<P>& slot) { new (&slot) COMPtr<P>(HashTableDeletedValue); }
- static bool isDeletedValue(const COMPtr<P>& value) { return value.isHashTableDeletedValue(); }
- };
</del><ins>+template<typename P> struct IsSmartPtr<COMPtr<P>> {
+ static const bool value = true;
+};
</ins><span class="cx">
</span><del>- template<typename P> struct PtrHash<COMPtr<P> > : PtrHash<P*> {
- using PtrHash<P*>::hash;
- static unsigned hash(const COMPtr<P>& key) { return hash(key.get()); }
- using PtrHash<P*>::equal;
- static bool equal(const COMPtr<P>& a, const COMPtr<P>& b) { return a == b; }
- static bool equal(P* a, const COMPtr<P>& b) { return a == b; }
- static bool equal(const COMPtr<P>& a, P* b) { return a == b; }
- };
</del><ins>+template<typename P> struct HashTraits<COMPtr<P> > : SimpleClassHashTraits<COMPtr<P>> {
+ static P* emptyValue() { return nullptr; }
</ins><span class="cx">
</span><del>- template<typename P> struct DefaultHash<COMPtr<P> > { typedef PtrHash<COMPtr<P> > Hash; };
</del><ins>+ typedef P* PeekType;
+ static PeekType peek(const COMPtr<P>& value) { return value.get(); }
+ static PeekType peek(P* value) { return value; }
+};
+
+template<typename P> struct DefaultHash<COMPtr<P>> {
+ typedef PtrHash<COMPtr<P>> Hash;
+};
+
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WebKit/win/ChangeLog        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2015-01-26 Brent Fulgham <bfulgham@apple.com>
+
+ [Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
+ https://bugs.webkit.org/show_bug.cgi?id=87426
+ <rdar://problem/11527899>
+
+ Reviewed by Darin Adler.
+
+ Revise COMPtr to work better with our HashMap implementation. Use
+ modern loop syntax.
+
+ * WebHistory.cpp:
+ (WebHistory::visitedURL): Adjust for new COMPtr changes.
+ * WebPreferences.cpp:
+ (WebPreferences::getInstanceForIdentifier): Ditto.
+ (WebPreferences::removeReferenceForIdentifier): Ditto.
+ * WebView.cpp:
+ (WebView::setEditable): Ditto.
+
</ins><span class="cx"> 2015-01-26 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Rename Document::body() to Document::bodyOrFrameset() for clarity
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebHistorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebHistory.cpp (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebHistory.cpp        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WebKit/win/WebHistory.cpp        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -504,7 +504,7 @@
</span><span class="cx"> if (urlString.isEmpty())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- IWebHistoryItem* entry = m_entriesByURL.get(urlString).get();
</del><ins>+ IWebHistoryItem* entry = m_entriesByURL.get(urlString);
</ins><span class="cx"> if (!entry) {
</span><span class="cx"> COMPtr<WebHistoryItem> item(AdoptCOM, WebHistoryItem::createInstance());
</span><span class="cx"> if (!item)
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebPreferences.cpp (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebPreferences.cpp        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WebKit/win/WebPreferences.cpp        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx"> if (identifierString.isEmpty())
</span><span class="cx"> return sharedStandardPreferences();
</span><span class="cx">
</span><del>- return webPreferencesInstances().get(identifierString).get();
</del><ins>+ return webPreferencesInstances().get(identifierString);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPreferences::setInstance(WebPreferences* instance, BSTR identifier)
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx"> WTF::String identifierString(identifier, SysStringLen(identifier));
</span><span class="cx"> if (identifierString.isEmpty())
</span><span class="cx"> return;
</span><del>- WebPreferences* webPreference = webPreferencesInstances().get(identifierString).get();
</del><ins>+ WebPreferences* webPreference = webPreferencesInstances().get(identifierString);
</ins><span class="cx"> if (webPreference && webPreference->m_refCount == 1)
</span><span class="cx"> webPreferencesInstances().remove(identifierString);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Source/WebKit/win/WebView.cpp        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -4195,7 +4195,7 @@
</span><span class="cx"> if (!m_page)
</span><span class="cx"> return S_OK;
</span><span class="cx">
</span><del>- if (m_page->isEditable() == flag)
</del><ins>+ if (m_page->isEditable() == static_cast<bool>(flag))
</ins><span class="cx"> return S_OK;
</span><span class="cx">
</span><span class="cx"> m_page->setEditable(flag);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Tools/ChangeLog        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-01-26 Brent Fulgham <bfulgham@apple.com>
+
+ [Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
+ https://bugs.webkit.org/show_bug.cgi?id=87426
+ <rdar://problem/11527899>
+
+ Reviewed by Darin Adler.
+
+ Revise COMPtr to work better with our HashMap implementation. Use
+ modern loop syntax.
+
+ * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+ (AccessibilityController::~AccessibilityController):
+ (AccessibilityController::winNotificationReceived):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (dumpBackForwardListForAllWindows):
+
</ins><span class="cx"> 2015-01-26 Csaba Osztrogonác <ossy@webkit.org>
</span><span class="cx">
</span><span class="cx"> [Win] Enable JSC stress tests by default
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinAccessibilityControllerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -61,8 +61,8 @@
</span><span class="cx"> if (m_notificationsEventHook)
</span><span class="cx"> UnhookWinEvent(m_notificationsEventHook);
</span><span class="cx">
</span><del>- for (HashMap<PlatformUIElement, JSObjectRef>::iterator it = m_notificationListeners.begin(); it != m_notificationListeners.end(); ++it)
- JSValueUnprotect(frame->globalContext(), it->value);
</del><ins>+ for (auto& listener : m_notificationListeners.values())
+ JSValueUnprotect(frame->globalContext(), listener);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
</span><span class="lines">@@ -337,8 +337,8 @@
</span><span class="cx">
</span><span class="cx"> void AccessibilityController::winNotificationReceived(PlatformUIElement element, const string& eventName)
</span><span class="cx"> {
</span><del>- for (HashMap<PlatformUIElement, JSObjectRef>::iterator it = m_notificationListeners.begin(); it != m_notificationListeners.end(); ++it) {
- COMPtr<IServiceProvider> thisServiceProvider(Query, it->key);
</del><ins>+ for (auto& slot : m_notificationListeners) {
+ COMPtr<IServiceProvider> thisServiceProvider(Query, slot.key);
</ins><span class="cx"> if (!thisServiceProvider)
</span><span class="cx"> continue;
</span><span class="cx">
</span><span class="lines">@@ -361,7 +361,7 @@
</span><span class="cx">
</span><span class="cx"> JSRetainPtr<JSStringRef> jsNotification(Adopt, JSStringCreateWithUTF8CString(eventName.c_str()));
</span><span class="cx"> JSValueRef argument = JSValueMakeString(frame->globalContext(), jsNotification.get());
</span><del>- JSObjectCallAsFunction(frame->globalContext(), it->value, 0, 1, &argument, 0);
</del><ins>+ JSObjectCallAsFunction(frame->globalContext(), slot.value, 0, 1, &argument, 0);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinDumpRenderTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (179169 => 179170)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2015-01-27 06:14:01 UTC (rev 179169)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2015-01-27 06:24:09 UTC (rev 179170)
</span><span class="lines">@@ -658,7 +658,7 @@
</span><span class="cx"> unsigned count = openWindows().size();
</span><span class="cx"> for (unsigned i = 0; i < count; i++) {
</span><span class="cx"> HWND window = openWindows()[i];
</span><del>- IWebView* webView = windowToWebViewMap().get(window).get();
</del><ins>+ IWebView* webView = windowToWebViewMap().get(window);
</ins><span class="cx"> dumpBackForwardList(webView);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>