diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 3d9634153cd..3a6ecf3cbed 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -518,6 +518,7 @@ using mozilla::dom::indexedDB::IDBWrapperCache; #include "nsIDOMSmsCursor.h" #include "nsIPrivateDOMEvent.h" #include "nsIDOMConnection.h" +#include "nsIDOMMobileConnection.h" #include "mozilla/dom/network/Utils.h" #ifdef MOZ_B2G_RIL @@ -1458,6 +1459,9 @@ static nsDOMClassInfoData sClassInfoData[] = { NS_DEFINE_CLASSINFO_DATA(MozConnection, nsDOMGenericSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) + NS_DEFINE_CLASSINFO_DATA(MozMobileConnection, nsDOMGenericSH, + DOM_DEFAULT_SCRIPTABLE_FLAGS) + NS_DEFINE_CLASSINFO_DATA(CSSFontFaceRule, nsDOMGenericSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(CSSFontFaceStyleDecl, nsCSSStyleDeclSH, @@ -4075,6 +4079,11 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_END + DOM_CLASSINFO_MAP_BEGIN(MozMobileConnection, nsIDOMMozMobileConnection) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozMobileConnection) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) + DOM_CLASSINFO_MAP_END + DOM_CLASSINFO_MAP_BEGIN(CSSFontFaceRule, nsIDOMCSSFontFaceRule) DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFaceRule) DOM_CLASSINFO_MAP_END diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index ceac27ae5bc..4becd364d34 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -436,6 +436,7 @@ DOMCI_CLASS(MozSmsFilter) DOMCI_CLASS(MozSmsCursor) DOMCI_CLASS(MozConnection) +DOMCI_CLASS(MozMobileConnection) // @font-face in CSS DOMCI_CLASS(CSSFontFaceRule) diff --git a/dom/network/src/Makefile.in b/dom/network/src/Makefile.in index 601304da94c..328be793ab6 100644 --- a/dom/network/src/Makefile.in +++ b/dom/network/src/Makefile.in @@ -57,6 +57,7 @@ EXPORTS_mozilla/dom/network = \ CPPSRCS = \ Connection.cpp \ + MobileConnection.cpp \ Utils.cpp \ $(NULL) diff --git a/dom/network/src/MobileConnection.cpp b/dom/network/src/MobileConnection.cpp new file mode 100644 index 00000000000..aee56ac7c0c --- /dev/null +++ b/dom/network/src/MobileConnection.cpp @@ -0,0 +1,97 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "MobileConnection.h" +#include "nsIDOMDOMRequest.h" +#include "nsIDOMClassInfo.h" + +DOMCI_DATA(MozMobileConnection, mozilla::dom::network::MobileConnection) + +namespace mozilla { +namespace dom { +namespace network { + +NS_IMPL_CYCLE_COLLECTION_CLASS(MobileConnection) + +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(MobileConnection, + nsDOMEventTargetHelper) + NS_CYCLE_COLLECTION_TRAVERSE_EVENT_HANDLER(cardstatechange) + NS_CYCLE_COLLECTION_TRAVERSE_EVENT_HANDLER(voicechange) + NS_CYCLE_COLLECTION_TRAVERSE_EVENT_HANDLER(datachange) +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END + +NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(MobileConnection, + nsDOMEventTargetHelper) + NS_CYCLE_COLLECTION_UNLINK_EVENT_HANDLER(cardstatechange) + NS_CYCLE_COLLECTION_UNLINK_EVENT_HANDLER(voicechange) + NS_CYCLE_COLLECTION_UNLINK_EVENT_HANDLER(datachange) +NS_IMPL_CYCLE_COLLECTION_UNLINK_END + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(MobileConnection) + NS_INTERFACE_MAP_ENTRY(nsIDOMMozMobileConnection) + NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMMozMobileConnection) + NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozMobileConnection) +NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper) + +NS_IMPL_ADDREF_INHERITED(MobileConnection, nsDOMEventTargetHelper) +NS_IMPL_RELEASE_INHERITED(MobileConnection, nsDOMEventTargetHelper) + +MobileConnection::MobileConnection() +{ +} + +void +MobileConnection::Init(nsPIDOMWindow* aWindow) +{ + BindToOwner(aWindow); +} + +void +MobileConnection::Shutdown() +{ +} + +// nsIObserver + +NS_IMETHODIMP +MobileConnection::Observe(nsISupports* aSubject, + const char* aTopic, + const PRUnichar* aData) +{ + return NS_OK; +} + +// nsIDOMMozMobileConnection + +NS_IMETHODIMP +MobileConnection::GetCardState(nsAString& cardState) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP +MobileConnection::GetVoice(nsIDOMMozMobileConnectionInfo** voice) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP +MobileConnection::GetData(nsIDOMMozMobileConnectionInfo** data) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP +MobileConnection::GetNetworks(nsIDOMDOMRequest** request) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMPL_EVENT_HANDLER(MobileConnection, cardstatechange) +NS_IMPL_EVENT_HANDLER(MobileConnection, voicechange) +NS_IMPL_EVENT_HANDLER(MobileConnection, datachange) + +} // namespace network +} // namespace dom +} // namespace mozilla diff --git a/dom/network/src/MobileConnection.h b/dom/network/src/MobileConnection.h new file mode 100644 index 00000000000..6e233c4cc91 --- /dev/null +++ b/dom/network/src/MobileConnection.h @@ -0,0 +1,46 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_network_MobileConnection_h +#define mozilla_dom_network_MobileConnection_h + +#include "nsIObserver.h" +#include "nsIDOMMobileConnection.h" +#include "nsDOMEventTargetHelper.h" +#include "nsCycleCollectionParticipant.h" + +namespace mozilla { +namespace dom { +namespace network { + +class MobileConnection : public nsDOMEventTargetHelper + , public nsIDOMMozMobileConnection + , public nsIObserver +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIOBSERVER + NS_DECL_NSIDOMMOZMOBILECONNECTION + + NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + + MobileConnection(); + + void Init(nsPIDOMWindow *aWindow); + void Shutdown(); + + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MobileConnection, + nsDOMEventTargetHelper) + +private: + NS_DECL_EVENT_HANDLER(cardstatechange) + NS_DECL_EVENT_HANDLER(voicechange) + NS_DECL_EVENT_HANDLER(datachange) +}; + +} // namespace network +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_network_MobileConnection_h