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

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

Issue 297513008: Decrease call sites of ScriptState::current() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | « Source/core/css/FontFace.h ('k') | Source/core/css/FontFace.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/FontFace.cpp
diff --git a/Source/core/css/FontFace.cpp b/Source/core/css/FontFace.cpp
index ddcd552126a7b0349d60213fab43c4e3928768ed..d774a9405a55c635a15fee430a0cc7db56af909c 100644
--- a/Source/core/css/FontFace.cpp
+++ b/Source/core/css/FontFace.cpp
@@ -64,9 +64,9 @@ namespace WebCore {
class FontFaceReadyPromiseResolver {
public:
- static PassOwnPtr<FontFaceReadyPromiseResolver> create(ExecutionContext* context)
+ static PassOwnPtr<FontFaceReadyPromiseResolver> create(ScriptState* scriptState)
{
- return adoptPtr(new FontFaceReadyPromiseResolver(context));
+ return adoptPtr(new FontFaceReadyPromiseResolver(scriptState));
}
void resolve(PassRefPtrWillBeRawPtr<FontFace> fontFace)
@@ -86,8 +86,8 @@ public:
ScriptPromise promise() { return m_resolver->promise(); }
private:
- FontFaceReadyPromiseResolver(ExecutionContext* context)
- : m_resolver(ScriptPromiseResolverWithContext::create(ScriptState::current(toIsolate(context))))
+ FontFaceReadyPromiseResolver(ScriptState* scriptState)
+ : m_resolver(ScriptPromiseResolverWithContext::create(scriptState))
{
}
@@ -389,16 +389,16 @@ void FontFace::setLoadStatus(LoadStatus status)
}
}
-ScriptPromise FontFace::load(ExecutionContext* context)
+ScriptPromise FontFace::load(ScriptState* scriptState)
{
- OwnPtr<FontFaceReadyPromiseResolver> resolver = FontFaceReadyPromiseResolver::create(context);
+ OwnPtr<FontFaceReadyPromiseResolver> resolver = FontFaceReadyPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
if (m_status == Loaded || m_status == Error)
resolver->resolve(this);
else
m_readyResolvers.append(resolver.release());
- loadInternal(context);
+ loadInternal(scriptState->executionContext());
return promise;
}
« no previous file with comments | « Source/core/css/FontFace.h ('k') | Source/core/css/FontFace.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698