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

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

Issue 793913002: Stub implementation for PushRegistration.unregister(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@mvan_6
Patch Set: rebase Created 6 years 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
Index: Source/bindings/core/v8/CallbackPromiseAdapter.h
diff --git a/Source/bindings/core/v8/CallbackPromiseAdapter.h b/Source/bindings/core/v8/CallbackPromiseAdapter.h
index 3e6d4a0562e9cd19c59cffa599bb0fac98b99c47..df1c724b4f09e99c51de904a79b19e6888095a17 100644
--- a/Source/bindings/core/v8/CallbackPromiseAdapter.h
+++ b/Source/bindings/core/v8/CallbackPromiseAdapter.h
@@ -170,6 +170,35 @@ private:
WTF_MAKE_NONCOPYABLE(CallbackPromiseAdapter);
};
+template<>
+class CallbackPromiseAdapter<bool, void> final : public blink::WebCallbacks<bool, void> {
+public:
+ explicit CallbackPromiseAdapter(PassRefPtr<ScriptPromiseResolver> resolver)
+ : m_resolver(resolver)
+ {
+ ASSERT(m_resolver);
+ }
+ virtual ~CallbackPromiseAdapter() { }
+
+ virtual void onSuccess(bool* result) override
+ {
+ if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped())
+ return;
+ m_resolver->resolve(*result);
+ }
+
+ virtual void onError() override
+ {
+ if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped())
+ return;
+ m_resolver->reject();
+ }
+
+private:
+ RefPtr<ScriptPromiseResolver> m_resolver;
+ WTF_MAKE_NONCOPYABLE(CallbackPromiseAdapter);
jochen (gone - plz use gerrit) 2014/12/12 14:26:11 blink style is to have this right after the "class
mlamouri (slow - plz ping) 2014/12/15 10:55:07 Yeah. I was actually following the style of the fi
+};
+
} // namespace blink
#endif

Powered by Google App Engine
This is Rietveld 408576698