Bug 1600454 - Fix build with --disable-webspeech. r=smaug
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 01 Dec 2019 01:30:11 +0000
changeset 566634 8504d70d827261346737af1cbe9b96acf6756b6d
parent 566633 76d464c781b2ba2f322f5e061d12d8ce9bce71e8
child 566635 54864920e1632b4e17fb7541d019a1d8777e8dfd
push id12351
push userffxbld-merge
push dateMon, 02 Dec 2019 11:32:26 +0000
treeherdermozilla-beta@dba4410526a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1600454
milestone72.0a1
first release with
nightly linux32
8504d70d8272 / 72.0a1 / 20191201093732 / files
nightly linux64
8504d70d8272 / 72.0a1 / 20191201093732 / files
nightly mac
8504d70d8272 / 72.0a1 / 20191201093732 / files
nightly win32
8504d70d8272 / 72.0a1 / 20191201093732 / files
nightly win64
8504d70d8272 / 72.0a1 / 20191201093732 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1600454 - Fix build with --disable-webspeech. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D55365
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/PContent.ipdl
dom/media/webspeech/synth/moz.build
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -2249,32 +2249,26 @@ PBenchmarkStorageChild* ContentChild::Al
 }
 
 bool ContentChild::DeallocPBenchmarkStorageChild(
     PBenchmarkStorageChild* aActor) {
   delete aActor;
   return true;
 }
 
+#ifdef MOZ_WEBSPEECH
 PSpeechSynthesisChild* ContentChild::AllocPSpeechSynthesisChild() {
-#ifdef MOZ_WEBSPEECH
   MOZ_CRASH("No one should be allocating PSpeechSynthesisChild actors");
-#else
-  return nullptr;
-#endif
 }
 
 bool ContentChild::DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor) {
-#ifdef MOZ_WEBSPEECH
   delete aActor;
   return true;
-#else
-  return false;
+}
 #endif
-}
 
 PWebrtcGlobalChild* ContentChild::AllocPWebrtcGlobalChild() {
 #ifdef MOZ_WEBRTC
   auto* child = new WebrtcGlobalChild();
   return child;
 #else
   return nullptr;
 #endif
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -285,19 +285,20 @@ class ContentChild final : public PConte
   mozilla::ipc::IPCResult RecvNotifyPresentationReceiverLaunched(
       PBrowserChild* aIframe, const nsString& aSessionId);
 
   mozilla::ipc::IPCResult RecvNotifyPresentationReceiverCleanUp(
       const nsString& aSessionId);
 
   mozilla::ipc::IPCResult RecvNotifyEmptyHTTPCache();
 
+#ifdef MOZ_WEBSPEECH
   PSpeechSynthesisChild* AllocPSpeechSynthesisChild();
-
   bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor);
+#endif
 
   mozilla::ipc::IPCResult RecvRegisterChrome(
       nsTArray<ChromePackage>&& packages,
       nsTArray<SubstitutionMapping>&& resources,
       nsTArray<OverrideMapping>&& overrides, const nsCString& locale,
       const bool& reset);
   mozilla::ipc::IPCResult RecvRegisterChromeItem(
       const ChromeRegistryItem& item);
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -3793,45 +3793,35 @@ bool ContentParent::DeallocPPresentation
 mozilla::ipc::IPCResult ContentParent::RecvPPresentationConstructor(
     PPresentationParent* aActor) {
   if (!static_cast<PresentationParent*>(aActor)->Init(mChildID)) {
     return IPC_FAIL_NO_REASON(this);
   }
   return IPC_OK();
 }
 
