Bug 1431752 - Port bug 1411579 to suite: adjust nsIGIOService::GetAppForURIScheme() call. r=IanN
authorBill Gianopoulos <wgianopoulos@gmail.com>
Fri, 19 Jan 2018 06:24:49 -0500
changeset 30034 eadd0577e853c192bdb6f178a0780b6eceec8e2b
parent 30033 54533507e7b21db321817c9afa1d7e7ed86f2025
child 30035 4b11d994f0234cd69ad3b4598c4bcee01c5f3a67
push id2108
push userclokep@gmail.com
push dateMon, 22 Jan 2018 17:53:55 +0000
treeherdercomm-beta@c44930d8ad9b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs1431752, 1411579
Bug 1431752 - Port bug 1411579 to suite: adjust nsIGIOService::GetAppForURIScheme() call. r=IanN
suite/shell/src/nsGNOMEShellService.cpp
--- a/suite/shell/src/nsGNOMEShellService.cpp
+++ b/suite/shell/src/nsGNOMEShellService.cpp
@@ -168,29 +168,32 @@ NS_IMETHODIMP
 nsGNOMEShellService::IsDefaultClient(bool aStartupCheck, uint16_t aApps,
                                      bool* aIsDefaultClient)
 {
   if (aStartupCheck)
     mCheckedThisSessionClient = true;
 
   *aIsDefaultClient = false;
   nsCString handler;
-  nsCOMPtr<nsIGIOMimeApp> app;
+  nsCOMPtr<nsIGIOMimeApp> gioApp;
   nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
   nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
 
   for (unsigned i = 0; i < mozilla::ArrayLength(gProtocols); i++) {
     if (aApps & gProtocols[i].app) {
       nsDependentCString protocol(gProtocols[i].protocol);
       if (giovfs) {
-        giovfs->GetAppForURIScheme(protocol, getter_AddRefs(app));
-        if (!app)
+        nsCOMPtr<nsIHandlerApp> handlerApp;
+        giovfs->GetAppForURIScheme(protocol, getter_AddRefs(handlerApp));
+
+        gioApp = do_QueryInterface(handlerApp);
+        if (!gioApp)
           return NS_OK;
-
-        if (NS_SUCCEEDED(app->GetCommand(handler)) &&
+        
+        if (NS_SUCCEEDED(gioApp->GetCommand(handler)) &&
             !HandlerMatchesAppName(handler.get()))
          return NS_OK;
       }
 
       bool enabled;
       if (gconf &&
           NS_SUCCEEDED(gconf->GetAppForProtocol(protocol, &enabled, handler)) &&
           (!enabled || !HandlerMatchesAppName(handler.get())))