<!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>[175648] 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/175648">175648</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-11-05 16:16:27 -0800 (Wed, 05 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Allow constructing a PassRef from a Ref
https://bugs.webkit.org/show_bug.cgi?id=138389
Reviewed by Andreas Kling.
Source/WebCore:
Remove calls to Ref::get() now that a PassRef can be directly
constructed from a Ref.
No new tests, no behavior change.
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createColorValue):
* css/CSSValuePool.h:
(WebCore::CSSValuePool::createInheritedValue):
(WebCore::CSSValuePool::createImplicitInitialValue):
(WebCore::CSSValuePool::createExplicitInitialValue):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setCSSStyleSheet):
Source/WTF:
Allow constructing a PassRef from a Ref, similarly to PassRefPtr that
can be constructed from a RefPtr already. This avoids having to call
Ref::get() and simplifies the code a bit.
* wtf/PassRef.h:
(WTF::PassRef<T>::PassRef):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPassRefh">trunk/Source/WTF/wtf/PassRef.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuePoolcpp">trunk/Source/WebCore/css/CSSValuePool.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuePoolh">trunk/Source/WebCore/css/CSSValuePool.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementcpp">trunk/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (175647 => 175648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2014-11-06 00:09:49 UTC (rev 175647)
+++ trunk/Source/WTF/ChangeLog        2014-11-06 00:16:27 UTC (rev 175648)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-11-05 Chris Dumez <cdumez@apple.com>
+
+ Allow constructing a PassRef from a Ref
+ https://bugs.webkit.org/show_bug.cgi?id=138389
+
+ Reviewed by Andreas Kling.
+
+ Allow constructing a PassRef from a Ref, similarly to PassRefPtr that
+ can be constructed from a RefPtr already. This avoids having to call
+ Ref::get() and simplifies the code a bit.
+
+ * wtf/PassRef.h:
+ (WTF::PassRef<T>::PassRef):
+
</ins><span class="cx"> 2014-11-05 Dan Bernstein <mitz@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove the unused deletion UI feature
</span></span></pre></div>
<a id="trunkSourceWTFwtfPassRefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PassRef.h (175647 => 175648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PassRef.h        2014-11-06 00:09:49 UTC (rev 175647)
+++ trunk/Source/WTF/wtf/PassRef.h        2014-11-06 00:16:27 UTC (rev 175648)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> public:
</span><span class="cx"> PassRef(T&);
</span><span class="cx"> PassRef(PassRef&&);
</span><ins>+ template<typename U> PassRef(const Ref<U>&);
</ins><span class="cx"> template<typename U> PassRef(PassRef<U>);
</span><span class="cx">
</span><span class="cx"> const T& get() const;
</span><span class="lines">@@ -98,8 +99,17 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+template<typename T> template<typename U> inline PassRef<T>::PassRef(const Ref<U>& other)
+ : m_reference(const_cast<T&>(other.get()))
</ins><span class="cx"> #ifndef NDEBUG
</span><ins>+ , m_gaveUpReference(false)
+#endif
+{
+ m_reference.ref();
+}
</ins><span class="cx">
</span><ins>+#ifndef NDEBUG
+
</ins><span class="cx"> template<typename T> PassRef<T>::~PassRef()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_gaveUpReference);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (175647 => 175648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-06 00:09:49 UTC (rev 175647)
+++ trunk/Source/WebCore/ChangeLog        2014-11-06 00:16:27 UTC (rev 175648)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-11-05 Chris Dumez <cdumez@apple.com>
+
+ Allow constructing a PassRef from a Ref
+ https://bugs.webkit.org/show_bug.cgi?id=138389
+
+ Reviewed by Andreas Kling.
+
+ Remove calls to Ref::get() now that a PassRef can be directly
+ constructed from a Ref.
+
+ No new tests, no behavior change.
+
+ * css/CSSValuePool.cpp:
+ (WebCore::CSSValuePool::createColorValue):
+ * css/CSSValuePool.h:
+ (WebCore::CSSValuePool::createInheritedValue):
+ (WebCore::CSSValuePool::createImplicitInitialValue):
+ (WebCore::CSSValuePool::createExplicitInitialValue):
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::setCSSStyleSheet):
+
</ins><span class="cx"> 2014-11-05 Dan Bernstein <mitz@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove the unused deletion UI feature
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuePoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValuePool.cpp (175647 => 175648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValuePool.cpp        2014-11-06 00:09:49 UTC (rev 175647)
+++ trunk/Source/WebCore/css/CSSValuePool.cpp        2014-11-06 00:16:27 UTC (rev 175648)
</span><span class="lines">@@ -69,12 +69,12 @@
</span><span class="cx"> {
</span><span class="cx"> // These are the empty and deleted values of the hash table.
</span><span class="cx"> if (rgbValue == Color::transparent)
</span><del>- return m_colorTransparent.get();
</del><ins>+ return m_colorTransparent;
</ins><span class="cx"> if (rgbValue == Color::white)
</span><del>- return m_colorWhite.get();
</del><ins>+ return m_colorWhite;
</ins><span class="cx"> // Just because it is common.
</span><span class="cx"> if (rgbValue == Color::black)
</span><del>- return m_colorBlack.get();
</del><ins>+ return m_colorBlack;
</ins><span class="cx">
</span><span class="cx"> // Remove one entry at random if the cache grows too large.
</span><span class="cx"> const int maximumColorCacheSize = 512;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuePoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValuePool.h (175647 => 175648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValuePool.h        2014-11-06 00:09:49 UTC (rev 175647)
+++ trunk/Source/WebCore/css/CSSValuePool.h        2014-11-06 00:16:27 UTC (rev 175648)
</span><span class="lines">@@ -45,9 +45,9 @@
</span><span class="cx"> public:
</span><span class="cx"> PassRefPtr<CSSValueList> createFontFaceValue(const AtomicString&);
</span><span class="cx"> PassRef<CSSPrimitiveValue> createFontFamilyValue(const String&);
</span><del>- PassRef<CSSInheritedValue> createInheritedValue() { return m_inheritedValue.get(); }
- PassRef<CSSInitialValue> createImplicitInitialValue() { return m_implicitInitialValue.get(); }
- PassRef<CSSInitialValue> createExplicitInitialValue() { return m_explicitInitialValue.get(); }
</del><ins>+ PassRef<CSSInheritedValue> createInheritedValue() { return m_inheritedValue; }
+ PassRef<CSSInitialValue> createImplicitInitialValue() { return m_implicitInitialValue; }
+ PassRef<CSSInitialValue> createExplicitInitialValue() { return m_explicitInitialValue; }
</ins><span class="cx"> PassRef<CSSPrimitiveValue> createIdentifierValue(CSSValueID identifier);
</span><span class="cx"> PassRef<CSSPrimitiveValue> createIdentifierValue(CSSPropertyID identifier);
</span><span class="cx"> PassRef<CSSPrimitiveValue> createColorValue(unsigned rgbValue);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (175647 => 175648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2014-11-06 00:09:49 UTC (rev 175647)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2014-11-06 00:16:27 UTC (rev 175648)
</span><span class="lines">@@ -328,7 +328,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Ref<StyleSheetContents> styleSheet(StyleSheetContents::create(href, parserContext));
</span><del>- m_sheet = CSSStyleSheet::create(styleSheet.get(), this);
</del><ins>+ m_sheet = CSSStyleSheet::create(styleSheet, this);
</ins><span class="cx"> m_sheet->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(m_media));
</span><span class="cx"> m_sheet->setTitle(title());
</span><span class="cx">
</span><span class="lines">@@ -339,7 +339,7 @@
</span><span class="cx"> styleSheet.get().checkLoaded();
</span><span class="cx">
</span><span class="cx"> if (styleSheet.get().isCacheable())
</span><del>- const_cast<CachedCSSStyleSheet*>(cachedStyleSheet)->saveParsedStyleSheet(styleSheet.get());
</del><ins>+ const_cast<CachedCSSStyleSheet*>(cachedStyleSheet)->saveParsedStyleSheet(styleSheet);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool HTMLLinkElement::styleSheetIsLoading() const
</span></span></pre>
</div>
</div>
</body>
</html>