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

Unified Diff: Source/bindings/v8/CallbackPromiseAdapter.h

Issue 236713003: [ServiceWorker, PushMessaging] Use ScriptPromiseResolverWithContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 | « no previous file | Source/bindings/v8/ScriptPromiseResolverWithContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/CallbackPromiseAdapter.h
diff --git a/Source/bindings/v8/CallbackPromiseAdapter.h b/Source/bindings/v8/CallbackPromiseAdapter.h
index af2216728f4ce3a33847aad980f6bb4e410bde02..690648923f54fe8813b40093e73ecd280f95a9eb 100644
--- a/Source/bindings/v8/CallbackPromiseAdapter.h
+++ b/Source/bindings/v8/CallbackPromiseAdapter.h
@@ -31,8 +31,7 @@
#ifndef CallbackPromiseAdapter_h
#define CallbackPromiseAdapter_h
-#include "bindings/v8/NewScriptState.h"
-#include "bindings/v8/ScriptPromiseResolver.h"
+#include "bindings/v8/ScriptPromiseResolverWithContext.h"
#include "public/platform/WebCallbacks.h"
namespace WebCore {
@@ -64,26 +63,24 @@ namespace WebCore {
template<typename S, typename T>
class CallbackPromiseAdapter FINAL : public blink::WebCallbacks<typename S::WebType, typename T::WebType> {
public:
- CallbackPromiseAdapter(PassRefPtr<ScriptPromiseResolver> resolver, ExecutionContext* context)
+ CallbackPromiseAdapter(PassRefPtr<ScriptPromiseResolverWithContext> resolver)
: m_resolver(resolver)
- , m_scriptState(NewScriptState::current(toIsolate(context)))
{
}
virtual ~CallbackPromiseAdapter() { }
virtual void onSuccess(typename S::WebType* result) OVERRIDE
{
- NewScriptState::Scope scope(m_scriptState.get());
- m_resolver->resolve(S::from(m_scriptState.get(), result));
+ v8::HandleScope handleScope(m_resolver->scriptState()->isolate());
+ m_resolver->resolve(S::from(m_resolver->scriptState(), result));
}
virtual void onError(typename T::WebType* error) OVERRIDE
{
- NewScriptState::Scope scope(m_scriptState.get());
- m_resolver->reject(T::from(m_scriptState.get(), error));
+ v8::HandleScope handleScope(m_resolver->scriptState()->isolate());
+ m_resolver->reject(T::from(m_resolver->scriptState(), error));
}
private:
- RefPtr<ScriptPromiseResolver> m_resolver;
- RefPtr<NewScriptState> m_scriptState;
+ RefPtr<ScriptPromiseResolverWithContext> m_resolver;
WTF_MAKE_NONCOPYABLE(CallbackPromiseAdapter);
};
« no previous file with comments | « no previous file | Source/bindings/v8/ScriptPromiseResolverWithContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698