diff --git a/dom/cellbroadcast/CellBroadcast.cpp b/dom/cellbroadcast/CellBroadcast.cpp index 46606e9784ea..26314e39e2e4 100644 --- a/dom/cellbroadcast/CellBroadcast.cpp +++ b/dom/cellbroadcast/CellBroadcast.cpp @@ -9,7 +9,12 @@ #include "mozilla/dom/MozCellBroadcastEvent.h" #include "nsServiceManagerUtils.h" -#define NS_CELLBROADCASTSERVICE_CONTRACTID "@mozilla.org/cellbroadcast/gonkservice;1" +// Service instantiation +#include "ipc/CellBroadcastIPCService.h" +#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) +#include "nsIGonkCellBroadcastService.h" +#endif +#include "nsXULAppAPI.h" // For XRE_GetProcessType() using namespace mozilla::dom; using mozilla::ErrorResult; @@ -60,7 +65,7 @@ CellBroadcast::Create(nsPIDOMWindow* aWindow, ErrorResult& aRv) MOZ_ASSERT(aWindow->IsInnerWindow()); nsCOMPtr service = - do_GetService(NS_CELLBROADCASTSERVICE_CONTRACTID); + do_GetService(CELLBROADCAST_SERVICE_CONTRACTID); if (!service) { aRv.Throw(NS_ERROR_UNEXPECTED); return nullptr; @@ -86,7 +91,7 @@ CellBroadcast::~CellBroadcast() mListener->Disconnect(); nsCOMPtr service = - do_GetService(NS_CELLBROADCASTSERVICE_CONTRACTID); + do_GetService(CELLBROADCAST_SERVICE_CONTRACTID); if (service) { service->UnregisterListener(mListener); } @@ -140,3 +145,19 @@ CellBroadcast::NotifyMessageReceived(uint32_t aServiceId, MozCellBroadcastEvent::Constructor(this, NS_LITERAL_STRING("received"), init); return DispatchTrustedEvent(event); } + +already_AddRefed +NS_CreateCellBroadcastService() +{ + nsCOMPtr service; + + if (XRE_GetProcessType() == GeckoProcessType_Content) { + service = new mozilla::dom::cellbroadcast::CellBroadcastIPCService(); +#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) + } else { + service = do_GetService(GONK_CELLBROADCAST_SERVICE_CONTRACTID); +#endif + } + + return service.forget(); +} diff --git a/dom/cellbroadcast/interfaces/nsICellBroadcastService.idl b/dom/cellbroadcast/interfaces/nsICellBroadcastService.idl index 645eb3bbb02d..33a2e796969c 100644 --- a/dom/cellbroadcast/interfaces/nsICellBroadcastService.idl +++ b/dom/cellbroadcast/interfaces/nsICellBroadcastService.idl @@ -26,6 +26,13 @@ interface nsICellBroadcastListener : nsISupports in boolean aEtwsPopup); }; +%{C++ +#define CELLBROADCAST_SERVICE_CID \ + { 0xc870bdca, 0x277c, 0x11e4, { 0xac, 0xa3, 0x33, 0x73, 0xa1, 0xef, 0x48, 0xf8 } } +#define CELLBROADCAST_SERVICE_CONTRACTID \ + "@mozilla.org/cellbroadcast/cellbroadcastservice;1" +%} + /** * XPCOM component that provides the cell broadcast information. */ @@ -45,4 +52,11 @@ interface nsICellBroadcastService : nsISupports */ void registerListener(in nsICellBroadcastListener listener); void unregisterListener(in nsICellBroadcastListener listener); -}; \ No newline at end of file +}; + +%{C++ +template struct already_AddRefed; + +already_AddRefed +NS_CreateCellBroadcastService(); +%} diff --git a/dom/cellbroadcast/interfaces/nsIGonkCellBroadcastService.idl b/dom/cellbroadcast/interfaces/nsIGonkCellBroadcastService.idl index 2ccc9075c003..8db7a6ecb874 100644 --- a/dom/cellbroadcast/interfaces/nsIGonkCellBroadcastService.idl +++ b/dom/cellbroadcast/interfaces/nsIGonkCellBroadcastService.idl @@ -4,6 +4,11 @@ #include "nsICellBroadcastService.idl" +%{C++ +#define GONK_CELLBROADCAST_SERVICE_CONTRACTID \ + "@mozilla.org/cellbroadcast/gonkservice;1" +%} + [scriptable, uuid(f72ced60-21f9-11e4-8896-6fdff2f5c909)] interface nsIGonkCellBroadcastService : nsICellBroadcastService { diff --git a/dom/cellbroadcast/ipc/CellBroadcastIPCService.cpp b/dom/cellbroadcast/ipc/CellBroadcastIPCService.cpp new file mode 100644 index 000000000000..4f3bebbd5bd6 --- /dev/null +++ b/dom/cellbroadcast/ipc/CellBroadcastIPCService.cpp @@ -0,0 +1,110 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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 "CellBroadcastIPCService.h" +#include "mozilla/dom/ContentChild.h" + +namespace mozilla { +namespace dom { +namespace cellbroadcast { + +NS_IMPL_ISUPPORTS(CellBroadcastIPCService, nsICellBroadcastService) + +CellBroadcastIPCService::CellBroadcastIPCService() + : mActorDestroyed(false) +{ + ContentChild::GetSingleton()->SendPCellBroadcastConstructor(this); +} + +CellBroadcastIPCService::~CellBroadcastIPCService() +{ + if (!mActorDestroyed) { + Send__delete__(this); + } + + mListeners.Clear(); +} + +/* + * Implementation of nsICellBroadcastService. + */ + +NS_IMETHODIMP +CellBroadcastIPCService::RegisterListener(nsICellBroadcastListener* aListener) +{ + MOZ_ASSERT(!mListeners.Contains(aListener)); + + NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_UNEXPECTED); + + // nsTArray doesn't fail. + mListeners.AppendElement(aListener); + + return NS_OK; +} + +NS_IMETHODIMP +CellBroadcastIPCService::UnregisterListener(nsICellBroadcastListener* aListener) +{ + MOZ_ASSERT(mListeners.Contains(aListener)); + + NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_UNEXPECTED); + + // We always have the element here, so it can't fail. + mListeners.RemoveElement(aListener); + + return NS_OK; +} + +/* + * Implementation of PCellBroadcastChild. + */ + +bool +CellBroadcastIPCService::RecvNotifyReceivedMessage(const uint32_t& aServiceId, + const nsString& aGsmGeographicalScope, + const uint16_t& aMessageCode, + const uint16_t& aMessageId, + const nsString& aLanguage, + const nsString& aBody, + const nsString& aMessageClass, + const uint64_t& aTimestamp, + const uint32_t& aCdmaServiceCategory, + const bool& aHasEtwsInfo, + const nsString& aEtwsWarningType, + const bool& aEtwsEmergencyUserAlert, + const bool& aEtwsPopup) +{ + // UnregisterListener() could be triggered in + // nsICellBroadcastListener::NotifyMessageReceived(). + // Make a immutable copy for notifying the event. + nsTArray> immutableListeners(mListeners); + for (uint32_t i = 0; i < immutableListeners.Length(); i++) { + immutableListeners[i]->NotifyMessageReceived(aServiceId, + aGsmGeographicalScope, + aMessageCode, + aMessageId, + aLanguage, + aBody, + aMessageClass, + aTimestamp, + aCdmaServiceCategory, + aHasEtwsInfo, + aEtwsWarningType, + aEtwsEmergencyUserAlert, + aEtwsPopup); + } + + return true; +} + +void +CellBroadcastIPCService::ActorDestroy(ActorDestroyReason aWhy) +{ + mActorDestroyed = true; +} + +} // namespace cellbroadcast +} // namespace dom +} // namespace mozilla diff --git a/dom/cellbroadcast/ipc/CellBroadcastIPCService.h b/dom/cellbroadcast/ipc/CellBroadcastIPCService.h new file mode 100644 index 000000000000..63034fef5b31 --- /dev/null +++ b/dom/cellbroadcast/ipc/CellBroadcastIPCService.h @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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_cellbroadcast_CellBroadcastIPCService_h +#define mozilla_dom_cellbroadcast_CellBroadcastIPCService_h + +#include "mozilla/dom/cellbroadcast/PCellBroadcastChild.h" +#include "nsICellBroadcastService.h" +#include "nsCOMPtr.h" +#include "nsTArray.h" + +namespace mozilla { +namespace dom { +namespace cellbroadcast { + +class CellBroadcastIPCService MOZ_FINAL : public PCellBroadcastChild + , public nsICellBroadcastService + +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSICELLBROADCASTSERVICE + + CellBroadcastIPCService(); + + // PCellBroadcastChild interface + virtual bool + RecvNotifyReceivedMessage(const uint32_t& aServiceId, + const nsString& aGsmGeographicalScope, + const uint16_t& aMessageCode, + const uint16_t& aMessageId, + const nsString& aLanguage, + const nsString& aBody, + const nsString& aMessageClass, + const uint64_t& aTimestamp, + const uint32_t& aCdmaServiceCategory, + const bool& aHasEtwsInfo, + const nsString& aEtwsWarningType, + const bool& aEtwsEmergencyUserAlert, + const bool& aEtwsPopup) MOZ_OVERRIDE; + + virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; + +private: + // MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor + ~CellBroadcastIPCService(); + + bool mActorDestroyed; + nsTArray> mListeners; +}; + +} // namespace cellbroadcast +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_cellbroadcast_CellBroadcastIPCService_h \ No newline at end of file diff --git a/dom/cellbroadcast/ipc/CellBroadcastParent.cpp b/dom/cellbroadcast/ipc/CellBroadcastParent.cpp new file mode 100644 index 000000000000..17f9138a2274 --- /dev/null +++ b/dom/cellbroadcast/ipc/CellBroadcastParent.cpp @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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 "mozilla/dom/cellbroadcast/CellBroadcastParent.h" +#include "nsServiceManagerUtils.h" + +namespace mozilla { +namespace dom { +namespace cellbroadcast { + +NS_IMPL_ISUPPORTS(CellBroadcastParent, nsICellBroadcastListener) + +bool +CellBroadcastParent::Init() +{ + nsCOMPtr service = + do_GetService(CELLBROADCAST_SERVICE_CONTRACTID); + + if (service) { + return NS_SUCCEEDED(service->RegisterListener(this)); + } + + return false; +} + +void +CellBroadcastParent::ActorDestroy(ActorDestroyReason aWhy) +{ + nsCOMPtr service = + do_GetService(CELLBROADCAST_SERVICE_CONTRACTID); + if (service) { + service->UnregisterListener(this); + } +} + +/* + * nsICellBroadcastListener + */ +NS_IMETHODIMP +CellBroadcastParent::NotifyMessageReceived(uint32_t aServiceId, + const nsAString& aGsmGeographicalScope, + uint16_t aMessageCode, + uint16_t aMessageId, + const nsAString& aLanguage, + const nsAString& aBody, + const nsAString& aMessageClass, + DOMTimeStamp aTimestamp, + uint32_t aCdmaServiceCategory, + bool aHasEtwsInfo, + const nsAString& aEtwsWarningType, + bool aEtwsEmergencyUserAlert, + bool aEtwsPopup) +{ + return SendNotifyReceivedMessage(aServiceId, + nsString(aGsmGeographicalScope), + aMessageCode, + aMessageId, + nsString(aLanguage), + nsString(aBody), + nsString(aMessageClass), + aTimestamp, + aCdmaServiceCategory, + aHasEtwsInfo, + nsString(aEtwsWarningType), + aEtwsEmergencyUserAlert, + aEtwsPopup) ? NS_OK : NS_ERROR_FAILURE; +} + +} // namespace cellbroadcast +} // namespace dom +} // namespace mozilla \ No newline at end of file diff --git a/dom/cellbroadcast/ipc/CellBroadcastParent.h b/dom/cellbroadcast/ipc/CellBroadcastParent.h new file mode 100644 index 000000000000..b201566a01cc --- /dev/null +++ b/dom/cellbroadcast/ipc/CellBroadcastParent.h @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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_cellbroadcast_CellBroadcastParent_h +#define mozilla_dom_cellbroadcast_CellBroadcastParent_h + +#include "mozilla/dom/cellbroadcast/PCellBroadcastParent.h" +#include "nsICellBroadcastService.h" + +namespace mozilla { +namespace dom { +namespace cellbroadcast { + +class CellBroadcastParent MOZ_FINAL : public PCellBroadcastParent + , public nsICellBroadcastListener +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSICELLBROADCASTLISTENER + + bool Init(); + +private: + // MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor + ~CellBroadcastParent() {}; + + virtual void ActorDestroy(ActorDestroyReason aWhy); +}; + +} // namespace cellbroadcast +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_cellbroadcast_CellBroadcastParent_h \ No newline at end of file diff --git a/dom/cellbroadcast/ipc/PCellBroadcast.ipdl b/dom/cellbroadcast/ipc/PCellBroadcast.ipdl new file mode 100644 index 000000000000..eb95362d16cd --- /dev/null +++ b/dom/cellbroadcast/ipc/PCellBroadcast.ipdl @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set sw=2 ts=8 et ft=cpp : */ +/* 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 protocol PContent; + +namespace mozilla { +namespace dom { +namespace cellbroadcast { + +sync protocol PCellBroadcast { + manager PContent; + +child: + NotifyReceivedMessage(uint32_t aServiceId, + nsString aGsmGeographicalScope, + uint16_t aMessageCode, + uint16_t aMessageId, + nsString aLanguage, + nsString aBody, + nsString aMessageClass, + uint64_t aTimestamp, + uint32_t aCdmaServiceCategory, + bool aHasEtwsInfo, + nsString aEtwsWarningType, + bool aEtwsEmergencyUserAlert, + bool aEtwsPopup); + +parent: + /** + * Sent when the child no longer needs to use cellbroadcast. + */ + __delete__(); + +}; + +} // namespace mobilemessage +} // namespace dom +} // namespace cellbroadcast \ No newline at end of file diff --git a/dom/cellbroadcast/moz.build b/dom/cellbroadcast/moz.build index 1e23e558a51d..7ec56b547daa 100644 --- a/dom/cellbroadcast/moz.build +++ b/dom/cellbroadcast/moz.build @@ -14,6 +14,8 @@ EXPORTS.mozilla.dom += [ SOURCES += [ 'CellBroadcast.cpp', 'CellBroadcastMessage.cpp', + 'ipc/CellBroadcastIPCService.cpp', + 'ipc/CellBroadcastParent.cpp', ] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']: @@ -22,6 +24,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']: 'gonk/CellBroadcastService.manifest', ] +EXPORTS.mozilla.dom.cellbroadcast += [ + 'ipc/CellBroadcastIPCService.h', + 'ipc/CellBroadcastParent.h', +] + +IPDL_SOURCES += [ + 'ipc/PCellBroadcast.ipdl', +] + +include('/ipc/chromium/chromium-config.mozbuild') + FAIL_ON_WARNINGS = True FINAL_LIBRARY = 'xul' diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 2233241d1a56..b5ab830b9890 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -126,6 +126,7 @@ #include "ipc/Nuwa.h" #endif +#include "mozilla/dom/cellbroadcast/CellBroadcastIPCService.h" #include "mozilla/dom/indexedDB/PIndexedDBChild.h" #include "mozilla/dom/mobileconnection/MobileConnectionChild.h" #include "mozilla/dom/mobilemessage/SmsChild.h" @@ -161,6 +162,7 @@ using namespace base; using namespace mozilla; using namespace mozilla::docshell; using namespace mozilla::dom::bluetooth; +using namespace mozilla::dom::cellbroadcast; using namespace mozilla::dom::devicestorage; using namespace mozilla::dom::ipc; using namespace mozilla::dom::mobileconnection; @@ -388,7 +390,7 @@ ConsoleListener::Observe(nsIConsoleMessage* aMessage) { if (!mChild) return NS_OK; - + nsCOMPtr scriptError = do_QueryInterface(aMessage); if (scriptError) { nsString msg, sourceName, sourceLine; @@ -1392,6 +1394,30 @@ ContentChild::DeallocPExternalHelperAppChild(PExternalHelperAppChild* aService) return true; } +PCellBroadcastChild* +ContentChild::AllocPCellBroadcastChild() +{ + MOZ_CRASH("No one should be allocating PCellBroadcastChild actors"); +} + +PCellBroadcastChild* +ContentChild::SendPCellBroadcastConstructor(PCellBroadcastChild* aActor) +{ + aActor = PContentChild::SendPCellBroadcastConstructor(aActor); + if (aActor) { + static_cast(aActor)->AddRef(); + } + + return aActor; +} + +bool +ContentChild::DeallocPCellBroadcastChild(PCellBroadcastChild* aActor) +{ + static_cast(aActor)->Release(); + return true; +} + PSmsChild* ContentChild::AllocPSmsChild() { diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index ff5c0464b50a..49bf35ab0acb 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -227,6 +227,10 @@ public: PBrowserChild* aBrowser) MOZ_OVERRIDE; virtual bool DeallocPExternalHelperAppChild(PExternalHelperAppChild *aService) MOZ_OVERRIDE; + virtual PCellBroadcastChild* AllocPCellBroadcastChild() MOZ_OVERRIDE; + PCellBroadcastChild* SendPCellBroadcastConstructor(PCellBroadcastChild* aActor); + virtual bool DeallocPCellBroadcastChild(PCellBroadcastChild* aActor) MOZ_OVERRIDE; + virtual PSmsChild* AllocPSmsChild() MOZ_OVERRIDE; virtual bool DeallocPSmsChild(PSmsChild*) MOZ_OVERRIDE; diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 89923b6f301c..98c3c22ddfce 100755 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -49,6 +49,7 @@ #include "mozilla/dom/FileSystemRequestParent.h" #include "mozilla/dom/GeolocationBinding.h" #include "mozilla/dom/FileDescriptorSetParent.h" +#include "mozilla/dom/cellbroadcast/CellBroadcastParent.h" #include "mozilla/dom/mobileconnection/MobileConnectionParent.h" #include "mozilla/dom/mobilemessage/SmsParent.h" #include "mozilla/dom/telephony/TelephonyParent.h" @@ -191,6 +192,7 @@ static const char* sClipboardTextFlavors[] = { kUnicodeMime }; using base::ChildPrivileges; using base::KillProcess; using namespace mozilla::dom::bluetooth; +using namespace mozilla::dom::cellbroadcast; using namespace mozilla::dom::devicestorage; using namespace mozilla::dom::indexedDB; using namespace mozilla::dom::power; @@ -2864,7 +2866,7 @@ ContentParent::KillHard() FROM_HERE, NewRunnableFunction(&ProcessWatcher::EnsureProcessTerminated, OtherProcess(), /*force=*/true)); - //We do clean-up here + //We do clean-up here MessageLoop::current()->PostDelayedTask( FROM_HERE, NewRunnableMethod(this, &ContentParent::ShutDownProcess, @@ -3105,13 +3107,13 @@ ContentParent::AllocPExternalHelperAppParent(const OptionalURIParams& uri, { ExternalHelperAppParent *parent = new ExternalHelperAppParent(uri, aContentLength); parent->AddRef(); - parent->Init(this, - aMimeContentType, + parent->Init(this, + aMimeContentType, aContentDisposition, aContentDispositionHint, aContentDispositionFilename, - aForceSave, - aReferrer, + aForceSave, + aReferrer, aBrowser); return parent; } @@ -3124,6 +3126,31 @@ ContentParent::DeallocPExternalHelperAppParent(PExternalHelperAppParent* aServic return true; } +PCellBroadcastParent* +ContentParent::AllocPCellBroadcastParent() +{ + if (!AssertAppProcessPermission(this, "cellbroadcast")) { + return nullptr; + } + + CellBroadcastParent* actor = new CellBroadcastParent(); + actor->AddRef(); + return actor; +} + +bool +ContentParent::DeallocPCellBroadcastParent(PCellBroadcastParent* aActor) +{ + static_cast(aActor)->Release(); + return true; +} + +bool +ContentParent::RecvPCellBroadcastConstructor(PCellBroadcastParent* aActor) +{ + return static_cast(aActor)->Init(); +} + PSmsParent* ContentParent::AllocPSmsParent() { diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index 22d614593822..79f95d258019 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -474,13 +474,17 @@ private: const nsCString& aMimeContentType, const nsCString& aContentDisposition, const uint32_t& aContentDispositionHint, - const nsString& aContentDispositionFilename, + const nsString& aContentDispositionFilename, const bool& aForceSave, const int64_t& aContentLength, const OptionalURIParams& aReferrer, PBrowserParent* aBrowser) MOZ_OVERRIDE; virtual bool DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService) MOZ_OVERRIDE; + virtual PCellBroadcastParent* AllocPCellBroadcastParent() MOZ_OVERRIDE; + virtual bool DeallocPCellBroadcastParent(PCellBroadcastParent*) MOZ_OVERRIDE; + virtual bool RecvPCellBroadcastConstructor(PCellBroadcastParent* aActor) MOZ_OVERRIDE; + virtual PSmsParent* AllocPSmsParent() MOZ_OVERRIDE; virtual bool DeallocPSmsParent(PSmsParent*) MOZ_OVERRIDE; diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 01bcbadc30ae..96efbaa1b4af 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -9,6 +9,7 @@ include protocol PBackground; include protocol PBlob; include protocol PBluetooth; include protocol PBrowser; +include protocol PCellBroadcast; include protocol PCompositor; include protocol PContentBridge; include protocol PCycleCollectWithLogs; @@ -41,6 +42,11 @@ include PTabContext; include URIParams; include ProtocolTypes; +// Workaround to prevent error if PContentChild.cpp & PContentBridgeParent.cpp +// are put into different UnifiedProtocolsXX.cpp files. +// XXX Remove this once bug 1069073 is fixed +include "mozilla/dom/PContentBridgeParent.h"; + using GeoPosition from "nsGeoPositionIPCSerialiser.h"; using struct ChromePackage from "mozilla/chrome/RegistryMessageUtils.h"; @@ -321,6 +327,7 @@ intr protocol PContent manages PBlob; manages PBluetooth; manages PBrowser; + manages PCellBroadcast; manages PCrashReporter; manages PCycleCollectWithLogs; manages PDeviceStorageRequest; @@ -533,6 +540,8 @@ parent: float systemDefaultScale, bool success); + PCellBroadcast(); + PSms(); PSpeechSynthesis(); @@ -583,11 +592,11 @@ parent: CloseAlert(nsString name, Principal principal); - PExternalHelperApp(OptionalURIParams uri, + PExternalHelperApp(OptionalURIParams uri, nsCString aMimeContentType, - nsCString aContentDisposition, - uint32_t aContentDispositionHint, - nsString aContentDispositionFilename, + nsCString aContentDisposition, + uint32_t aContentDispositionHint, + nsString aContentDispositionFilename, bool aForceSave, int64_t aContentLength, OptionalURIParams aReferrer, @@ -600,7 +609,7 @@ parent: ConsoleMessage(nsString message); ScriptError(nsString message, nsString sourceName, nsString sourceLine, uint32_t lineNumber, uint32_t colNumber, uint32_t flags, - nsCString category); + nsCString category); // nsIPermissionManager messages sync ReadPermissions() returns (Permission[] permissions); diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index c8f163caa791..e0ad0f35c1ee 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -214,6 +214,7 @@ static void Shutdown(); #endif #include "nsCSPService.h" #include "nsCSPContext.h" +#include "nsICellBroadcastService.h" #include "nsISmsService.h" #include "nsIMmsService.h" #include "nsIMobileConnectionService.h" @@ -318,6 +319,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback) #endif #endif NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init) +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsICellBroadcastService, + NS_CreateCellBroadcastService) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsISmsService, NS_CreateSmsService) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMmsService, NS_CreateMmsService) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMobileMessageService, @@ -764,6 +767,7 @@ NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CID); NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID); #endif #endif +NS_DEFINE_NAMED_CID(CELLBROADCAST_SERVICE_CID); NS_DEFINE_NAMED_CID(SMS_SERVICE_CID); NS_DEFINE_NAMED_CID(MMS_SERVICE_CID); NS_DEFINE_NAMED_CID(MOBILE_MESSAGE_SERVICE_CID); @@ -1057,6 +1061,7 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { #endif { &kTHIRDPARTYUTIL_CID, false, nullptr, ThirdPartyUtilConstructor }, { &kNS_STRUCTUREDCLONECONTAINER_CID, false, nullptr, nsStructuredCloneContainerConstructor }, + { &kCELLBROADCAST_SERVICE_CID, false, nullptr, nsICellBroadcastServiceConstructor }, { &kSMS_SERVICE_CID, false, nullptr, nsISmsServiceConstructor }, { &kMMS_SERVICE_CID, false, nullptr, nsIMmsServiceConstructor }, { &kMOBILE_MESSAGE_SERVICE_CID, false, nullptr, nsIMobileMessageServiceConstructor }, @@ -1215,6 +1220,7 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { #endif { THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID }, { NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_CID }, + { CELLBROADCAST_SERVICE_CONTRACTID, &kCELLBROADCAST_SERVICE_CID }, { SMS_SERVICE_CONTRACTID, &kSMS_SERVICE_CID }, { MMS_SERVICE_CONTRACTID, &kMMS_SERVICE_CID }, { MOBILE_MESSAGE_SERVICE_CONTRACTID, &kMOBILE_MESSAGE_SERVICE_CID },