Title: [178824] trunk/Source/WebKit2
- Revision
- 178824
- Author
- [email protected]
- Date
- 2015-01-21 08:55:40 -0800 (Wed, 21 Jan 2015)
Log Message
Clean up ViewUpdateDispatcher
https://bugs.webkit.org/show_bug.cgi?id=140619
Reviewed by Darin Adler.
* WebProcess/WebPage/ViewUpdateDispatcher.cpp:
(WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
Replace WTF::bind() with a C++ lambda.
(WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
Use WTF::move() to move the HashMap member into the local variable.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (178823 => 178824)
--- trunk/Source/WebKit2/ChangeLog 2015-01-21 10:20:53 UTC (rev 178823)
+++ trunk/Source/WebKit2/ChangeLog 2015-01-21 16:55:40 UTC (rev 178824)
@@ -1,3 +1,16 @@
+2015-01-21 Zan Dobersek <[email protected]>
+
+ Clean up ViewUpdateDispatcher
+ https://bugs.webkit.org/show_bug.cgi?id=140619
+
+ Reviewed by Darin Adler.
+
+ * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
+ (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
+ Replace WTF::bind() with a C++ lambda.
+ (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
+ Use WTF::move() to move the HashMap member into the local variable.
+
2015-01-21 Csaba Osztrogonác <[email protected]>
Remove ENABLE(INSPECTOR) ifdef guards
Modified: trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp (178823 => 178824)
--- trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp 2015-01-21 10:20:53 UTC (rev 178823)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp 2015-01-21 16:55:40 UTC (rev 178824)
@@ -67,19 +67,23 @@
else
iterator->value.visibleContentRectUpdateInfo = visibleContentRectUpdateInfo;
}
- if (updateListWasEmpty)
- RunLoop::main().dispatch(bind(&ViewUpdateDispatcher::dispatchVisibleContentRectUpdate, this));
+ if (updateListWasEmpty) {
+ RefPtr<ViewUpdateDispatcher> protector(this);
+ RunLoop::main().dispatch([protector] {
+ protector->dispatchVisibleContentRectUpdate();
+ });
+ }
}
void ViewUpdateDispatcher::dispatchVisibleContentRectUpdate()
{
- HashMap<uint64_t, UpdateData> localCopy;
+ HashMap<uint64_t, UpdateData> update;
{
SpinLockHolder locker(&m_dataMutex);
- localCopy.swap(m_latestUpdate);
+ update = WTF::move(m_latestUpdate);
}
- for (auto& slot : localCopy) {
+ for (auto& slot : update) {
if (WebPage* webPage = WebProcess::shared().webPage(slot.key))
webPage->updateVisibleContentRects(slot.value.visibleContentRectUpdateInfo, slot.value.oldestTimestamp);
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes