[OS/2] Bug 390075: preliminary OS/2 build break fix for exthandler code, real solution will follow

This commit is contained in:
mozilla@weilbacher.org 2007-08-03 12:06:33 -07:00
Родитель e5886b0e9f
Коммит 2329964412
4 изменённых файлов: 39 добавлений и 30 удалений

Просмотреть файл

@ -39,10 +39,6 @@
*
* ***** END LICENSE BLOCK ***** */
#define INCL_DOS
#include <os2.h>
#include "nsMIMEInfoOS2.h"
#include "nsExternalHelperAppService.h"
#include "nsCExternalHandlerService.h"
@ -156,7 +152,9 @@ NS_IMETHODIMP nsMIMEInfoOS2::LaunchWithURI(nsIURI* aURI)
nsresult nsMIMEInfoOS2::LoadUriInternal(nsIURI * aURL)
{
LOG(("-- nsOSHelperAppService::LoadUriInternal\n"));
// XXX this is just a build break fix, functionality is broken, see bug 390075
#warning nsMIMEInfoOS2::LoadUriInternal is dysfunctional!
// LOG(("-- nsOSHelperAppService::LoadUriInternal\n"));
nsCOMPtr<nsIPref> thePrefsService(do_GetService(NS_PREF_CONTRACTID));
if (!thePrefsService) {
return NS_ERROR_FAILURE;
@ -188,9 +186,10 @@ nsresult nsMIMEInfoOS2::LoadUriInternal(nsIURI * aURL)
char szAppFromINI[CCHMAXPATH];
char szParamsFromINI[MAXINIPARAMLENGTH];
/* did OS2.INI contain application? */
rv = GetApplicationAndParametersFromINI(uProtocol,
szAppFromINI, sizeof(szAppFromINI),
szParamsFromINI, sizeof(szParamsFromINI));
// XXX this is just a build break fix, functionality is broken, see bug 390075
// rv = GetApplicationAndParametersFromINI(uProtocol,
// szAppFromINI, sizeof(szAppFromINI),
// szParamsFromINI, sizeof(szParamsFromINI));
if (NS_SUCCEEDED(rv)) {
applicationName = szAppFromINI;
parameters = szParamsFromINI;

Просмотреть файл

@ -39,6 +39,22 @@
#include "nsMIMEInfoImpl.h"
#include "nsIPref.h" // XX Need to convert Handler code to new pref stuff
#include "nsNetCID.h"
#include "nsEscape.h"
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID); // XXX need to convert to contract id
#define INCL_DOS
#define INCL_DOSMISC
#define INCL_DOSERRORS
#define INCL_WINSHELLDATA
#include <os2.h>
#define MAXINIPARAMLENGTH 1024 // max length of OS/2 INI key for application parameters
#define LOG(args) PR_LOG(mLog, PR_LOG_DEBUG, args)
#define LOG_ENABLED() PR_LOG_TEST(mLog, PR_LOG_DEBUG)
class nsMIMEInfoOS2 : public nsMIMEInfoImpl
{
public:

Просмотреть файл

@ -46,11 +46,9 @@
#include "nsUnicharUtils.h"
#include "nsXPIDLString.h"
#include "nsIURL.h"
#include "nsNetCID.h"
#include "nsIFileStreams.h"
#include "nsILineInputStream.h"
#include "nsILocalFile.h"
#include "nsEscape.h"
#include "nsIProcess.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
@ -61,20 +59,7 @@
#include "prenv.h" // for PR_GetEnv()
#include "nsMIMEInfoOS2.h"
#include "nsAutoPtr.h"
#include <stdlib.h> // for system()
#include "nsIPref.h" // XX Need to convert Handler code to new pref stuff
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID); // XXX need to convert to contract id
#define INCL_DOSMISC
#define INCL_DOSERRORS
#define INCL_WINSHELLDATA
#include <os2.h>
#define MAXINIPARAMLENGTH 1024 // max length of OS/2 INI key for application parameters
#define LOG(args) PR_LOG(mLog, PR_LOG_DEBUG, args)
#define LOG_ENABLED() PR_LOG_TEST(mLog, PR_LOG_DEBUG)
#include <stdlib.h> // for system()
static nsresult
FindSemicolon(nsAString::const_iterator& aSemicolon_iter,
@ -1503,19 +1488,27 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aType,
}
already_AddRefed<nsIHandlerInfo>
nsOSHelperAppService::GetProtocolInfoFromOS(const nsACString &aScheme)
nsOSHelperAppService::GetProtocolInfoFromOS(const nsACString &aScheme,
PRBool *found)
{
NS_ASSERTION(!aScheme.IsEmpty(), "No scheme was specified!");
PRBool exists;
nsresult rv = OSProtocolHandlerExists(nsPromiseFlatCString(aScheme).get(),
&exists);
NS_ENSURE_SUCCESS(rv, nsnull);
found);
if (NS_FAILED(rv))
return nsnull;
nsMIMEInfoOS2 *handlerInfo = new nsMIMEInfoOS2();
nsMIMEInfoOS2 *handlerInfo =
new nsMIMEInfoOS2(aScheme, nsMIMEInfoBase::eProtocolInfo);
NS_ENSURE_TRUE(handlerInfo, nsnull);
NS_ADDREF(handlerInfo);
if (!*found) {
// Code that calls this requires an object regardless if the OS has
// something for us, so we return the empty object.
return handlerInfo;
}
nsAutoString desc;
GetApplicationDescription(aScheme, desc);
handlerInfo->SetDefaultDescription(desc);

Просмотреть файл

@ -62,7 +62,8 @@ public:
already_AddRefed<nsIMIMEInfo> GetMIMEInfoFromOS(const nsACString& aMimeType,
const nsACString& aFileExt,
PRBool *aFound);
already_AddRefed<nsIHandlerInfo> GetProtocolInfoFromOS(const nsACString &aScheme);
already_AddRefed<nsIHandlerInfo> GetProtocolInfoFromOS(const nsACString &aScheme,
PRBool *found);
// override nsIExternalProtocolService methods
NS_IMETHODIMP GetApplicationDescription(const nsACString& aScheme, nsAString& _retval);