+#ifdef MOZ_WEBSPEECH
 PSpeechSynthesisParent* ContentParent::AllocPSpeechSynthesisParent() {
-#ifdef MOZ_WEBSPEECH
   return new mozilla::dom::SpeechSynthesisParent();
-#else
-  return nullptr;
-#endif
 }
 
 bool ContentParent::DeallocPSpeechSynthesisParent(
     PSpeechSynthesisParent* aActor) {
-#ifdef MOZ_WEBSPEECH
   delete aActor;
   return true;
-#else
-  return false;
-#endif
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvPSpeechSynthesisConstructor(
     PSpeechSynthesisParent* aActor) {
-#ifdef MOZ_WEBSPEECH
   if (!static_cast<SpeechSynthesisParent*>(aActor)->SendInit()) {
     return IPC_FAIL_NO_REASON(this);
   }
   return IPC_OK();
-#else
-  return IPC_FAIL_NO_REASON(this);
+}
 #endif
-}
 
 mozilla::ipc::IPCResult ContentParent::RecvStartVisitedQueries(
     const nsTArray<URIParams>& aUris) {
   nsCOMPtr<IHistory> history = services::GetHistoryService();
   if (!history) {
     return IPC_OK();
   }
   for (const auto& params : aUris) {
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -915,22 +915,23 @@ class ContentParent final : public PCont
 
   PPresentationParent* AllocPPresentationParent();
 
   bool DeallocPPresentationParent(PPresentationParent* aActor);
 
   virtual mozilla::ipc::IPCResult RecvPPresentationConstructor(
       PPresentationParent* aActor) override;
 
+#ifdef MOZ_WEBSPEECH
   PSpeechSynthesisParent* AllocPSpeechSynthesisParent();
-
   bool DeallocPSpeechSynthesisParent(PSpeechSynthesisParent* aActor);
 
   virtual mozilla::ipc::IPCResult RecvPSpeechSynthesisConstructor(
       PSpeechSynthesisParent* aActor) override;
+#endif
 
   PWebBrowserPersistDocumentParent* AllocPWebBrowserPersistDocumentParent(
       PBrowserParent* aBrowser, const uint64_t& aOuterWindowID);
 
   bool DeallocPWebBrowserPersistDocumentParent(
       PWebBrowserPersistDocumentParent* aActor);
 
   mozilla::ipc::IPCResult RecvGetGfxVars(nsTArray<GfxVarUpdate>* aVars);
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -26,17 +26,19 @@ include protocol PStreamFilter;
 include protocol PGMPContent;
 include protocol PGMPService;
 include protocol PPluginModule;
 include protocol PGMP;
 include protocol PPrinting;
 include protocol PChildToParentStream;
 include protocol PParentToChildStream;
 include protocol POfflineCacheUpdate;
+#ifdef MOZ_WEBSPEECH
 include protocol PSpeechSynthesis;
+#endif
 include protocol PTestShell;
 include protocol PJavaScript;
 include protocol PRemoteSpellcheckEngine;
 include protocol PWebBrowserPersistDocument;
 include protocol PWebrtcGlobal;
 include protocol PWindowGlobal;
 include protocol PPresentation;
 include protocol PURLClassifier;
@@ -356,17 +358,19 @@ nested(upto inside_cpow) sync protocol P
     manages PHeapSnapshotTempFileHelper;
     manages PIPCBlobInputStream;
     manages PMedia;
     manages PNecko;
     manages POfflineCacheUpdate;
     manages PPrinting;
     manages PChildToParentStream;
     manages PParentToChildStream;
+#ifdef MOZ_WEBSPEECH
     manages PSpeechSynthesis;
+#endif
     manages PTestShell;
     manages PJavaScript;
     manages PRemoteSpellcheckEngine;
     manages PWebBrowserPersistDocument;
     manages PWebrtcGlobal;
     manages PPresentation;
     manages PURLClassifier;
     manages PURLClassifierLocal;
@@ -894,17 +898,19 @@ parent:
     async PHeapSnapshotTempFileHelper();
 
     async PNecko();
 
     async PPrinting();
 
     async PChildToParentStream();
 
+#ifdef MOZ_WEBSPEECH
     async PSpeechSynthesis();
+#endif
 
     async PMedia();
 
     async PWebrtcGlobal();
 
     async PPresentation();
 
     async CreateAudioIPCConnection() returns (FileDescOrError fd);
--- a/dom/media/webspeech/synth/moz.build
+++ b/dom/media/webspeech/synth/moz.build
@@ -52,20 +52,20 @@ if CONFIG['MOZ_WEBSPEECH']:
         DIRS += ['cocoa']
 
     if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
         DIRS += ['android']
 
     if CONFIG['MOZ_SYNTH_SPEECHD']:
         DIRS += ['speechd']
 
-IPDL_SOURCES += [
-    'ipc/PSpeechSynthesis.ipdl',
-    'ipc/PSpeechSynthesisRequest.ipdl',
-]
+    IPDL_SOURCES += [
+        'ipc/PSpeechSynthesis.ipdl',
+        'ipc/PSpeechSynthesisRequest.ipdl',
+    ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     'ipc',
 ]