Bug 1487333 - Remove nsIExternalSharingAppService. r=jchen
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 30 Aug 2018 18:54:24 +1000
changeset 434172 6b5dfb276159213aed3f93f6dac6d8ad85fec86e
parent 434171 bfe71056fd0f2f81a824a1b05132c80083eaa754
child 434173 02f33375bc170cc26faeb9284f11d74f653565ea
child 434181 2ce62b711b82d9f5b7718514f912f9728bd821b3
push id34541
push userrgurzau@mozilla.com
push dateFri, 31 Aug 2018 04:05:25 +0000
treeherdermozilla-central@02f33375bc17 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen
bugs1487333
milestone63.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 1487333 - Remove nsIExternalSharingAppService. r=jchen It's unused. The patch also renames nsIExternalSharingAppService.idl as nsISharingHandlerApp.idl, because the only thing left in the file is the declaration of nsISharingHandlerApp.
docshell/build/nsDocShellModule.cpp
uriloader/exthandler/android/nsAndroidHandlerApp.h
uriloader/exthandler/android/nsExternalSharingAppService.cpp
uriloader/exthandler/android/nsExternalSharingAppService.h
uriloader/exthandler/moz.build
uriloader/exthandler/nsIExternalSharingAppService.idl
uriloader/exthandler/nsISharingHandlerApp.idl
uriloader/exthandler/unix/nsExternalSharingAppService.h
--- a/docshell/build/nsDocShellModule.cpp
+++ b/docshell/build/nsDocShellModule.cpp
@@ -23,17 +23,16 @@
 #include "nsPrefetchService.h"
 #include "nsOfflineCacheUpdate.h"
 #include "nsLocalHandlerApp.h"
 #include "ContentHandlerService.h"
 #ifdef MOZ_ENABLE_DBUS
 #include "nsDBusHandlerApp.h"
 #endif
 #if defined(MOZ_WIDGET_ANDROID)
-#include "nsExternalSharingAppService.h"
 #include "nsExternalURLHandlerService.h"
 #endif
 
 // session history
 #include "nsSHEntry.h"
 #include "nsSHEntryShared.h"
 #include "nsSHistory.h"
 
@@ -83,17 +82,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPr
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsOfflineCacheUpdateService,
                                          nsOfflineCacheUpdateService::GetInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsOfflineCacheUpdate)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PlatformLocalHandlerApp_t)
 #ifdef MOZ_ENABLE_DBUS
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDBusHandlerApp)
 #endif
 #if defined(MOZ_WIDGET_ANDROID)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalSharingAppService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalURLHandlerService)
 #endif
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ContentHandlerService, Init)
 
 // session history
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSHEntry)
 
 NS_DEFINE_NAMED_CID(NS_DOCSHELL_CID);
@@ -107,17 +105,16 @@ NS_DEFINE_NAMED_CID(NS_EXTERNALPROTOCOLH
 NS_DEFINE_NAMED_CID(NS_PREFETCHSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_OFFLINECACHEUPDATESERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_OFFLINECACHEUPDATE_CID);
 NS_DEFINE_NAMED_CID(NS_LOCALHANDLERAPP_CID);
 #ifdef MOZ_ENABLE_DBUS
 NS_DEFINE_NAMED_CID(NS_DBUSHANDLERAPP_CID);
 #endif
 #if defined(MOZ_WIDGET_ANDROID)
-NS_DEFINE_NAMED_CID(NS_EXTERNALSHARINGAPPSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_EXTERNALURLHANDLERSERVICE_CID);
 #endif
 NS_DEFINE_NAMED_CID(NS_SHENTRY_CID);
 NS_DEFINE_NAMED_CID(NS_CONTENTHANDLERSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_LOADCONTEXT_CID);
 NS_DEFINE_NAMED_CID(NS_PRIVATELOADCONTEXT_CID);
 
 const mozilla::Module::CIDEntry kDocShellCIDs[] = {
@@ -134,17 +131,16 @@ const mozilla::Module::CIDEntry kDocShel
   { &kNS_PREFETCHSERVICE_CID, false, nullptr, nsPrefetchServiceConstructor },
   { &kNS_OFFLINECACHEUPDATESERVICE_CID, false, nullptr, nsOfflineCacheUpdateServiceConstructor },
   { &kNS_OFFLINECACHEUPDATE_CID, false, nullptr, nsOfflineCacheUpdateConstructor },
   { &kNS_LOCALHANDLERAPP_CID, false, nullptr, PlatformLocalHandlerApp_tConstructor },
 #ifdef MOZ_ENABLE_DBUS
   { &kNS_DBUSHANDLERAPP_CID, false, nullptr, nsDBusHandlerAppConstructor },
 #endif
 #if defined(MOZ_WIDGET_ANDROID)
-  { &kNS_EXTERNALSHARINGAPPSERVICE_CID, false, nullptr, nsExternalSharingAppServiceConstructor },
   { &kNS_EXTERNALURLHANDLERSERVICE_CID, false, nullptr, nsExternalURLHandlerServiceConstructor },
 #endif
   { &kNS_SHENTRY_CID, false, nullptr, nsSHEntryConstructor },
   { &kNS_LOADCONTEXT_CID, false, nullptr, mozilla::CreateTestLoadContext },
   { &kNS_PRIVATELOADCONTEXT_CID, false, nullptr, mozilla::CreatePrivateTestLoadContext },
   { nullptr }
 };
 
@@ -191,17 +187,16 @@ const mozilla::Module::ContractIDEntry k
   { NS_PREFETCHSERVICE_CONTRACTID, &kNS_PREFETCHSERVICE_CID },
   { NS_OFFLINECACHEUPDATESERVICE_CONTRACTID, &kNS_OFFLINECACHEUPDATESERVICE_CID },
   { NS_OFFLINECACHEUPDATE_CONTRACTID, &kNS_OFFLINECACHEUPDATE_CID },
   { NS_LOCALHANDLERAPP_CONTRACTID, &kNS_LOCALHANDLERAPP_CID },
 #ifdef MOZ_ENABLE_DBUS
   { NS_DBUSHANDLERAPP_CONTRACTID, &kNS_DBUSHANDLERAPP_CID },
 #endif
 #if defined(MOZ_WIDGET_ANDROID)
-  { NS_EXTERNALSHARINGAPPSERVICE_CONTRACTID, &kNS_EXTERNALSHARINGAPPSERVICE_CID },
   { NS_EXTERNALURLHANDLERSERVICE_CONTRACTID, &kNS_EXTERNALURLHANDLERSERVICE_CID },
 #endif
   { NS_SHENTRY_CONTRACTID, &kNS_SHENTRY_CID },
   { NS_LOADCONTEXT_CONTRACTID, &kNS_LOADCONTEXT_CID },
   { NS_PRIVATELOADCONTEXT_CONTRACTID, &kNS_PRIVATELOADCONTEXT_CID },
   { nullptr }
 };
 
