michael@0: /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_PromiseNativeHandler_h michael@0: #define mozilla_dom_PromiseNativeHandler_h michael@0: michael@0: #include "nsISupports.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: /* michael@0: * PromiseNativeHandler allows C++ to react to a Promise being rejected/resolved. michael@0: * A PromiseNativeHandler can be appended to a Promise using michael@0: * Promise::AppendNativeHandler(). michael@0: */ michael@0: class PromiseNativeHandler : public nsISupports michael@0: { michael@0: public: michael@0: // NS_IMPL_ISUPPORTS0 in Promise.cpp. michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: virtual ~PromiseNativeHandler() michael@0: { } michael@0: michael@0: virtual void michael@0: ResolvedCallback(JS::Handle aValue) = 0; michael@0: michael@0: virtual void michael@0: RejectedCallback(JS::Handle aValue) = 0; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_PromiseNativeHandler_h