Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: third_party/WebKit/Source/core/css/FontFace.cpp

Issue 2610593002: Make CSSFontFace::setLoadStatus post a task (Closed)
Patch Set: Revert changes to CSSFontFace and post task in FontFace Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/fontface-properties.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/FontFace.cpp
diff --git a/third_party/WebKit/Source/core/css/FontFace.cpp b/third_party/WebKit/Source/core/css/FontFace.cpp
index f199686ac84782f0a69d487cd8a31fb09e8d7d5d..eed7cbf0e6fd933b497af3f799dccd34ae4f9f7e 100644
--- a/third_party/WebKit/Source/core/css/FontFace.cpp
+++ b/third_party/WebKit/Source/core/css/FontFace.cpp
@@ -54,12 +54,14 @@
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/StyleEngine.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "core/frame/UseCounter.h"
#include "platform/FontFamilyNames.h"
#include "platform/Histogram.h"
#include "platform/SharedBuffer.h"
+#include "platform/WebTaskRunner.h"
namespace blink {
@@ -352,9 +354,13 @@ void FontFace::setLoadStatus(LoadStatusType status) {
if (m_status == Loaded || m_status == Error) {
if (m_loadedProperty) {
- if (m_status == Loaded)
- m_loadedProperty->resolve(this);
- else
+ if (m_status == Loaded) {
+ TaskRunnerHelper::get(TaskType::DOMManipulation, getExecutionContext())
+ ->postTask(BLINK_FROM_HERE,
+ WTF::bind(&LoadedProperty::resolve<FontFace*>,
+ wrapPersistent(m_loadedProperty.get()),
+ wrapPersistent(this)));
+ } else
m_loadedProperty->reject(m_error.get());
Kunihiko Sakamoto 2017/01/10 06:02:12 Need to post a task for rejection too?
adithyas 2017/01/10 17:52:46 Rejection is always asynchronous so we don't have
Kunihiko Sakamoto 2017/01/11 05:25:45 Ah interesting, didn't know that.
adithyas 2017/01/11 17:59:39 Technically, resolution is also always asynchronou
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/fontface-properties.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698