Bumping manifests a=b2g-bump
[gecko.git] / dom / mobilemessage / MobileMessageCallback.h
blob9d876c668f6d1e4925764fb50be1f38373a4b6c2
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_mobilemessage_MobileMessageCallback_h
7 #define mozilla_dom_mobilemessage_MobileMessageCallback_h
9 #include "nsIMobileMessageCallback.h"
10 #include "nsCOMPtr.h"
11 #include "DOMRequest.h"
13 class nsIDOMMozMmsMessage;
14 class Promise;
16 namespace mozilla {
17 namespace dom {
18 namespace mobilemessage {
20 class MobileMessageCallback MOZ_FINAL : public nsIMobileMessageCallback
22 public:
23 NS_DECL_ISUPPORTS
24 NS_DECL_NSIMOBILEMESSAGECALLBACK
26 explicit MobileMessageCallback(DOMRequest* aDOMRequest);
27 explicit MobileMessageCallback(Promise* aPromise);
29 private:
30 ~MobileMessageCallback();
32 nsRefPtr<DOMRequest> mDOMRequest;
33 nsRefPtr<Promise> mPromise;
35 nsresult NotifySuccess(JS::Handle<JS::Value> aResult, bool aAsync = false);
36 nsresult NotifySuccess(nsISupports *aMessage, bool aAsync = false);
37 nsresult NotifyError(int32_t aError, DOMError *aDetailedError = nullptr, bool aAsync = false);
40 } // namespace mobilemessage
41 } // namespace dom
42 } // namespace mozilla
44 #endif // mozilla_dom_mobilemessage_MobileMessageCallback_h