WIP-1783623-port1524687-suite.patch 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. # HG changeset patch
  2. # User Bill Gianopoulos <wgianopoulos@gmail.com>
  3. # Date 1659988365 0
  4. # Parent 777be37684c4da6a70a6ca92c9d7717def4b2bc5
  5. Bug 1783623 - Convert suite binary components registration to components.conf.
  6. Port Bug 1524687 Part 11 to suite.
  7. diff --git a/suite/components/build/components.conf b/suite/components/build/components.conf
  8. new file mode 100644
  9. --- /dev/null
  10. +++ b/suite/components/build/components.conf
  11. @@ -0,0 +1,44 @@
  12. +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
  13. +# vim: set filetype=python:
  14. +# This Source Code Form is subject to the terms of the Mozilla Public
  15. +# License, v. 2.0. If a copy of the MPL was not distributed with this
  16. +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  17. +
  18. +Classes = []
  19. +
  20. +TOOLKIT = buildconfig.substs['MOZ_WIDGET_TOOLKIT']
  21. +
  22. +shell_service_contracts = [
  23. + '@mozilla.org/suite/shell-service;1',
  24. + '@mozilla.org/toolkit/shell-service;1',
  25. +]
  26. +
  27. +if TOOLKIT == 'gtk':
  28. + Classes += [
  29. + {
  30. + 'cid': '{39b688ec-e308-49e5-be6b-28dc7fcd6154}',
  31. + 'contract_ids': shell_service_contracts,
  32. + 'type': 'nsGNOMEShellService',
  33. + 'headers': ['/comm/suite/components/shell/nsGNOMEShellService.h'],
  34. + 'init_method': 'Init',
  35. + },
  36. + ]
  37. +
  38. +if buildconfig.substs['OS_ARCH'] == 'Darwin':
  39. + Classes += [
  40. + {
  41. + 'cid': '{39b688ec-e308-49e5-be6b-28dc7fcd6154}',
  42. + 'contract_ids': shell_service_contracts,
  43. + 'type': 'nsMacShellService',
  44. + 'headers': ['/comm/suite/components/shell/nsMacShellService.h'],
  45. + },
  46. + ]
  47. +elif buildconfig.substs['OS_ARCH'] == 'WINNT':
  48. + Classes += [
  49. + {
  50. + 'cid': '{39b688ec-e308-49e5-be6b-28dc7fcd6154}',
  51. + 'contract_ids': shell_service_contracts,
  52. + 'type': 'nsWindowsShellService',
  53. + 'headers': ['/comm/suite/components/shell/nsWindowsShellService.h'],
  54. + },
  55. + ]
  56. diff --git a/suite/components/build/moz.build b/suite/components/build/moz.build
  57. --- a/suite/components/build/moz.build
  58. +++ b/suite/components/build/moz.build
  59. @@ -3,18 +3,18 @@
  60. # This Source Code Form is subject to the terms of the Mozilla Public
  61. # License, v. 2.0. If a copy of the MPL was not distributed with this
  62. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  63. EXPORTS += [
  64. "nsSuiteCID.h",
  65. ]
  66. -SOURCES += [
  67. - "nsSuiteModule.cpp",
  68. +XPCOM_MANIFESTS += [
  69. + "components.conf",
  70. ]
  71. Library("suite")
  72. FINAL_LIBRARY = "xul"
  73. LOCAL_INCLUDES += [
  74. "../feeds",
  75. "../migration/src",
  76. diff --git a/suite/components/build/nsSuiteModule.cpp b/suite/components/build/nsSuiteModule.cpp
  77. deleted file mode 100644
  78. --- a/suite/components/build/nsSuiteModule.cpp
  79. +++ /dev/null
  80. @@ -1,87 +0,0 @@
  81. -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  82. -/* This Source Code Form is subject to the terms of the Mozilla Public
  83. - * License, v. 2.0. If a copy of the MPL was not distributed with this
  84. - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  85. -
  86. -#include "mozilla/ModuleUtils.h"
  87. -#include "nsSuiteDirectoryProvider.h"
  88. -#include "nsThunderbirdProfileMigrator.h"
  89. -#include "nsSuiteMigrationCID.h"
  90. -#include "nsNetCID.h"
  91. -#include "nsFeedSniffer.h"
  92. -
  93. -#if defined(XP_WIN)
  94. -#include "nsWindowsShellService.h"
  95. -#elif defined(XP_MACOSX)
  96. -#include "nsMacShellService.h"
  97. -#elif defined(MOZ_WIDGET_GTK)
  98. -#include "nsGNOMEShellService.h"
  99. -#endif
  100. -
  101. -using namespace mozilla;
  102. -/////////////////////////////////////////////////////////////////////////////
  103. -
  104. -#if defined(XP_WIN)
  105. -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowsShellService, Init)
  106. -#elif defined(XP_MACOSX)
  107. -NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
  108. -#elif defined(MOZ_WIDGET_GTK)
  109. -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
  110. -#endif
  111. -NS_GENERIC_FACTORY_CONSTRUCTOR(nsSuiteDirectoryProvider)
  112. -NS_GENERIC_FACTORY_CONSTRUCTOR(nsThunderbirdProfileMigrator)
  113. -NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
  114. -
  115. -#if defined(XP_WIN)
  116. -NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
  117. -#elif defined(XP_MACOSX)
  118. -NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
  119. -#elif defined(MOZ_WIDGET_GTK)
  120. -NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
  121. -#endif
  122. -NS_DEFINE_NAMED_CID(NS_SUITEDIRECTORYPROVIDER_CID);
  123. -NS_DEFINE_NAMED_CID(NS_THUNDERBIRDPROFILEMIGRATOR_CID);
  124. -NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
  125. -
  126. -/////////////////////////////////////////////////////////////////////////////
  127. -
  128. -static const mozilla::Module::CIDEntry kSuiteCIDs[] = {
  129. -#if defined(XP_WIN)
  130. - { &kNS_SHELLSERVICE_CID, false, NULL, nsWindowsShellServiceConstructor },
  131. -#elif defined(XP_MACOSX)
  132. - { &kNS_SHELLSERVICE_CID, false, NULL, nsMacShellServiceConstructor },
  133. -#elif defined(MOZ_WIDGET_GTK)
  134. - { &kNS_SHELLSERVICE_CID, false, NULL, nsGNOMEShellServiceConstructor },
  135. -#endif
  136. - { &kNS_SUITEDIRECTORYPROVIDER_CID, false, NULL, nsSuiteDirectoryProviderConstructor },
  137. - { &kNS_THUNDERBIRDPROFILEMIGRATOR_CID, false, NULL, nsThunderbirdProfileMigratorConstructor },
  138. - { &kNS_FEEDSNIFFER_CID, false, NULL, nsFeedSnifferConstructor },
  139. - { NULL }
  140. -};
  141. -
  142. -static const mozilla::Module::ContractIDEntry kSuiteContracts[] = {
  143. -#if defined(XP_WIN)
  144. - { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
  145. -#elif defined(XP_MACOSX)
  146. - { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
  147. -#elif defined(MOZ_WIDGET_GTK)
  148. - { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
  149. -#endif
  150. - { NS_SUITEDIRECTORYPROVIDER_CONTRACTID, &kNS_SUITEDIRECTORYPROVIDER_CID },
  151. - { NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "thunderbird", &kNS_THUNDERBIRDPROFILEMIGRATOR_CID },
  152. - { NS_FEEDSNIFFER_CONTRACTID, &kNS_FEEDSNIFFER_CID },
  153. - { NULL }
  154. -};
  155. -
  156. -static const mozilla::Module::CategoryEntry kSuiteCategories[] = {
  157. - { XPCOM_DIRECTORY_PROVIDER_CATEGORY, "suite-directory-provider", NS_SUITEDIRECTORYPROVIDER_CONTRACTID },
  158. - { NS_CONTENT_SNIFFER_CATEGORY, "Feed Sniffer", NS_FEEDSNIFFER_CONTRACTID },
  159. - { NULL }
  160. -};
  161. -
  162. -extern const mozilla::Module kSuiteModule = {
  163. - mozilla::Module::kVersion,
  164. - kSuiteCIDs,
  165. - kSuiteContracts,
  166. - kSuiteCategories
  167. -};