Bug 875013: Eliminate VPATH usage in dom/mobilemessage. r=joey
authorVicamo Yang <vyang@mozilla.com>
Thu, 12 Sep 2013 05:17:24 +0200
changeset 146648 fa066cc5c1f99157656baa3610941348631cf91c
parent 146647 6e5cdc0ba2e7753fbb1787bb46a45026bb279dc9
child 146649 db0a833aee39db7c72f266a193d1583a388a08b3
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjoey
bugs875013
milestone26.0a1
Bug 875013: Eliminate VPATH usage in dom/mobilemessage. r=joey
dom/mobilemessage/src/Makefile.in
dom/mobilemessage/src/MmsMessage.cpp
dom/mobilemessage/src/MobileMessageManager.cpp
dom/mobilemessage/src/MobileMessageThread.cpp
dom/mobilemessage/src/SmsFilter.cpp
dom/mobilemessage/src/SmsFilter.h
dom/mobilemessage/src/SmsMessage.cpp
dom/mobilemessage/src/SmsServicesFactory.cpp
dom/mobilemessage/src/ipc/SmsChild.cpp
dom/mobilemessage/src/ipc/SmsParent.cpp
dom/mobilemessage/src/moz.build
--- a/dom/mobilemessage/src/Makefile.in
+++ b/dom/mobilemessage/src/Makefile.in
@@ -1,36 +1,7 @@
 # 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/.
 
-VPATH            = \
-  $(srcdir) \
-  $(srcdir)/ipc \
-  $(NULL)
-
-ifeq (android,$(MOZ_WIDGET_TOOLKIT))
-VPATH += $(srcdir)/android
-else ifdef MOZ_B2G_RIL
-VPATH += $(srcdir)/gonk
-else
-VPATH += $(srcdir)/fallback
-endif
-
 include $(topsrcdir)/dom/dom-config.mk
-
-LOCAL_INCLUDES = \
-  -I$(topsrcdir)/content/events/src \
-  -I$(topsrcdir)/dom/base \
-  $(NULL)
-
-# Add VPATH to LOCAL_INCLUDES so we are going to include the correct backend
-# subdirectory (and the ipc one).
-LOCAL_INCLUDES += $(VPATH:%=-I%)
-
-ifdef MOZ_B2G_RIL
-LOCAL_INCLUDES += \
-  -I$(topsrcdir)/dom/system/gonk \
-  $(NULL)
-endif
-
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
--- a/dom/mobilemessage/src/MmsMessage.cpp
+++ b/dom/mobilemessage/src/MmsMessage.cpp
@@ -3,21 +3,21 @@
  * 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 "MmsMessage.h"
 #include "nsIDOMClassInfo.h"
 #include "jsapi.h" // For OBJECT_TO_JSVAL and JS_NewDateObjectMsec
 #include "jsfriendapi.h" // For js_DateGetMsecSinceEpoch
 #include "nsJSUtils.h"
-#include "Constants.h"
 #include "nsContentUtils.h"
 #include "nsIDOMFile.h"
 #include "nsTArrayHelpers.h"
 #include "mozilla/dom/ContentParent.h"
+#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
 #include "mozilla/dom/mobilemessage/SmsTypes.h"
 #include "nsDOMFile.h"
 
 using namespace mozilla::idl;
 using namespace mozilla::dom::mobilemessage;
 
 DOMCI_DATA(MozMmsMessage, mozilla::dom::MmsMessage)
 
--- a/dom/mobilemessage/src/MobileMessageManager.cpp
+++ b/dom/mobilemessage/src/MobileMessageManager.cpp
@@ -6,17 +6,17 @@
 #include "SmsFilter.h"
 #include "MobileMessageManager.h"
 #include "nsIDOMClassInfo.h"
 #include "nsISmsService.h"
 #include "nsIMmsService.h"
 #include "nsIObserverService.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
-#include "Constants.h"
+#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
 #include "nsIDOMMozSmsEvent.h"
 #include "nsIDOMMozMmsEvent.h"
 #include "nsIDOMMozSmsMessage.h"
 #include "nsIDOMMozMmsMessage.h"
 #include "nsJSUtils.h"
 #include "nsContentUtils.h"
 #include "nsCxPusher.h"
 #include "nsIMobileMessageDatabaseService.h"
--- a/dom/mobilemessage/src/MobileMessageThread.cpp
+++ b/dom/mobilemessage/src/MobileMessageThread.cpp
@@ -4,17 +4,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MobileMessageThread.h"
 #include "nsIDOMClassInfo.h"
 #include "jsapi.h"           // For OBJECT_TO_JSVAL and JS_NewDateObjectMsec
 #include "jsfriendapi.h"     // For js_DateGetMsecSinceEpoch
 #include "nsJSUtils.h"       // For nsDependentJSString
 #include "nsTArrayHelpers.h" // For nsTArrayToJSArray
-#include "Constants.h"       // For MessageType
+#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
 
 
 using namespace mozilla::dom::mobilemessage;
 
 DOMCI_DATA(MozMobileMessageThread, mozilla::dom::MobileMessageThread)
 
 namespace mozilla {
 namespace dom {
--- a/dom/mobilemessage/src/SmsFilter.cpp
+++ b/dom/mobilemessage/src/SmsFilter.cpp
@@ -1,23 +1,22 @@
 /* -*- 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 "SmsFilter.h"
-#include "nsIDOMClassInfo.h"
-#include "Constants.h"
-#include "nsError.h"
-#include "Constants.h"
 #include "jsapi.h"
 #include "jsfriendapi.h" // For js_DateGetMsecSinceEpoch.
 #include "js/Utility.h"
+#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
+#include "nsDOMString.h"
+#include "nsError.h"
+#include "nsIDOMClassInfo.h"
 #include "nsJSUtils.h"
-#include "nsDOMString.h"
 
 using namespace mozilla::dom::mobilemessage;
 
 DOMCI_DATA(MozSmsFilter, mozilla::dom::SmsFilter)
 
 namespace mozilla {
 namespace dom {
 
--- a/dom/mobilemessage/src/SmsFilter.h
+++ b/dom/mobilemessage/src/SmsFilter.h
@@ -3,17 +3,16 @@
  * 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_mobilemessage_SmsFilter_h
 #define mozilla_dom_mobilemessage_SmsFilter_h
 
 #include "mozilla/dom/mobilemessage/SmsTypes.h"
 #include "nsIDOMSmsFilter.h"
-#include "Types.h"
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 namespace dom {
 
 class SmsFilter MOZ_FINAL : public nsIDOMMozSmsFilter
 {
 public:
--- a/dom/mobilemessage/src/SmsMessage.cpp
+++ b/dom/mobilemessage/src/SmsMessage.cpp
@@ -2,17 +2,17 @@
 /* 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 "SmsMessage.h"
 #include "nsIDOMClassInfo.h"
 #include "jsapi.h" // For OBJECT_TO_JSVAL and JS_NewDateObjectMsec
 #include "jsfriendapi.h" // For js_DateGetMsecSinceEpoch
-#include "Constants.h"
+#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
 
 using namespace mozilla::dom::mobilemessage;
 
 DOMCI_DATA(MozSmsMessage, mozilla::dom::SmsMessage)
 
 namespace mozilla {
 namespace dom {
 
--- a/dom/mobilemessage/src/SmsServicesFactory.cpp
+++ b/dom/mobilemessage/src/SmsServicesFactory.cpp
@@ -1,20 +1,26 @@
 /* -*- 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 "SmsServicesFactory.h"
 #include "nsXULAppAPI.h"
-#include "SmsService.h"
-#include "SmsIPCService.h"
-#ifndef MOZ_B2G_RIL
-#include "MobileMessageDatabaseService.h"
-#include "MmsService.h"
+#include "ipc/SmsIPCService.h"
+#ifdef MOZ_WIDGET_ANDROID
+#include "android/MobileMessageDatabaseService.h"
+#include "android/SmsService.h"
+#include "android/MmsService.h"
+#elif defined(MOZ_B2G_RIL)
+#include "gonk/SmsService.h"
+#else
+#include "fallback/MmsService.h"
+#include "fallback/MobileMessageDatabaseService.h"
+#include "fallback/SmsService.h"
 #endif
 #include "nsServiceManagerUtils.h"
 
 #define RIL_MMSSERVICE_CONTRACTID "@mozilla.org/mms/rilmmsservice;1"
 #define RIL_MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID "@mozilla.org/mobilemessage/rilmobilemessagedatabaseservice;1"
 
 namespace mozilla {
 namespace dom {
--- a/dom/mobilemessage/src/ipc/SmsChild.cpp
+++ b/dom/mobilemessage/src/ipc/SmsChild.cpp
@@ -1,20 +1,20 @@
 /* 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 "SmsChild.h"
 #include "SmsMessage.h"
 #include "MmsMessage.h"
 #include "SmsSegmentInfo.h"
-#include "Constants.h"
 #include "nsIObserverService.h"
 #include "mozilla/Services.h"
 #include "mozilla/dom/ContentChild.h"
+#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
 #include "MobileMessageThread.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::dom::mobilemessage;
 
 namespace {
 
--- a/dom/mobilemessage/src/ipc/SmsParent.cpp
+++ b/dom/mobilemessage/src/ipc/SmsParent.cpp
@@ -3,29 +3,29 @@
  * 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 "SmsParent.h"
 #include "nsISmsService.h"
 #include "nsIMmsService.h"
 #include "nsIObserverService.h"
 #include "mozilla/Services.h"
-#include "Constants.h"
 #include "nsIDOMMozSmsMessage.h"
 #include "nsIDOMMozMmsMessage.h"
 #include "mozilla/unused.h"
 #include "SmsMessage.h"
 #include "MmsMessage.h"
 #include "nsIMobileMessageDatabaseService.h"
 #include "SmsFilter.h"
 #include "SmsSegmentInfo.h"
 #include "MobileMessageThread.h"
 #include "nsIDOMFile.h"
 #include "mozilla/dom/ipc/Blob.h"
 #include "mozilla/dom/ContentParent.h"
+#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
 #include "nsContentUtils.h"
 #include "nsTArrayHelpers.h"
 #include "nsCxPusher.h"
 
 namespace mozilla {
 namespace dom {
 namespace mobilemessage {
 
--- a/dom/mobilemessage/src/moz.build
+++ b/dom/mobilemessage/src/moz.build
@@ -1,46 +1,50 @@
 # -*- 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_WIDGET_TOOLKIT'] == 'android':
-    mmsdir = 'android'
-elif CONFIG['MOZ_B2G_RIL']:
-    mmsdir = 'gonk'
-else:
-    mmsdir = 'fallback'
-
 EXPORTS.mozilla.dom.mobilemessage += [
-    'Constants.h',
-    'MobileMessageCallback.h',
-    'MobileMessageService.h',
-    'SmsServicesFactory.h',
-    'Types.h',
+    'Constants.h',            # Required by almost all cpp files
+    'MobileMessageService.h', # Required by nsLayoutModule.cpp
+    'SmsServicesFactory.h',   # Required by nsLayoutModule.cpp
+    'Types.h',                # Required by IPDL SmsTypes.h
     'ipc/SmsChild.h',
     'ipc/SmsParent.h',
 ]
 
-if CONFIG['MOZ_B2G_RIL']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
+    CPP_SOURCES += [
+        'android/MobileMessageDatabaseService.cpp',
+        'android/SmsService.cpp',
+        'android/MmsService.cpp',
+    ]
+elif CONFIG['MOZ_B2G_RIL']:
     EXTRA_JS_MODULES = [
         'gonk/MmsPduHelper.jsm',
         'gonk/WspPduHelper.jsm',
         'gonk/mms_consts.js',
         'gonk/wap_consts.js',
     ]
-else:
-    EXPORTS.mozilla.dom.mobilemessage += [
-        "%s/%s" % (mmsdir, 'MmsService.h'),
-        "%s/%s" % (mmsdir, 'MobileMessageDatabaseService.h'),
+    EXTRA_COMPONENTS += [
+        'gonk/MmsService.js',
+        'gonk/MmsService.manifest',
+        'gonk/MobileMessageDatabaseService.js',
+        'gonk/MobileMessageDatabaseService.manifest',
     ]
     CPP_SOURCES += [
-        'MobileMessageDatabaseService.cpp',
-        'MmsService.cpp',
+        'gonk/SmsService.cpp',
+    ]
+else:
+    CPP_SOURCES += [
+        'fallback/MobileMessageDatabaseService.cpp',
+        'fallback/MmsService.cpp',
+        'fallback/SmsService.cpp',
     ]
 
 EXPORTS.mozilla.dom += [
     'MmsMessage.h',
     'MobileMessageManager.h',
     'SmsFilter.h',
     'SmsMessage.h',
     'SmsSegmentInfo.h',
@@ -49,34 +53,25 @@ EXPORTS.mozilla.dom += [
 CPP_SOURCES += [
     'Constants.cpp',
     'MmsMessage.cpp',
     'MobileMessageCallback.cpp',
     'MobileMessageCursorCallback.cpp',
     'MobileMessageManager.cpp',
     'MobileMessageService.cpp',
     'MobileMessageThread.cpp',
-    'SmsChild.cpp',
     'SmsFilter.cpp',
-    'SmsIPCService.cpp',
     'SmsMessage.cpp',
-    'SmsParent.cpp',
     'SmsSegmentInfo.cpp',
-    'SmsService.cpp',
     'SmsServicesFactory.cpp',
+    'ipc/SmsChild.cpp',
+    'ipc/SmsIPCService.cpp',
+    'ipc/SmsParent.cpp',
 ]
 
-if CONFIG['MOZ_B2G_RIL']:
-    EXTRA_COMPONENTS += [
-        'gonk/MmsService.js',
-        'gonk/MmsService.manifest',
-        'gonk/MobileMessageDatabaseService.js',
-        'gonk/MobileMessageDatabaseService.manifest',
-    ]
-
 IPDL_SOURCES += [
     'ipc/PMobileMessageCursor.ipdl',
     'ipc/PSms.ipdl',
     'ipc/PSmsRequest.ipdl',
     'ipc/SmsTypes.ipdlh',
 ]
 
 FAIL_ON_WARNINGS = True