<!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>[201497] trunk/Source/WebCore</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/201497">201497</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-05-29 23:53:36 -0700 (Sun, 29 May 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Transition various Task/Function queues from std::function to NoncopyableFunction.
https://bugs.webkit.org/show_bug.cgi?id=158196
Reviewed by Chris Dumez.
No new tests (Refactor, no behavior change).
* dom/ActiveDOMCallbackMicrotask.cpp:
(WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
* dom/ActiveDOMCallbackMicrotask.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::layoutSizeChanged):
* page/FrameView.cpp:
(WebCore::FrameView::queuePostLayoutCallback):
(WebCore::FrameView::flushPostLayoutTasksQueue):
* page/FrameView.h:
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::postTask):
(WebCore::TaskDispatcher<Timer>::dispatchOneTask):
* platform/GenericTaskQueue.h:
(WebCore::TaskDispatcher::postTask):
(WebCore::GenericTaskQueue::enqueueTask):
* style/StyleTreeResolver.cpp:
(WebCore::Style::postResolutionCallbackQueue):
(WebCore::Style::queuePostResolutionCallback):
(WebCore::Style::suspendMemoryCacheClientCalls):
* style/StyleTreeResolver.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomActiveDOMCallbackMicrotaskcpp">trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.cpp</a></li>
<li><a href="#trunkSourceWebCoredomActiveDOMCallbackMicrotaskh">trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebCoreplatformGenericTaskQueuecpp">trunk/Source/WebCore/platform/GenericTaskQueue.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformGenericTaskQueueh">trunk/Source/WebCore/platform/GenericTaskQueue.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleTreeResolvercpp">trunk/Source/WebCore/style/StyleTreeResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleTreeResolverh">trunk/Source/WebCore/style/StyleTreeResolver.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201496 => 201497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-30 04:30:22 UTC (rev 201496)
+++ trunk/Source/WebCore/ChangeLog        2016-05-30 06:53:36 UTC (rev 201497)
</span><span class="lines">@@ -1,5 +1,39 @@
</span><span class="cx"> 2016-05-29 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><ins>+ Transition various Task/Function queues from std::function to NoncopyableFunction.
+ https://bugs.webkit.org/show_bug.cgi?id=158196
+
+ Reviewed by Chris Dumez.
+
+ No new tests (Refactor, no behavior change).
+
+ * dom/ActiveDOMCallbackMicrotask.cpp:
+ (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
+ * dom/ActiveDOMCallbackMicrotask.h:
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::layoutSizeChanged):
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::queuePostLayoutCallback):
+ (WebCore::FrameView::flushPostLayoutTasksQueue):
+ * page/FrameView.h:
+
+ * platform/GenericTaskQueue.cpp:
+ (WebCore::TaskDispatcher<Timer>::postTask):
+ (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
+ * platform/GenericTaskQueue.h:
+ (WebCore::TaskDispatcher::postTask):
+ (WebCore::GenericTaskQueue::enqueueTask):
+
+ * style/StyleTreeResolver.cpp:
+ (WebCore::Style::postResolutionCallbackQueue):
+ (WebCore::Style::queuePostResolutionCallback):
+ (WebCore::Style::suspendMemoryCacheClientCalls):
+ * style/StyleTreeResolver.h:
+
+2016-05-29 Brady Eidson <beidson@apple.com>
+
</ins><span class="cx"> Make ScriptExecutionContext::Task work in terms of wtf::NoncopyableFunction instead of std::function.
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=158187
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomActiveDOMCallbackMicrotaskcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.cpp (201496 => 201497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.cpp        2016-05-30 04:30:22 UTC (rev 201496)
+++ trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.cpp        2016-05-30 06:53:36 UTC (rev 201497)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask(MicrotaskQueue& queue, ScriptExecutionContext& scriptExecutionContext, std::function<void()>&& task)
</del><ins>+ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask(MicrotaskQueue& queue, ScriptExecutionContext& scriptExecutionContext, NoncopyableFunction<void()>&& task)
</ins><span class="cx"> : ActiveDOMCallback(&scriptExecutionContext)
</span><span class="cx"> , m_queue(queue)
</span><span class="cx"> , m_task(WTFMove(task))
</span></span></pre></div>
<a id="trunkSourceWebCoredomActiveDOMCallbackMicrotaskh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.h (201496 => 201497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.h        2016-05-30 04:30:22 UTC (rev 201496)
+++ trunk/Source/WebCore/dom/ActiveDOMCallbackMicrotask.h        2016-05-30 06:53:36 UTC (rev 201497)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,19 +23,18 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef ActiveDOMCallbackMicrotask_h
-#define ActiveDOMCallbackMicrotask_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "ActiveDOMCallback.h"
</span><span class="cx"> #include "Microtasks.h"
</span><del>-#include <functional>
</del><ins>+#include <wtf/NoncopyableFunction.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class ActiveDOMCallbackMicrotask final : public Microtask, public ActiveDOMCallback {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- WEBCORE_EXPORT ActiveDOMCallbackMicrotask(MicrotaskQueue&, ScriptExecutionContext&, std::function<void()>&&);
</del><ins>+ WEBCORE_EXPORT ActiveDOMCallbackMicrotask(MicrotaskQueue&, ScriptExecutionContext&, NoncopyableFunction<void()>&&);
</ins><span class="cx"> WEBCORE_EXPORT virtual ~ActiveDOMCallbackMicrotask();
</span><span class="cx">
</span><span class="cx"> Result run() override;
</span><span class="lines">@@ -47,9 +46,7 @@
</span><span class="cx"> // be accessed via the ScriptExecutionContext, which should hold a reference to the relevent
</span><span class="cx"> // queue.
</span><span class="cx"> MicrotaskQueue& m_queue;
</span><del>- std::function<void()> m_task;
</del><ins>+ NoncopyableFunction<void()> m_task;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // ActiveDOMCallbackMicrotask_h
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (201496 => 201497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-05-30 04:30:22 UTC (rev 201496)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-05-30 06:53:36 UTC (rev 201497)
</span><span class="lines">@@ -3994,12 +3994,11 @@
</span><span class="cx"> void HTMLMediaElement::layoutSizeChanged()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><del>- RefPtr<HTMLMediaElement> strongThis = this;
- std::function<void()> task = [strongThis] {
- if (ShadowRoot* root = strongThis->userAgentShadowRoot())
</del><ins>+ auto task = [this, protectedThis = Ref<Element>(*this)] {
+ if (ShadowRoot* root = userAgentShadowRoot())
</ins><span class="cx"> root->dispatchEvent(Event::create("resize", false, false));
</span><span class="cx"> };
</span><del>- m_resizeTaskQueue.enqueueTask(task);
</del><ins>+ m_resizeTaskQueue.enqueueTask(WTFMove(task));
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (201496 => 201497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2016-05-30 04:30:22 UTC (rev 201496)
+++ trunk/Source/WebCore/page/FrameView.cpp        2016-05-30 06:53:36 UTC (rev 201497)
</span><span class="lines">@@ -3133,9 +3133,9 @@
</span><span class="cx"> updateEmbeddedObjectsTimerFired();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FrameView::queuePostLayoutCallback(std::function<void()> callback)
</del><ins>+void FrameView::queuePostLayoutCallback(NoncopyableFunction<void()>&& callback)
</ins><span class="cx"> {
</span><del>- m_postLayoutCallbackQueue.append(callback);
</del><ins>+ m_postLayoutCallbackQueue.append(WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FrameView::flushPostLayoutTasksQueue()
</span><span class="lines">@@ -3146,10 +3146,9 @@
</span><span class="cx"> if (!m_postLayoutCallbackQueue.size())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- const auto queue = m_postLayoutCallbackQueue;
- m_postLayoutCallbackQueue.clear();
- for (size_t i = 0; i < queue.size(); ++i)
- queue[i]();
</del><ins>+ Vector<NoncopyableFunction<void()>> queue = WTFMove(m_postLayoutCallbackQueue);
+ for (auto& task : queue)
+ task();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FrameView::performPostLayoutTasks()
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (201496 => 201497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2016-05-30 04:30:22 UTC (rev 201496)
+++ trunk/Source/WebCore/page/FrameView.h        2016-05-30 06:53:36 UTC (rev 201497)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> (C) 1998, 1999 Torben Weis (weis@kde.org)
</span><span class="cx"> (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx"> (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><del>- Copyright (C) 2004-2009, 2014-2015 Apple Inc. All rights reserved.
</del><ins>+ Copyright (C) 2004-2009, 2014-2016 Apple Inc. All rights reserved.
</ins><span class="cx">
</span><span class="cx"> This library is free software; you can redistribute it and/or
</span><span class="cx"> modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -22,8 +22,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef FrameView_h
-#define FrameView_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "AdjustViewSizeOrNot.h"
</span><span class="cx"> #include "Color.h"
</span><span class="lines">@@ -38,6 +37,7 @@
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><span class="cx"> #include <wtf/ListHashSet.h>
</span><ins>+#include <wtf/NoncopyableFunction.h>
</ins><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx"> void scheduleRelayout();
</span><span class="cx"> void scheduleRelayoutOfSubtree(RenderElement&);
</span><span class="cx"> void unscheduleRelayout();
</span><del>- void queuePostLayoutCallback(std::function<void()>);
</del><ins>+ void queuePostLayoutCallback(NoncopyableFunction<void()>&&);
</ins><span class="cx"> bool layoutPending() const;
</span><span class="cx"> bool isInLayout() const { return m_layoutPhase != OutsideLayout; }
</span><span class="cx"> bool isInRenderTreeLayout() const { return m_layoutPhase == InRenderTreeLayout; }
</span><span class="lines">@@ -828,7 +828,7 @@
</span><span class="cx"> ScrollPinningBehavior m_scrollPinningBehavior;
</span><span class="cx">
</span><span class="cx"> IntRect* m_cachedWindowClipRect { nullptr };
</span><del>- Vector<std::function<void()>> m_postLayoutCallbackQueue;
</del><ins>+ Vector<NoncopyableFunction<void()>> m_postLayoutCallbackQueue;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count)
</span><span class="lines">@@ -854,5 +854,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_WIDGET(FrameView, isFrameView())
</span><del>-
-#endif // FrameView_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformGenericTaskQueuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/GenericTaskQueue.cpp (201496 => 201497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/GenericTaskQueue.cpp        2016-05-30 04:30:22 UTC (rev 201496)
+++ trunk/Source/WebCore/platform/GenericTaskQueue.cpp        2016-05-30 06:53:36 UTC (rev 201497)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void TaskDispatcher<Timer>::postTask(std::function<void()> function)
</del><ins>+void TaskDispatcher<Timer>::postTask(NoncopyableFunction<void()>&& function)
</ins><span class="cx"> {
</span><span class="cx"> m_pendingTasks.append(WTFMove(function));
</span><span class="cx"> pendingDispatchers().append(m_weakPtrFactory.createWeakPtr());
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> void TaskDispatcher<Timer>::dispatchOneTask()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!m_pendingTasks.isEmpty());
</span><del>- std::function<void()> task = m_pendingTasks.takeFirst();
</del><ins>+ auto task = m_pendingTasks.takeFirst();
</ins><span class="cx"> task();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformGenericTaskQueueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/GenericTaskQueue.h (201496 => 201497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/GenericTaskQueue.h        2016-05-30 04:30:22 UTC (rev 201496)
+++ trunk/Source/WebCore/platform/GenericTaskQueue.h        2016-05-30 06:53:36 UTC (rev 201497)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,11 +23,11 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef GenericTaskQueue_h
-#define GenericTaskQueue_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "Timer.h"
</span><span class="cx"> #include <wtf/Deque.h>
</span><ins>+#include <wtf/NoncopyableFunction.h>
</ins><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -40,9 +40,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- void postTask(std::function<void()> f)
</del><ins>+ void postTask(NoncopyableFunction<void()>&& f)
</ins><span class="cx"> {
</span><del>- m_context.postTask(f);
</del><ins>+ m_context.postTask(WTFMove(f));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> class TaskDispatcher<Timer> {
</span><span class="cx"> public:
</span><span class="cx"> TaskDispatcher();
</span><del>- void postTask(std::function<void()>);
</del><ins>+ void postTask(NoncopyableFunction<void()>&&);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> static Timer& sharedTimer();
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> void dispatchOneTask();
</span><span class="cx">
</span><span class="cx"> WeakPtrFactory<TaskDispatcher> m_weakPtrFactory;
</span><del>- Deque<std::function<void()>> m_pendingTasks;
</del><ins>+ Deque<NoncopyableFunction<void()>> m_pendingTasks;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> template <typename T>
</span><span class="lines">@@ -81,16 +81,16 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- typedef std::function<void()> TaskFunction;
</del><ins>+ typedef NoncopyableFunction<void()> TaskFunction;
</ins><span class="cx">
</span><del>- void enqueueTask(TaskFunction task)
</del><ins>+ void enqueueTask(TaskFunction&& task)
</ins><span class="cx"> {
</span><span class="cx"> if (m_isClosed)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> ++m_pendingTasks;
</span><span class="cx"> auto weakThis = m_weakPtrFactory.createWeakPtr();
</span><del>- m_dispatcher.postTask([weakThis, task] {
</del><ins>+ m_dispatcher.postTask([weakThis, task = WTFMove(task)] {
</ins><span class="cx"> if (!weakThis)
</span><span class="cx"> return;
</span><span class="cx"> ASSERT(weakThis->m_pendingTasks);
</span><span class="lines">@@ -120,5 +120,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorestyleStyleTreeResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (201496 => 201497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleTreeResolver.cpp        2016-05-30 04:30:22 UTC (rev 201496)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp        2016-05-30 06:53:36 UTC (rev 201497)
</span><span class="lines">@@ -521,15 +521,15 @@
</span><span class="cx"> return WTFMove(m_update);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static Vector<std::function<void ()>>& postResolutionCallbackQueue()
</del><ins>+static Vector<NoncopyableFunction<void ()>>& postResolutionCallbackQueue()
</ins><span class="cx"> {
</span><del>- static NeverDestroyed<Vector<std::function<void ()>>> vector;
</del><ins>+ static NeverDestroyed<Vector<NoncopyableFunction<void ()>>> vector;
</ins><span class="cx"> return vector;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void queuePostResolutionCallback(std::function<void ()> callback)
</del><ins>+void queuePostResolutionCallback(NoncopyableFunction<void ()>&& callback)
</ins><span class="cx"> {
</span><del>- postResolutionCallbackQueue().append(callback);
</del><ins>+ postResolutionCallbackQueue().append(WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void suspendMemoryCacheClientCalls(Document& document)
</span><span class="lines">@@ -540,8 +540,7 @@
</span><span class="cx">
</span><span class="cx"> page->setMemoryCacheClientCallsEnabled(false);
</span><span class="cx">
</span><del>- RefPtr<MainFrame> protectedMainFrame = &page->mainFrame();
- postResolutionCallbackQueue().append([protectedMainFrame]{
</del><ins>+ postResolutionCallbackQueue().append([protectedMainFrame = Ref<MainFrame>(page->mainFrame())] {
</ins><span class="cx"> if (Page* page = protectedMainFrame->page())
</span><span class="cx"> page->setMemoryCacheClientCallsEnabled(true);
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleTreeResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleTreeResolver.h (201496 => 201497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleTreeResolver.h        2016-05-30 04:30:22 UTC (rev 201496)
+++ trunk/Source/WebCore/style/StyleTreeResolver.h        2016-05-30 06:53:36 UTC (rev 201497)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef StyleTreeResolver_h
-#define StyleTreeResolver_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "RenderStyleConstants.h"
</span><span class="cx"> #include "RenderTreePosition.h"
</span><span class="lines">@@ -35,6 +34,7 @@
</span><span class="cx"> #include "StyleUpdate.h"
</span><span class="cx"> #include <functional>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><ins>+#include <wtf/NoncopyableFunction.h>
</ins><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx"> std::unique_ptr<Update> m_update;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-void queuePostResolutionCallback(std::function<void ()>);
</del><ins>+void queuePostResolutionCallback(NoncopyableFunction<void ()>&&);
</ins><span class="cx"> bool postResolutionCallbacksAreSuspended();
</span><span class="cx">
</span><span class="cx"> bool isPlaceholderStyle(const RenderStyle&);
</span><span class="lines">@@ -124,5 +124,3 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif
</del></span></pre>
</div>
</div>
</body>
</html>