Bug 1200477 - Allow building with WebRTC disabled. r=glandium,mrbkap
authorGian-Carlo Pascutto <gcp@mozilla.com>
Fri, 18 Sep 2015 08:29:14 +0200
changeset 295800 5b52aac3102684d57140b1eda99f56eb37b4f285
parent 295799 fd3d3205f92cc03c41fd79d35fb80f8466e7dcf4
child 295801 7641104770a80015e63597b58cb312fefcbd9ab4
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, mrbkap
bugs1200477
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1200477 - Allow building with WebRTC disabled. r=glandium,mrbkap
dom/media/systemservices/ShmemPool.cpp
dom/media/systemservices/moz.build
ipc/glue/BackgroundChildImpl.cpp
ipc/glue/BackgroundParentImpl.cpp
--- a/dom/media/systemservices/ShmemPool.cpp
+++ b/dom/media/systemservices/ShmemPool.cpp
@@ -6,16 +6,17 @@
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Logging.h"
 #include "mozilla/ShmemPool.h"
 #include "mozilla/Move.h"
 
 #undef LOG
 #undef LOG_ENABLED
+extern PRLogModuleInfo *gCamerasParentLog;
 #define LOG(args) MOZ_LOG(gCamerasParentLog, mozilla::LogLevel::Debug, args)
 #define LOG_ENABLED() MOZ_LOG_TEST(gCamerasParentLog, mozilla::LogLevel::Debug)
 
 namespace mozilla {
 
 ShmemPool::ShmemPool(size_t aPoolSize)
   : mMutex("mozilla::ShmemPool"),
     mPoolFree(aPoolSize)
--- a/dom/media/systemservices/moz.build
+++ b/dom/media/systemservices/moz.build
@@ -1,31 +1,31 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 if CONFIG['MOZ_WEBRTC']:
-    EXPORTS += ['CamerasChild.h',
-                'CamerasParent.h',
-                'CamerasUtils.h',
-                'LoadManager.h',
-                'LoadManagerFactory.h',
-                'LoadMonitor.h',
+    EXPORTS += [
+        'CamerasChild.h',
+        'CamerasParent.h',
+        'CamerasUtils.h',
+        'LoadManager.h',
+        'LoadManagerFactory.h',
+        'LoadMonitor.h',
     ]
-    UNIFIED_SOURCES += ['CamerasChild.cpp',
-                        'CamerasParent.cpp',
-                        'CamerasUtils.cpp',
-                        'LoadManager.cpp',
-                        'LoadManagerFactory.cpp',
-                        'LoadMonitor.cpp',
-    ]
-    IPDL_SOURCES = [
-        'PCameras.ipdl',
+    UNIFIED_SOURCES += [
+        'CamerasChild.cpp',
+        'CamerasParent.cpp',
+        'CamerasUtils.cpp',
+        'LoadManager.cpp',
+        'LoadManagerFactory.cpp',
+        'LoadMonitor.cpp',
+        'ShmemPool.cpp',
     ]
     LOCAL_INCLUDES += [
         '/media/webrtc/signaling',
         '/media/webrtc/trunk',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk'):
     EXPORTS += [
@@ -58,27 +58,28 @@ EXPORTS.mozilla.media += ['MediaChild.h'
                           'MediaSystemResourceManager.h',
                           'MediaSystemResourceManagerChild.h',
                           'MediaSystemResourceManagerParent.h',
                           'MediaSystemResourceMessageUtils.h',
                           'MediaSystemResourceService.h',
                           'MediaSystemResourceTypes.h',
                           'MediaUtils.h',
 ]
-UNIFIED_SOURCES += ['MediaChild.cpp',
-                    'MediaParent.cpp',
-                    'MediaSystemResourceClient.cpp',
-                    'MediaSystemResourceManager.cpp',
-                    'MediaSystemResourceManagerChild.cpp',
-                    'MediaSystemResourceManagerParent.cpp',
-                    'MediaSystemResourceService.cpp',
-                    'MediaUtils.cpp',
-                    'ShmemPool.cpp',
+UNIFIED_SOURCES += [
+    'MediaChild.cpp',
+    'MediaParent.cpp',
+    'MediaSystemResourceClient.cpp',
+    'MediaSystemResourceManager.cpp',
+    'MediaSystemResourceManagerChild.cpp',
+    'MediaSystemResourceManagerParent.cpp',
+    'MediaSystemResourceService.cpp',
+    'MediaUtils.cpp',
 ]
 IPDL_SOURCES += [
+    'PCameras.ipdl',
     'PMedia.ipdl',
     'PMediaSystemResourceManager.ipdl',
 ]
 # /dom/base needed for nsGlobalWindow.h in MediaChild.cpp
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
--- a/ipc/glue/BackgroundChildImpl.cpp
+++ b/ipc/glue/BackgroundChildImpl.cpp
@@ -3,17 +3,19 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "BackgroundChildImpl.h"
 
 #include "ActorsChild.h" // IndexedDB
 #include "BroadcastChannelChild.h"
 #include "ServiceWorkerManagerChild.h"
 #include "FileDescriptorSetChild.h"
+#ifdef MOZ_WEBRTC
 #include "CamerasChild.h"
+#endif
 #include "mozilla/media/MediaChild.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/dom/PBlobChild.h"
 #include "mozilla/dom/asmjscache/AsmJSCache.h"
 #include "mozilla/dom/cache/ActorUtils.h"
 #include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
 #include "mozilla/dom/ipc/BlobChild.h"
 #include "mozilla/dom/MessagePortChild.h"
@@ -266,27 +268,33 @@ BackgroundChildImpl::DeallocPBroadcastCh
     dont_AddRef(static_cast<dom::BroadcastChannelChild*>(aActor));
   MOZ_ASSERT(child);
   return true;
 }
 
 camera::PCamerasChild*
 BackgroundChildImpl::AllocPCamerasChild()
 {
+#ifdef MOZ_WEBRTC
   nsRefPtr<camera::CamerasChild> agent =
     new camera::CamerasChild();
   return agent.forget().take();
+#else
+  return nullptr;
+#endif
 }
 
 bool
 BackgroundChildImpl::DeallocPCamerasChild(camera::PCamerasChild *aActor)
 {
+#ifdef MOZ_WEBRTC
   nsRefPtr<camera::CamerasChild> child =
       dont_AddRef(static_cast<camera::CamerasChild*>(aActor));
   MOZ_ASSERT(aActor);
+#endif
   return true;
 }
 
 // -----------------------------------------------------------------------------
 // ServiceWorkerManager
 // -----------------------------------------------------------------------------
 
 dom::PServiceWorkerManagerChild*
--- a/ipc/glue/BackgroundParentImpl.cpp
+++ b/ipc/glue/BackgroundParentImpl.cpp
@@ -1,17 +1,19 @@
 /* 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 "BackgroundParentImpl.h"
 
 #include "BroadcastChannelParent.h"
 #include "FileDescriptorSetParent.h"
+#ifdef MOZ_WEBRTC
 #include "CamerasParent.h"
+#endif
 #include "mozilla/media/MediaParent.h"
 #include "mozilla/AppProcessChecker.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/NuwaParent.h"
 #include "mozilla/dom/PBlobParent.h"
 #include "mozilla/dom/MessagePortParent.h"
 #include "mozilla/dom/ServiceWorkerRegistrar.h"
@@ -285,30 +287,36 @@ BackgroundParentImpl::DeallocPVsyncParen
 }
 
 camera::PCamerasParent*
 BackgroundParentImpl::AllocPCamerasParent()
 {
   AssertIsInMainProcess();
   AssertIsOnBackgroundThread();
 
+#ifdef MOZ_WEBRTC
   nsRefPtr<mozilla::camera::CamerasParent> actor =
       mozilla::camera::CamerasParent::Create();
   return actor.forget().take();
+#else
+  return nullptr;
+#endif
 }
 
 bool
 BackgroundParentImpl::DeallocPCamerasParent(camera::PCamerasParent *aActor)
 {
   AssertIsInMainProcess();
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(aActor);
 
+#ifdef MOZ_WEBRTC
   nsRefPtr<mozilla::camera::CamerasParent> actor =
       dont_AddRef(static_cast<mozilla::camera::CamerasParent*>(aActor));
+#endif
   return true;
 }
 
 namespace {
 
 class InitUDPSocketParentCallback final : public nsRunnable
 {
 public: