зеркало из https://github.com/mozilla/gecko-dev.git
[OS/2] Bug 390075: preliminary OS/2 build break fix for exthandler code, real solution will follow
This commit is contained in:
Родитель
e5886b0e9f
Коммит
2329964412
|
@ -39,10 +39,6 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
|
||||||
#define INCL_DOS
|
|
||||||
#include <os2.h>
|
|
||||||
|
|
||||||
#include "nsMIMEInfoOS2.h"
|
#include "nsMIMEInfoOS2.h"
|
||||||
#include "nsExternalHelperAppService.h"
|
#include "nsExternalHelperAppService.h"
|
||||||
#include "nsCExternalHandlerService.h"
|
#include "nsCExternalHandlerService.h"
|
||||||
|
@ -156,7 +152,9 @@ NS_IMETHODIMP nsMIMEInfoOS2::LaunchWithURI(nsIURI* aURI)
|
||||||
|
|
||||||
nsresult nsMIMEInfoOS2::LoadUriInternal(nsIURI * aURL)
|
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));
|
nsCOMPtr<nsIPref> thePrefsService(do_GetService(NS_PREF_CONTRACTID));
|
||||||
if (!thePrefsService) {
|
if (!thePrefsService) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
@ -188,9 +186,10 @@ nsresult nsMIMEInfoOS2::LoadUriInternal(nsIURI * aURL)
|
||||||
char szAppFromINI[CCHMAXPATH];
|
char szAppFromINI[CCHMAXPATH];
|
||||||
char szParamsFromINI[MAXINIPARAMLENGTH];
|
char szParamsFromINI[MAXINIPARAMLENGTH];
|
||||||
/* did OS2.INI contain application? */
|
/* did OS2.INI contain application? */
|
||||||
rv = GetApplicationAndParametersFromINI(uProtocol,
|
// XXX this is just a build break fix, functionality is broken, see bug 390075
|
||||||
szAppFromINI, sizeof(szAppFromINI),
|
// rv = GetApplicationAndParametersFromINI(uProtocol,
|
||||||
szParamsFromINI, sizeof(szParamsFromINI));
|
// szAppFromINI, sizeof(szAppFromINI),
|
||||||
|
// szParamsFromINI, sizeof(szParamsFromINI));
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
applicationName = szAppFromINI;
|
applicationName = szAppFromINI;
|
||||||
parameters = szParamsFromINI;
|
parameters = szParamsFromINI;
|
||||||
|
|
|
@ -39,6 +39,22 @@
|
||||||
|
|
||||||
#include "nsMIMEInfoImpl.h"
|
#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
|
class nsMIMEInfoOS2 : public nsMIMEInfoImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -46,11 +46,9 @@
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nsXPIDLString.h"
|
#include "nsXPIDLString.h"
|
||||||
#include "nsIURL.h"
|
#include "nsIURL.h"
|
||||||
#include "nsNetCID.h"
|
|
||||||
#include "nsIFileStreams.h"
|
#include "nsIFileStreams.h"
|
||||||
#include "nsILineInputStream.h"
|
#include "nsILineInputStream.h"
|
||||||
#include "nsILocalFile.h"
|
#include "nsILocalFile.h"
|
||||||
#include "nsEscape.h"
|
|
||||||
#include "nsIProcess.h"
|
#include "nsIProcess.h"
|
||||||
#include "nsIPrefService.h"
|
#include "nsIPrefService.h"
|
||||||
#include "nsIPrefBranch.h"
|
#include "nsIPrefBranch.h"
|
||||||
|
@ -63,19 +61,6 @@
|
||||||
#include "nsAutoPtr.h"
|
#include "nsAutoPtr.h"
|
||||||
#include <stdlib.h> // for system()
|
#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)
|
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
FindSemicolon(nsAString::const_iterator& aSemicolon_iter,
|
FindSemicolon(nsAString::const_iterator& aSemicolon_iter,
|
||||||
const nsAString::const_iterator& aEnd_iter);
|
const nsAString::const_iterator& aEnd_iter);
|
||||||
|
@ -1503,19 +1488,27 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aType,
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<nsIHandlerInfo>
|
already_AddRefed<nsIHandlerInfo>
|
||||||
nsOSHelperAppService::GetProtocolInfoFromOS(const nsACString &aScheme)
|
nsOSHelperAppService::GetProtocolInfoFromOS(const nsACString &aScheme,
|
||||||
|
PRBool *found)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!aScheme.IsEmpty(), "No scheme was specified!");
|
NS_ASSERTION(!aScheme.IsEmpty(), "No scheme was specified!");
|
||||||
|
|
||||||
PRBool exists;
|
|
||||||
nsresult rv = OSProtocolHandlerExists(nsPromiseFlatCString(aScheme).get(),
|
nsresult rv = OSProtocolHandlerExists(nsPromiseFlatCString(aScheme).get(),
|
||||||
&exists);
|
found);
|
||||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
if (NS_FAILED(rv))
|
||||||
|
return nsnull;
|
||||||
|
|
||||||
nsMIMEInfoOS2 *handlerInfo = new nsMIMEInfoOS2();
|
nsMIMEInfoOS2 *handlerInfo =
|
||||||
|
new nsMIMEInfoOS2(aScheme, nsMIMEInfoBase::eProtocolInfo);
|
||||||
NS_ENSURE_TRUE(handlerInfo, nsnull);
|
NS_ENSURE_TRUE(handlerInfo, nsnull);
|
||||||
NS_ADDREF(handlerInfo);
|
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;
|
nsAutoString desc;
|
||||||
GetApplicationDescription(aScheme, desc);
|
GetApplicationDescription(aScheme, desc);
|
||||||
handlerInfo->SetDefaultDescription(desc);
|
handlerInfo->SetDefaultDescription(desc);
|
||||||
|
|
|
@ -62,7 +62,8 @@ public:
|
||||||
already_AddRefed<nsIMIMEInfo> GetMIMEInfoFromOS(const nsACString& aMimeType,
|
already_AddRefed<nsIMIMEInfo> GetMIMEInfoFromOS(const nsACString& aMimeType,
|
||||||
const nsACString& aFileExt,
|
const nsACString& aFileExt,
|
||||||
PRBool *aFound);
|
PRBool *aFound);
|
||||||
already_AddRefed<nsIHandlerInfo> GetProtocolInfoFromOS(const nsACString &aScheme);
|
already_AddRefed<nsIHandlerInfo> GetProtocolInfoFromOS(const nsACString &aScheme,
|
||||||
|
PRBool *found);
|
||||||
|
|
||||||
// override nsIExternalProtocolService methods
|
// override nsIExternalProtocolService methods
|
||||||
NS_IMETHODIMP GetApplicationDescription(const nsACString& aScheme, nsAString& _retval);
|
NS_IMETHODIMP GetApplicationDescription(const nsACString& aScheme, nsAString& _retval);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче