Commit 72dcc15f authored by ksakamoto's avatar ksakamoto Committed by Commit bot

Remove unused parameter from FontFace::loadWithCallback()

The ExecutionContext parameter of loadWithCallback() was a leftover from
the FontLoader cleanup (http://crrev.com/1829403002).

No behavior changes.

Review-Url: https://codereview.chromium.org/2620343003
Cr-Commit-Position: refs/heads/master@{#443182}
parent 4d99af5b
......@@ -388,13 +388,14 @@ ScriptPromise FontFace::fontStatusPromise(ScriptState* scriptState) {
}
ScriptPromise FontFace::load(ScriptState* scriptState) {
loadInternal(scriptState->getExecutionContext());
if (m_status == Unloaded)
m_cssFontFace->load();
return fontStatusPromise(scriptState);
}
void FontFace::loadWithCallback(LoadFontCallback* callback,
ExecutionContext* context) {
loadInternal(context);
void FontFace::loadWithCallback(LoadFontCallback* callback) {
if (m_status == Unloaded)
m_cssFontFace->load();
addCallback(callback);
}
......@@ -407,13 +408,6 @@ void FontFace::addCallback(LoadFontCallback* callback) {
m_callbacks.push_back(callback);
}
void FontFace::loadInternal(ExecutionContext* context) {
if (m_status != Unloaded)
return;
m_cssFontFace->load();
}
FontTraits FontFace::traits() const {
FontStretch stretch = FontStretchNormal;
if (m_stretch) {
......
......@@ -119,7 +119,7 @@ class FontFace : public GarbageCollectedFinalized<FontFace>,
virtual void notifyError(FontFace*) = 0;
DEFINE_INLINE_VIRTUAL_TRACE() {}
};
void loadWithCallback(LoadFontCallback*, ExecutionContext*);
void loadWithCallback(LoadFontCallback*);
void addCallback(LoadFontCallback*);
// ScriptWrappable:
......@@ -153,7 +153,6 @@ class FontFace : public GarbageCollectedFinalized<FontFace>,
bool setPropertyFromStyle(const StylePropertySet&, CSSPropertyID);
bool setPropertyValue(const CSSValue*, CSSPropertyID);
bool setFamilyValue(const CSSValue&);
void loadInternal(ExecutionContext*);
ScriptPromise fontStatusPromise(ScriptState*);
using LoadedProperty = ScriptPromiseProperty<Member<FontFace>,
......
......@@ -58,7 +58,7 @@ class LoadFontPromiseResolver final
return new LoadFontPromiseResolver(faces, scriptState);
}
void loadFonts(ExecutionContext*);
void loadFonts();
ScriptPromise promise() { return m_resolver->promise(); }
void notifyLoaded(FontFace*) override;
......@@ -80,14 +80,14 @@ class LoadFontPromiseResolver final
Member<ScriptPromiseResolver> m_resolver;
};
void LoadFontPromiseResolver::loadFonts(ExecutionContext* context) {
void LoadFontPromiseResolver::loadFonts() {
if (!m_numLoading) {
m_resolver->resolve(m_fontFaces);
return;
}
for (size_t i = 0; i < m_fontFaces.size(); i++)
m_fontFaces[i]->loadWithCallback(this, context);
m_fontFaces[i]->loadWithCallback(this);
}
void LoadFontPromiseResolver::notifyLoaded(FontFace* fontFace) {
......@@ -396,7 +396,7 @@ ScriptPromise FontFaceSet::load(ScriptState* scriptState,
LoadFontPromiseResolver::create(faces, scriptState);
ScriptPromise promise = resolver->promise();
// After this, resolver->promise() may return null.
resolver->loadFonts(getExecutionContext());
resolver->loadFonts();
return promise;
}
......
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