--- a/uriloader/exthandler/android/nsAndroidHandlerApp.h
+++ b/uriloader/exthandler/android/nsAndroidHandlerApp.h
@@ -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/. */
 
 #ifndef nsAndroidHandlerApp_h
 #define nsAndroidHandlerApp_h
 
 #include "nsMIMEInfoImpl.h"
-#include "nsIExternalSharingAppService.h"
+#include "nsISharingHandlerApp.h"
 
 class nsAndroidHandlerApp : public nsISharingHandlerApp {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIHANDLERAPP
     NS_DECL_NSISHARINGHANDLERAPP
 
     nsAndroidHandlerApp(const nsAString& aName, const nsAString& aDescription,
deleted file mode 100644
--- a/uriloader/exthandler/android/nsExternalSharingAppService.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/* 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 "nsExternalSharingAppService.h"
-
-#include "mozilla/ModuleUtils.h"
-#include "nsIClassInfoImpl.h"
-
-#include "AndroidBridge.h"
-#include "nsArrayUtils.h"
-#include "nsISupportsUtils.h"
-#include "nsComponentManagerUtils.h"
-
-using namespace mozilla;
-
-NS_IMPL_ISUPPORTS(nsExternalSharingAppService, nsIExternalSharingAppService)
-
-nsExternalSharingAppService::nsExternalSharingAppService()
-{
-}
-
-nsExternalSharingAppService::~nsExternalSharingAppService()
-{
-}
-
-NS_IMETHODIMP
-nsExternalSharingAppService::ShareWithDefault(const nsAString & data,
-                                              const nsAString & mime,
-                                              const nsAString & title)
-{
-  NS_NAMED_LITERAL_STRING(sendAction, "android.intent.action.SEND");
-  const nsString emptyString = EmptyString();
-  return java::GeckoAppShell::OpenUriExternal(data,
-      mime, emptyString, emptyString, sendAction, title) ? NS_OK : NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsExternalSharingAppService::GetSharingApps(const nsAString & aMIMEType,
-                                            uint32_t *aLen,
-                                            nsISharingHandlerApp ***aHandlers)
-{
-  nsresult rv;
-  NS_NAMED_LITERAL_STRING(sendAction, "android.intent.action.SEND");
-  nsCOMPtr<nsIMutableArray> array = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-  if (!AndroidBridge::Bridge())
-    return NS_OK;
-  AndroidBridge::Bridge()->GetHandlersForMimeType(aMIMEType, array,
-                                                  nullptr, sendAction);
-  array->GetLength(aLen);
-  *aHandlers =
-    static_cast<nsISharingHandlerApp**>(moz_xmalloc(sizeof(nsISharingHandlerApp*)
-                                                    * *aLen));
-  for (uint32_t i = 0; i < *aLen; i++) {
-    rv = array->QueryElementAt(i, NS_GET_IID(nsISharingHandlerApp),
-                               (void**)(*aHandlers + i));
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-  return NS_OK;
-}
deleted file mode 100644
--- a/uriloader/exthandler/android/nsExternalSharingAppService.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* 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 NS_EXTERNAL_SHARING_APP_SERVICE_H
-#define NS_EXTERNAL_SHARING_APP_SERVICE_H
-#include "nsIExternalSharingAppService.h"
-
-
-#define NS_EXTERNALSHARINGAPPSERVICE_CID                \
-  {0x93e2c46e, 0x0011, 0x434b,                          \
-    {0x81, 0x2e, 0xb6, 0xf3, 0xa8, 0x1e, 0x2a, 0x58}}
-
-class nsExternalSharingAppService final
-  : public nsIExternalSharingAppService
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIEXTERNALSHARINGAPPSERVICE
-
-  nsExternalSharingAppService();
-
-private:
-  ~nsExternalSharingAppService();
-
-};
-
-#endif /*NS_EXTERNAL_SHARING_APP_SERVICE_H */
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -6,20 +6,20 @@
 
 TEST_DIRS += ['tests']
 
 XPIDL_SOURCES += [
     'nsCExternalHandlerService.idl',
     'nsIContentDispatchChooser.idl',
     'nsIExternalHelperAppService.idl',
     'nsIExternalProtocolService.idl',
-    'nsIExternalSharingAppService.idl',
     'nsIExternalURLHandlerService.idl',
     'nsIHandlerService.idl',
     'nsIHelperAppLauncherDialog.idl',
+    'nsISharingHandlerApp.idl',
 ]
 
 XPIDL_MODULE = 'exthandler'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     osdir = 'win'
     LOCAL_INCLUDES += ['win']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
@@ -35,17 +35,16 @@ EXPORTS += [
 
 EXPORTS += [
     'ContentHandlerService.h',
     'nsExternalHelperAppService.h',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     EXPORTS += [ '%s/%s' % (osdir, f) for f in [
-        'nsExternalSharingAppService.h',
         'nsExternalURLHandlerService.h',
     ]]
 
 EXPORTS.mozilla.dom += [
     'ExternalHelperAppChild.h',
     'ExternalHelperAppParent.h',
 ]
 
@@ -83,17 +82,16 @@ else:
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     UNIFIED_SOURCES += [
         'unix/nsGNOMERegistry.cpp',
         'unix/nsMIMEInfoUnix.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     UNIFIED_SOURCES += [
         'android/nsAndroidHandlerApp.cpp',
-        'android/nsExternalSharingAppService.cpp',
         'android/nsExternalURLHandlerService.cpp',
         'android/nsMIMEInfoAndroid.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     UNIFIED_SOURCES += [
         'win/nsMIMEInfoWin.cpp',
     ]
 
rename from uriloader/exthandler/nsIExternalSharingAppService.idl
rename to uriloader/exthandler/nsISharingHandlerApp.idl
--- a/uriloader/exthandler/nsIExternalSharingAppService.idl
+++ b/uriloader/exthandler/nsISharingHandlerApp.idl
@@ -1,28 +1,12 @@
 /* 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 "nsIMIMEInfo.idl"
 
-%{C++
-#define NS_EXTERNALSHARINGAPPSERVICE_CONTRACTID    "@mozilla.org/uriloader/external-sharing-app-service;1"
-%}
-
-
 [scriptable, uuid(7111f769-53ec-41fd-b314-613661d5b6ba)]
 interface nsISharingHandlerApp : nsIHandlerApp
 {
   void share(in AString data, [optional] in AString title);
 };
 
-[scriptable, uuid(cf7d04e5-3892-482e-81bb-073dc1c83f76)]
-interface nsIExternalSharingAppService : nsISupports {
-  void shareWithDefault(in AString data, in AString mime, 
-			[optional] in AString title);
-  
-  void getSharingApps(in AString aMIMEType, 
-		      [optional] out unsigned long aLen,
-		      [array, size_is(aLen), retval] out nsISharingHandlerApp handlerApps);
-};
-
-
deleted file mode 100644
--- a/uriloader/exthandler/unix/nsExternalSharingAppService.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 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 NS_EXTERNAL_SHARING_APP_SERVICE_H
-#define NS_EXTERNAL_SHARING_APP_SERVICE_H
-
-#include "nsIExternalSharingAppService.h"
-#include "nsAutoPtr.h"
-
-class  ShareUiInterface;
-
-#define NS_EXTERNALSHARINGAPPSERVICE_CID \
-  {0xea782c90, 0xc6ec, 0x11df, \
-  {0xbd, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66, 0x74}}
-
-class nsExternalSharingAppService : public nsIExternalSharingAppService
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIEXTERNALSHARINGAPPSERVICE
-
-  nsExternalSharingAppService();
-
-private:
-  ~nsExternalSharingAppService();
-
-protected:
-  nsAutoPtr<ShareUiInterface> mShareUi;
-};
-#endif