Commit 84f8c9bc authored by Fernando Serboncini's avatar Fernando Serboncini Committed by Commit Bot

Checks FontSelector is being used in the proper place

Bug: 988125
Change-Id: I015694f778f7f8ae2a58a667f45b2aff184abf19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1776221
Auto-Submit: Fernando Serboncini <fserb@chromium.org>
Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Commit-Queue: Fernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691650}
parent 0e7d0745
......@@ -75,6 +75,8 @@ class CORE_EXPORT FontFaceSetDocument final : public FontFaceSet,
protected:
bool InActiveContext() const override;
FontSelector* GetFontSelector() const override {
// TODO(Fserb): tracking down crbug.com/988125, can be DCHECK later.
CHECK(IsMainThread());
return GetDocument()->GetStyleEngine().GetFontSelector();
}
......
......@@ -12,6 +12,7 @@
#include "third_party/blink/renderer/core/css/font_face_set.h"
#include "third_party/blink/renderer/core/css/offscreen_font_selector.h"
#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
#include "third_party/blink/renderer/core/workers/worker_thread.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
......@@ -49,6 +50,8 @@ class CORE_EXPORT FontFaceSetWorker final
protected:
bool InActiveContext() const override { return true; }
FontSelector* GetFontSelector() const override {
// TODO(Fserb): tracking down crbug.com/988125, can be DCHECK later.
CHECK(GetWorker()->GetThread()->IsCurrentThread());
return GetWorker()->GetFontSelector();
}
// For workers, this is always an empty list.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment