<!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>[173765] trunk/Source</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/173765">173765</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-09-19 11:33:16 -0700 (Fri, 19 Sep 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Allow DOM methods to return references instead of pointers
https://bugs.webkit.org/show_bug.cgi?id=136931
Source/WebCore:
Reviewed by Sam Weinig.
It is common practice in WebKit to have methods return a reference
instead of a pointer if the pointer can never be null. However, this
unfortunately did not work for DOM methods (functions called by JS
bindings). This prevented further refactoring.
This patch brings support for having DOM methods to return references
instead of pointers when the pointer cannot be null. The generated
bindings were calling WTF::getPtr() on the pointer type returned by
the implementation already (in case it was a smart pointer type).
This patch leverages this by having WTF::getPtr() convert reference
arguments into raw pointers.
This patch also updates a few DOM methods on Document and Element
classes to return a reference instead of a pointer, to test the change.
There are likely more DOM methods that can be updated though.
No new tests, no behavior change.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::classList):
* bindings/js/JSDOMBinding.h:
(WTF::getPtr): Deleted.
* dom/Document.cpp:
(WebCore::Document::implementation):
(WebCore::Document::webkitGetNamedFlows):
(WebCore::Document::namedFlows):
(WebCore::Document::setXMLVersion):
(WebCore::Document::setXMLStandalone):
(WebCore::Document::securityPolicy):
(WebCore::Document::styleSheets):
* dom/Document.h:
(WebCore::Document::timing):
* dom/Element.cpp:
(WebCore::Element::classList):
(WebCore::Element::dataset):
* dom/Element.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::setPosition):
(WebCore::MediaControlPanelElement::resetPosition):
(WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::displayLastTextTrackCueBox):
(WebCore::VTTRegion::willRemoveTextTrackCueBox):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getAllStyleSheets):
(WebCore::InspectorCSSAgent::getNamedFlowCollection):
* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::documentTiming):
* rendering/FlowThreadController.cpp:
(WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
Source/WTF:
Add support for having WTF::getPtr() transform reference arguments
into raw pointers so that DOM methods can now return references when
appropriate and so that the generated bindings code can handle this
via WTF::getPtr().
This patch had to alter the way getPtr() was overloaded for smart
pointer types so that we don't call &p on smart pointers but p.get().
This was needed because the new WTF::getPtr(T&) was being called for
RefPtr<T> arguments instead of the getPtr(const RefPtr<T>&) overload.
This was addressed using traits and template specialization to
distinguish WTF smart pointers from other types.
Reviewed by Sam Weinig.
* wtf/GetPtr.h:
(WTF::getPtr):
* wtf/OwnPtr.h:
(WTF::getPtr): Deleted.
* wtf/PassOwnPtr.h:
(WTF::getPtr): Deleted.
* wtf/PassRefPtr.h:
(WTF::getPtr): Deleted.
* wtf/Ref.h:
* wtf/RefPtr.h:
(WTF::getPtr): Deleted.
* wtf/gobject/GRefPtr.h:
(WTF::getPtr): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfGetPtrh">trunk/Source/WTF/wtf/GetPtr.h</a></li>
<li><a href="#trunkSourceWTFwtfOwnPtrh">trunk/Source/WTF/wtf/OwnPtr.h</a></li>
<li><a href="#trunkSourceWTFwtfPassOwnPtrh">trunk/Source/WTF/wtf/PassOwnPtr.h</a></li>
<li><a href="#trunkSourceWTFwtfPassRefPtrh">trunk/Source/WTF/wtf/PassRefPtr.h</a></li>
<li><a href="#trunkSourceWTFwtfRefh">trunk/Source/WTF/wtf/Ref.h</a></li>
<li><a href="#trunkSourceWTFwtfRefPtrh">trunk/Source/WTF/wtf/RefPtr.h</a></li>
<li><a href="#trunkSourceWTFwtfgobjectGRefPtrh">trunk/Source/WTF/wtf/gobject/GRefPtr.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowMediaControlElementscpp">trunk/Source/WebCore/html/shadow/MediaControlElements.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegioncpp">trunk/Source/WebCore/html/track/VTTRegion.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceTimingcpp">trunk/Source/WebCore/page/PerformanceTiming.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingFlowThreadControllercpp">trunk/Source/WebCore/rendering/FlowThreadController.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WTF/ChangeLog        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2014-09-19 Chris Dumez <cdumez@apple.com>
+
+ Allow DOM methods to return references instead of pointers
+ https://bugs.webkit.org/show_bug.cgi?id=136931
+
+ Add support for having WTF::getPtr() transform reference arguments
+ into raw pointers so that DOM methods can now return references when
+ appropriate and so that the generated bindings code can handle this
+ via WTF::getPtr().
+
+ This patch had to alter the way getPtr() was overloaded for smart
+ pointer types so that we don't call &p on smart pointers but p.get().
+ This was needed because the new WTF::getPtr(T&) was being called for
+ RefPtr<T> arguments instead of the getPtr(const RefPtr<T>&) overload.
+ This was addressed using traits and template specialization to
+ distinguish WTF smart pointers from other types.
+
+ Reviewed by Sam Weinig.
+
+ * wtf/GetPtr.h:
+ (WTF::getPtr):
+ * wtf/OwnPtr.h:
+ (WTF::getPtr): Deleted.
+ * wtf/PassOwnPtr.h:
+ (WTF::getPtr): Deleted.
+ * wtf/PassRefPtr.h:
+ (WTF::getPtr): Deleted.
+ * wtf/Ref.h:
+ * wtf/RefPtr.h:
+ (WTF::getPtr): Deleted.
+ * wtf/gobject/GRefPtr.h:
+ (WTF::getPtr): Deleted.
+
</ins><span class="cx"> 2014-09-19 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> Always assume internal SDK when building configuration Production
</span></span></pre></div>
<a id="trunkSourceWTFwtfGetPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/GetPtr.h (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/GetPtr.h        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WTF/wtf/GetPtr.h        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -23,11 +23,39 @@
</span><span class="cx">
</span><span class="cx"> namespace WTF {
</span><span class="cx">
</span><del>- template <typename T> inline T* getPtr(T* p)
- {
- return p;
- }
</del><ins>+template <typename T> inline T* getPtr(T* p) { return p; }
</ins><span class="cx">
</span><ins>+template <typename T> struct IsSmartPtr {
+ static const bool value = false;
+};
+
+template <typename T, bool isSmartPtr>
+struct GetPtrHelper;
+
+template <typename T>
+struct GetPtrHelper<T, false /* isSmartPtr */> {
+ typedef T* PtrType;
+ static T* getPtr(T& p) { return &p; }
+};
+
+template <typename T>
+struct GetPtrHelper<T, true /* isSmartPtr */> {
+ typedef typename T::PtrType PtrType;
+ static PtrType getPtr(const T& p) { return p.get(); }
+};
+
+template <typename T>
+inline typename GetPtrHelper<T, IsSmartPtr<T>::value>::PtrType getPtr(T& p)
+{
+ return GetPtrHelper<T, IsSmartPtr<T>::value>::getPtr(p);
+}
+
+template <typename T>
+inline typename GetPtrHelper<T, IsSmartPtr<T>::value>::PtrType getPtr(const T& p)
+{
+ return GetPtrHelper<T, IsSmartPtr<T>::value>::getPtr(p);
+}
+
</ins><span class="cx"> } // namespace WTF
</span><span class="cx">
</span><span class="cx"> #endif // WTF_GetPtr_h
</span></span></pre></div>
<a id="trunkSourceWTFwtfOwnPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/OwnPtr.h (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/OwnPtr.h        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WTF/wtf/OwnPtr.h        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx">
</span><span class="cx"> #include <wtf/Assertions.h>
</span><span class="cx"> #include <wtf/Atomics.h>
</span><ins>+#include <wtf/GetPtr.h>
</ins><span class="cx"> #include <wtf/Noncopyable.h>
</span><span class="cx"> #include <wtf/OwnPtrCommon.h>
</span><span class="cx"> #include <algorithm>
</span><span class="lines">@@ -193,10 +194,9 @@
</span><span class="cx"> return a != b.get();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- template<typename T> inline typename OwnPtr<T>::PtrType getPtr(const OwnPtr<T>& p)
- {
- return p.get();
- }
</del><ins>+ template <typename T> struct IsSmartPtr<OwnPtr<T>> {
+ static const bool value = true;
+ };
</ins><span class="cx">
</span><span class="cx"> template<typename T> template<typename... Args> inline void OwnPtr<T>::createTransactionally(Args... args)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWTFwtfPassOwnPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PassOwnPtr.h (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PassOwnPtr.h        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WTF/wtf/PassOwnPtr.h        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include <cstddef>
</span><span class="cx"> #include <wtf/Assertions.h>
</span><ins>+#include <wtf/GetPtr.h>
</ins><span class="cx"> #include <wtf/OwnPtrCommon.h>
</span><span class="cx"> #include <type_traits>
</span><span class="cx">
</span><span class="lines">@@ -156,10 +157,9 @@
</span><span class="cx"> return adoptPtr(static_cast<T*>(p.leakPtr()));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- template<typename T> inline T* getPtr(const PassOwnPtr<T>& p)
- {
- return p.get();
- }
</del><ins>+ template <typename T> struct IsSmartPtr<PassOwnPtr<T>> {
+ static const bool value = true;
+ };
</ins><span class="cx">
</span><span class="cx"> } // namespace WTF
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWTFwtfPassRefPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PassRefPtr.h (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PassRefPtr.h        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WTF/wtf/PassRefPtr.h        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -21,7 +21,8 @@
</span><span class="cx"> #ifndef WTF_PassRefPtr_h
</span><span class="cx"> #define WTF_PassRefPtr_h
</span><span class="cx">
</span><del>-#include "PassRef.h"
</del><ins>+#include <wtf/GetPtr.h>
+#include <wtf/PassRef.h>
</ins><span class="cx">
</span><span class="cx"> namespace WTF {
</span><span class="cx">
</span><span class="lines">@@ -41,6 +42,9 @@
</span><span class="cx">
</span><span class="cx"> template<typename T> class PassRefPtr {
</span><span class="cx"> public:
</span><ins>+ typedef T ValueType;
+ typedef ValueType* PtrType;
+
</ins><span class="cx"> PassRefPtr() : m_ptr(nullptr) { }
</span><span class="cx"> PassRefPtr(T* ptr) : m_ptr(ptr) { refIfNotNull(ptr); }
</span><span class="cx"> // It somewhat breaks the type system to allow transfer of ownership out of
</span><span class="lines">@@ -153,10 +157,9 @@
</span><span class="cx"> return adoptRef(static_cast<T*>(p.leakRef()));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- template<typename T> inline T* getPtr(const PassRefPtr<T>& p)
- {
- return p.get();
- }
</del><ins>+ template <typename T> struct IsSmartPtr<PassRefPtr<T>> {
+ static const bool value = true;
+ };
</ins><span class="cx">
</span><span class="cx"> } // namespace WTF
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWTFwtfRefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Ref.h (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Ref.h        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WTF/wtf/Ref.h        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -26,7 +26,8 @@
</span><span class="cx"> #ifndef WTF_Ref_h
</span><span class="cx"> #define WTF_Ref_h
</span><span class="cx">
</span><del>-#include "Noncopyable.h"
</del><ins>+#include <wtf/GetPtr.h>
+#include <wtf/Noncopyable.h>
</ins><span class="cx">
</span><span class="cx"> namespace WTF {
</span><span class="cx">
</span><span class="lines">@@ -73,6 +74,12 @@
</span><span class="cx"> return oldReference;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+template <typename T>
+struct GetPtrHelper<Ref<T>, false /* isSmartPtr */> {
+ typedef T* PtrType;
+ static T* getPtr(const Ref<T>& p) { return const_cast<T*>(&p.get()); }
+};
+
</ins><span class="cx"> } // namespace WTF
</span><span class="cx">
</span><span class="cx"> using WTF::Ref;
</span></span></pre></div>
<a id="trunkSourceWTFwtfRefPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/RefPtr.h (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/RefPtr.h        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WTF/wtf/RefPtr.h        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -23,10 +23,11 @@
</span><span class="cx"> #ifndef WTF_RefPtr_h
</span><span class="cx"> #define WTF_RefPtr_h
</span><span class="cx">
</span><del>-#include "FastMalloc.h"
-#include "PassRefPtr.h"
</del><span class="cx"> #include <algorithm>
</span><span class="cx"> #include <utility>
</span><ins>+#include <wtf/FastMalloc.h>
+#include <wtf/GetPtr.h>
+#include <wtf/PassRefPtr.h>
</ins><span class="cx">
</span><span class="cx"> namespace WTF {
</span><span class="cx">
</span><span class="lines">@@ -35,6 +36,9 @@
</span><span class="cx"> template<typename T> class RefPtr {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><ins>+ typedef T ValueType;
+ typedef ValueType* PtrType;
+
</ins><span class="cx"> ALWAYS_INLINE RefPtr() : m_ptr(nullptr) { }
</span><span class="cx"> ALWAYS_INLINE RefPtr(T* ptr) : m_ptr(ptr) { refIfNotNull(ptr); }
</span><span class="cx"> ALWAYS_INLINE RefPtr(const RefPtr& o) : m_ptr(o.m_ptr) { refIfNotNull(m_ptr); }
</span><span class="lines">@@ -204,10 +208,9 @@
</span><span class="cx"> return RefPtr<T>(static_cast<T*>(p.get()));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- template<typename T> inline T* getPtr(const RefPtr<T>& p)
- {
- return p.get();
- }
</del><ins>+ template <typename T> struct IsSmartPtr<RefPtr<T>> {
+ static const bool value = true;
+ };
</ins><span class="cx">
</span><span class="cx"> } // namespace WTF
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWTFwtfgobjectGRefPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/gobject/GRefPtr.h (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/gobject/GRefPtr.h        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WTF/wtf/gobject/GRefPtr.h        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx">
</span><span class="cx"> #if USE(GLIB)
</span><span class="cx">
</span><ins>+#include <wtf/GetPtr.h>
</ins><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx"> #include <algorithm>
</span><span class="cx">
</span><span class="lines">@@ -41,6 +42,9 @@
</span><span class="cx">
</span><span class="cx"> template <typename T> class GRefPtr {
</span><span class="cx"> public:
</span><ins>+ typedef T ValueType;
+ typedef ValueType* PtrType;
+
</ins><span class="cx"> GRefPtr() : m_ptr(0) { }
</span><span class="cx">
</span><span class="cx"> GRefPtr(T* ptr)
</span><span class="lines">@@ -204,10 +208,9 @@
</span><span class="cx"> return GRefPtr<T>(const_cast<T*>(p.get()));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template <typename T> inline T* getPtr(const GRefPtr<T>& p)
-{
- return p.get();
-}
</del><ins>+template <typename T> struct IsSmartPtr<GRefPtr<T>> {
+ static const bool value = true;
+};
</ins><span class="cx">
</span><span class="cx"> template <typename T> GRefPtr<T> adoptGRef(T* p)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/ChangeLog        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -1,3 +1,61 @@
</span><ins>+2014-09-19 Chris Dumez <cdumez@apple.com>
+
+ Allow DOM methods to return references instead of pointers
+ https://bugs.webkit.org/show_bug.cgi?id=136931
+
+ Reviewed by Sam Weinig.
+
+ It is common practice in WebKit to have methods return a reference
+ instead of a pointer if the pointer can never be null. However, this
+ unfortunately did not work for DOM methods (functions called by JS
+ bindings). This prevented further refactoring.
+
+ This patch brings support for having DOM methods to return references
+ instead of pointers when the pointer cannot be null. The generated
+ bindings were calling WTF::getPtr() on the pointer type returned by
+ the implementation already (in case it was a smart pointer type).
+ This patch leverages this by having WTF::getPtr() convert reference
+ arguments into raw pointers.
+
+ This patch also updates a few DOM methods on Document and Element
+ classes to return a reference instead of a pointer, to test the change.
+ There are likely more DOM methods that can be updated though.
+
+ No new tests, no behavior change.
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::classList):
+ * bindings/js/JSDOMBinding.h:
+ (WTF::getPtr): Deleted.
+ * dom/Document.cpp:
+ (WebCore::Document::implementation):
+ (WebCore::Document::webkitGetNamedFlows):
+ (WebCore::Document::namedFlows):
+ (WebCore::Document::setXMLVersion):
+ (WebCore::Document::setXMLStandalone):
+ (WebCore::Document::securityPolicy):
+ (WebCore::Document::styleSheets):
+ * dom/Document.h:
+ (WebCore::Document::timing):
+ * dom/Element.cpp:
+ (WebCore::Element::classList):
+ (WebCore::Element::dataset):
+ * dom/Element.h:
+ * html/shadow/MediaControlElements.cpp:
+ (WebCore::MediaControlPanelElement::setPosition):
+ (WebCore::MediaControlPanelElement::resetPosition):
+ (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
+ * html/track/VTTRegion.cpp:
+ (WebCore::VTTRegion::displayLastTextTrackCueBox):
+ (WebCore::VTTRegion::willRemoveTextTrackCueBox):
+ * inspector/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::getAllStyleSheets):
+ (WebCore::InspectorCSSAgent::getNamedFlowCollection):
+ * page/PerformanceTiming.cpp:
+ (WebCore::PerformanceTiming::documentTiming):
+ * rendering/FlowThreadController.cpp:
+ (WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
+
</ins><span class="cx"> 2014-09-19 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> Always assume internal SDK when building configuration Production
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -2057,12 +2057,10 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> Element* element = toElement(node);
</span><del>- DOMTokenList* list = element->classList();
- if (!list)
- return;
- unsigned length = list->length();
</del><ins>+ DOMTokenList& list = element->classList();
+ unsigned length = list.length();
</ins><span class="cx"> for (unsigned k = 0; k < length; k++)
</span><del>- classList.append(list->item(k).string());
</del><ins>+ classList.append(list.item(k).string());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> #include <runtime/TypedArrayInlines.h>
</span><span class="cx"> #include <runtime/TypedArrays.h>
</span><span class="cx"> #include <wtf/Forward.h>
</span><ins>+#include <wtf/GetPtr.h>
</ins><span class="cx"> #include <wtf/Noncopyable.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="lines">@@ -52,17 +53,6 @@
</span><span class="cx"> class HashEntry;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if ENABLE(GAMEPAD)
-namespace WTF {
-
-template<typename T> inline T* getPtr(const Ref<T>& p)
-{
- return const_cast<T*>(&p.get());
-}
-
-}
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class CachedScript;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/dom/Document.cpp        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -805,11 +805,11 @@
</span><span class="cx"> m_activeLinkColor.setNamedColor("red");
</span><span class="cx"> }
</span><span class="cx">
</span><del>-DOMImplementation* Document::implementation()
</del><ins>+DOMImplementation& Document::implementation()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_implementation)
</span><span class="cx"> m_implementation = std::make_unique<DOMImplementation>(*this);
</span><del>- return m_implementation.get();
</del><ins>+ return *m_implementation;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool Document::hasManifest() const
</span><span class="lines">@@ -1122,17 +1122,17 @@
</span><span class="cx">
</span><span class="cx"> updateStyleIfNeeded();
</span><span class="cx">
</span><del>- return namedFlows()->createCSSOMSnapshot();
</del><ins>+ return namedFlows().createCSSOMSnapshot();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-NamedFlowCollection* Document::namedFlows()
</del><ins>+NamedFlowCollection& Document::namedFlows()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_namedFlows)
</span><span class="cx"> m_namedFlows = NamedFlowCollection::create(this);
</span><span class="cx">
</span><del>- return m_namedFlows.get();
</del><ins>+ return *m_namedFlows;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<Element> Document::createElementNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode& ec)
</span><span class="lines">@@ -1316,7 +1316,7 @@
</span><span class="cx">
</span><span class="cx"> void Document::setXMLVersion(const String& version, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- if (!implementation()->hasFeature("XML", String())) {
</del><ins>+ if (!implementation().hasFeature("XML", String())) {
</ins><span class="cx"> ec = NOT_SUPPORTED_ERR;
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -1331,7 +1331,7 @@
</span><span class="cx">
</span><span class="cx"> void Document::setXMLStandalone(bool standalone, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- if (!implementation()->hasFeature("XML", String())) {
</del><ins>+ if (!implementation().hasFeature("XML", String())) {
</ins><span class="cx"> ec = NOT_SUPPORTED_ERR;
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -1581,11 +1581,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSP_NEXT)
</span><del>-DOMSecurityPolicy* Document::securityPolicy()
</del><ins>+DOMSecurityPolicy& Document::securityPolicy()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_domSecurityPolicy)
</span><span class="cx"> m_domSecurityPolicy = DOMSecurityPolicy::create(this);
</span><del>- return m_domSecurityPolicy.get();
</del><ins>+ return *m_domSecurityPolicy;
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -3172,11 +3172,11 @@
</span><span class="cx"> setDecoder(other.decoder());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-StyleSheetList* Document::styleSheets()
</del><ins>+StyleSheetList& Document::styleSheets()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_styleSheetList)
</span><span class="cx"> m_styleSheetList = StyleSheetList::create(this);
</span><del>- return m_styleSheetList.get();
</del><ins>+ return *m_styleSheetList;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String Document::preferredStylesheetSet() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/dom/Document.h        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx">
</span><span class="cx"> DocumentType* doctype() const;
</span><span class="cx">
</span><del>- DOMImplementation* implementation();
</del><ins>+ DOMImplementation& implementation();
</ins><span class="cx">
</span><span class="cx"> Element* documentElement() const
</span><span class="cx"> {
</span><span class="lines">@@ -441,7 +441,7 @@
</span><span class="cx"> PassRefPtr<DOMNamedFlowCollection> webkitGetNamedFlows();
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- NamedFlowCollection* namedFlows();
</del><ins>+ NamedFlowCollection& namedFlows();
</ins><span class="cx">
</span><span class="cx"> Element* elementFromPoint(int x, int y) const;
</span><span class="cx"> PassRefPtr<Range> caretRangeFromPoint(int x, int y);
</span><span class="lines">@@ -492,7 +492,7 @@
</span><span class="cx"> bool hidden() const;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSP_NEXT)
</span><del>- DOMSecurityPolicy* securityPolicy();
</del><ins>+ DOMSecurityPolicy& securityPolicy();
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> PassRefPtr<Node> adoptNode(PassRefPtr<Node> source, ExceptionCode&);
</span><span class="lines">@@ -543,7 +543,7 @@
</span><span class="cx"> bool haveStylesheetsLoaded() const;
</span><span class="cx">
</span><span class="cx"> // This is a DOM function.
</span><del>- StyleSheetList* styleSheets();
</del><ins>+ StyleSheetList& styleSheets();
</ins><span class="cx">
</span><span class="cx"> DocumentStyleSheetCollection& styleSheetCollection() { return m_styleSheetCollection; }
</span><span class="cx">
</span><span class="lines">@@ -1177,7 +1177,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><del>- const DocumentTiming* timing() const { return &m_documentTiming; }
</del><ins>+ const DocumentTiming& timing() const { return m_documentTiming; }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/dom/Element.cpp        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -2326,20 +2326,20 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-DOMTokenList* Element::classList()
</del><ins>+DOMTokenList& Element::classList()
</ins><span class="cx"> {
</span><span class="cx"> ElementRareData& data = ensureElementRareData();
</span><span class="cx"> if (!data.classList())
</span><span class="cx"> data.setClassList(std::make_unique<ClassList>(*this));
</span><del>- return data.classList();
</del><ins>+ return *data.classList();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-DatasetDOMStringMap* Element::dataset()
</del><ins>+DatasetDOMStringMap& Element::dataset()
</ins><span class="cx"> {
</span><span class="cx"> ElementRareData& data = ensureElementRareData();
</span><span class="cx"> if (!data.dataset())
</span><span class="cx"> data.setDataset(std::make_unique<DatasetDOMStringMap>(*this));
</span><del>- return data.dataset();
</del><ins>+ return *data.dataset();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> URL Element::getURLAttribute(const QualifiedName& name) const
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/dom/Element.h        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -454,9 +454,9 @@
</span><span class="cx"> bool matches(const String& selectors, ExceptionCode&);
</span><span class="cx"> virtual bool shouldAppearIndeterminate() const;
</span><span class="cx">
</span><del>- DOMTokenList* classList();
</del><ins>+ DOMTokenList& classList();
</ins><span class="cx">
</span><del>- DatasetDOMStringMap* dataset();
</del><ins>+ DatasetDOMStringMap& dataset();
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> virtual bool isMediaElement() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowMediaControlElementscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx"> setInlineStyleProperty(CSSPropertyMarginLeft, 0.0, CSSPrimitiveValue::CSS_PX);
</span><span class="cx"> setInlineStyleProperty(CSSPropertyMarginTop, 0.0, CSSPrimitiveValue::CSS_PX);
</span><span class="cx">
</span><del>- classList()->add("dragged", IGNORE_EXCEPTION);
</del><ins>+ classList().add("dragged", IGNORE_EXCEPTION);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaControlPanelElement::resetPosition()
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx"> removeInlineStyleProperty(CSSPropertyMarginLeft);
</span><span class="cx"> removeInlineStyleProperty(CSSPropertyMarginTop);
</span><span class="cx">
</span><del>- classList()->remove("dragged", IGNORE_EXCEPTION);
</del><ins>+ classList().remove("dragged", IGNORE_EXCEPTION);
</ins><span class="cx">
</span><span class="cx"> m_cumulativeDragOffset.setX(0);
</span><span class="cx"> m_cumulativeDragOffset.setY(0);
</span><span class="lines">@@ -764,24 +764,24 @@
</span><span class="cx">
</span><span class="cx"> if (textTrack == TextTrack::captionMenuAutomaticItem()) {
</span><span class="cx"> if (displayMode == CaptionUserPreferences::Automatic)
</span><del>- trackItem->classList()->add(selectedClassValue, ASSERT_NO_EXCEPTION);
</del><ins>+ trackItem->classList().add(selectedClassValue, ASSERT_NO_EXCEPTION);
</ins><span class="cx"> else
</span><del>- trackItem->classList()->remove(selectedClassValue, ASSERT_NO_EXCEPTION);
</del><ins>+ trackItem->classList().remove(selectedClassValue, ASSERT_NO_EXCEPTION);
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (displayMode != CaptionUserPreferences::Automatic && textTrack->mode() == TextTrack::showingKeyword()) {
</span><span class="cx"> trackMenuItemSelected = true;
</span><del>- trackItem->classList()->add(selectedClassValue, ASSERT_NO_EXCEPTION);
</del><ins>+ trackItem->classList().add(selectedClassValue, ASSERT_NO_EXCEPTION);
</ins><span class="cx"> } else
</span><del>- trackItem->classList()->remove(selectedClassValue, ASSERT_NO_EXCEPTION);
</del><ins>+ trackItem->classList().remove(selectedClassValue, ASSERT_NO_EXCEPTION);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (offMenuItem) {
</span><span class="cx"> if (displayMode == CaptionUserPreferences::ForcedOnly && !trackMenuItemSelected)
</span><del>- offMenuItem->classList()->add(selectedClassValue, ASSERT_NO_EXCEPTION);
</del><ins>+ offMenuItem->classList().add(selectedClassValue, ASSERT_NO_EXCEPTION);
</ins><span class="cx"> else
</span><del>- offMenuItem->classList()->remove(selectedClassValue, ASSERT_NO_EXCEPTION);
</del><ins>+ offMenuItem->classList().remove(selectedClassValue, ASSERT_NO_EXCEPTION);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTRegion.cpp (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegion.cpp        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/html/track/VTTRegion.cpp        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -368,7 +368,7 @@
</span><span class="cx">
</span><span class="cx"> // If it's a scrolling region, add the scrolling class.
</span><span class="cx"> if (isScrollingRegion())
</span><del>- m_cueContainer->classList()->add(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
</del><ins>+ m_cueContainer->classList().add(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
</ins><span class="cx">
</span><span class="cx"> float regionBottom = m_regionDisplayTree->getBoundingClientRect()->bottom();
</span><span class="cx">
</span><span class="lines">@@ -398,7 +398,7 @@
</span><span class="cx">
</span><span class="cx"> double boxHeight = box->getBoundingClientRect()->bottom() - box->getBoundingClientRect()->top();
</span><span class="cx">
</span><del>- m_cueContainer->classList()->remove(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
</del><ins>+ m_cueContainer->classList().remove(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
</ins><span class="cx">
</span><span class="cx"> m_currentTop += boxHeight;
</span><span class="cx"> m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -681,9 +681,9 @@
</span><span class="cx"> styleInfos = Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSStyleSheetHeader>::create();
</span><span class="cx"> Vector<Document*> documents = m_domAgent->documents();
</span><span class="cx"> for (Vector<Document*>::iterator it = documents.begin(); it != documents.end(); ++it) {
</span><del>- StyleSheetList* list = (*it)->styleSheets();
- for (unsigned i = 0; i < list->length(); ++i) {
- StyleSheet& styleSheet = *list->item(i);
</del><ins>+ StyleSheetList& list = (*it)->styleSheets();
+ for (unsigned i = 0; i < list.length(); ++i) {
+ StyleSheet& styleSheet = *list.item(i);
</ins><span class="cx"> if (styleSheet.isCSSStyleSheet())
</span><span class="cx"> collectStyleSheets(&toCSSStyleSheet(styleSheet), styleInfos.get());
</span><span class="cx"> }
</span><span class="lines">@@ -862,7 +862,7 @@
</span><span class="cx">
</span><span class="cx"> m_namedFlowCollectionsRequested.add(documentNodeId);
</span><span class="cx">
</span><del>- Vector<RefPtr<WebKitNamedFlow>> namedFlowsVector = document->namedFlows()->namedFlows();
</del><ins>+ Vector<RefPtr<WebKitNamedFlow>> namedFlowsVector = document->namedFlows().namedFlows();
</ins><span class="cx"> RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::NamedFlow>> namedFlows = Inspector::Protocol::Array<Inspector::Protocol::CSS::NamedFlow>::create();
</span><span class="cx">
</span><span class="cx"> for (Vector<RefPtr<WebKitNamedFlow>>::iterator it = namedFlowsVector.begin(); it != namedFlowsVector.end(); ++it)
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceTiming.cpp (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceTiming.cpp        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/page/PerformanceTiming.cpp        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -319,7 +319,7 @@
</span><span class="cx"> if (!document)
</span><span class="cx"> return 0;
</span><span class="cx">
</span><del>- return document->timing();
</del><ins>+ return &document->timing();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> DocumentLoadTiming* PerformanceTiming::documentLoadTiming() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingFlowThreadControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/FlowThreadController.cpp (173764 => 173765)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/FlowThreadController.cpp        2014-09-19 18:15:05 UTC (rev 173764)
+++ trunk/Source/WebCore/rendering/FlowThreadController.cpp        2014-09-19 18:33:16 UTC (rev 173765)
</span><span class="lines">@@ -63,12 +63,12 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- NamedFlowCollection* namedFlows = m_view->document().namedFlows();
</del><ins>+ NamedFlowCollection& namedFlows = m_view->document().namedFlows();
</ins><span class="cx">
</span><span class="cx"> // Sanity check for the absence of a named flow in the "CREATED" state with the same name.
</span><del>- ASSERT(!namedFlows->flowByName(name));
</del><ins>+ ASSERT(!namedFlows.flowByName(name));
</ins><span class="cx">
</span><del>- auto flowRenderer = new RenderNamedFlowThread(m_view->document(), RenderFlowThread::createFlowThreadStyle(&m_view->style()), namedFlows->ensureFlowWithName(name));
</del><ins>+ auto flowRenderer = new RenderNamedFlowThread(m_view->document(), RenderFlowThread::createFlowThreadStyle(&m_view->style()), namedFlows.ensureFlowWithName(name));
</ins><span class="cx"> flowRenderer->initializeStyle();
</span><span class="cx"> m_renderNamedFlowThreadList->add(flowRenderer);
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>