Commit ffb320ce authored by Josh Aas's avatar Josh Aas
Browse files

Port xpcom to 64-bit Mac OS X, part 1. b=478687 r=mstange sr=bsmedberg

parent 016861a6
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
/ * Double hashing implementation./a\
 * GENERATED BY js/src/plify_jsdhash.sed -- DO NOT EDIT!!!
\ * GENERATED BY js/src/plify_jsdhash.sed -- DO NOT EDIT!!!
/ * Double hashing, a la Knuth 6./a\
 * GENERATED BY js/src/plify_jsdhash.sed -- DO NOT EDIT!!!
\ * GENERATED BY js/src/plify_jsdhash.sed -- DO NOT EDIT!!!
s/jsdhash_h___/pldhash_h___/
s/jsdhash\.bigdump/pldhash.bigdump/
s/jstypes\.h/nscore.h/
@@ -14,14 +14,18 @@ s/JS_DHASH/PL_DHASH/g
s/JS_DHash/PL_DHash/g
s/JSDHash/PLDHash/g
s/JSHash/PLHash/g
s/uint32  /PRUint32/g
s/\([^U]\)int32  /\1PRInt32/g
s/uint8  /PRUint8/g
s/uint16  /PRUint16/g
s/\([^U]\)int16  /\1PRInt16/g
s/uint32  /PRUint32/g
s/\([^U]\)int8  /\1PRInt8/g
s/\([^U]\)int16  /\1PRInt16/g
s/\([^U]\)int32  /\1PRInt32/g
s/uint8/PRUint8/g
s/uint16/PRUint16/g
s/uint32/PRUint32/g
s/\([^U]\)int8/\1PRInt8/g
s/\([^U]\)int16/\1PRInt16/g
s/\([^U]\)int32/\1PRInt32/g
s/JSBool/PRBool/g
s/extern JS_PUBLIC_API(\([^()]*\))/NS_COM_GLUE \1/
s/JS_PUBLIC_API(\([^()]*\))/\1/
+0 −27
Original line number Diff line number Diff line
@@ -899,33 +899,6 @@ FileSystemDataSource::GetVolumeList(nsISimpleEnumerator** aResult)

    nsCOMPtr<nsIRDFResource> vol;

#ifdef  XP_MAC
    StrFileName     fname;
    HParamBlockRec  pb;
    for (int16 volNum = 1; ; volNum++)
    {
        pb.volumeParam.ioCompletion = NULL;
        pb.volumeParam.ioVolIndex = volNum;
        pb.volumeParam.ioNamePtr = (StringPtr)fname;
        if (PBHGetVInfo(&pb,FALSE) != noErr)
            break;
        FSSpec fss(pb.volumeParam.ioVRefNum, fsRtParID, fname);
        nsCOMPtr<nsILocalFileMac> lf;
        NS_NewLocalFileWithFSSpec(fss, true, getter_AddRefs(lf));

        nsCOMPtr<nsIURI> furi;
        NS_NewFileURI(getter_AddRefs(furi), lf); 

        nsXPIDLCString spec;
        furi->GetSpec(getter_Copies(spec);

        rv = mRDFService->GetResource(spec, getter_AddRefs(vol));
        if (NS_FAILED(rv)) return rv;

        volumes->AppendElement(vol);
    }
#endif

#if defined (XP_WIN) && !defined (WINCE)

    PRInt32         driveType;
+2 −14
Original line number Diff line number Diff line
@@ -158,23 +158,17 @@ SetupMacApplicationDelegate()
  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;

  FSRef ref;
  FSSpec spec;
  // The cast is kind of freaky, but apparently it's what all the beautiful people do.
  OSStatus status = FSPathMakeRef((UInt8 *)[filename fileSystemRepresentation], &ref, NULL);
  if (status != noErr) {
    NS_WARNING("FSPathMakeRef in openFile failed, skipping file open");
    return NO;
  }
  status = FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL, &spec, NULL);
  if (status != noErr) {
    NS_WARNING("FSGetCatalogInfo in openFile failed, skipping file open");
    return NO;
  }

  // Take advantage of the existing "command line" code for Macs.
  nsMacCommandLine& cmdLine = nsMacCommandLine::GetMacCommandLine();
  // We don't actually care about Mac filetypes in this context, just pass a placeholder.
  cmdLine.HandleOpenOneDoc(spec, 'abcd');
  cmdLine.HandleOpenOneDoc(&ref, 'abcd');

  return YES;

@@ -190,23 +184,17 @@ SetupMacApplicationDelegate()
  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;

  FSRef ref;
  FSSpec spec;
  // The cast is kind of freaky, but apparently it's what all the beautiful people do.
  OSStatus status = FSPathMakeRef((UInt8 *)[filename fileSystemRepresentation], &ref, NULL);
  if (status != noErr) {
    NS_WARNING("FSPathMakeRef in printFile failed, skipping printing");
    return NO;
  }
  status = FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL, &spec, NULL);
  if (status != noErr) {
    NS_WARNING("FSGetCatalogInfo in printFile failed, skipping printing");
    return NO;
  }

  // Take advantage of the existing "command line" code for Macs.
  nsMacCommandLine& cmdLine = nsMacCommandLine::GetMacCommandLine();
  // We don't actually care about Mac filetypes in this context, just pass a placeholder.
  cmdLine.HandlePrintOneDoc(spec, 'abcd');
  cmdLine.HandlePrintOneDoc(&ref, 'abcd');

  return YES;

+7 −13
Original line number Diff line number Diff line
@@ -212,16 +212,10 @@ nsresult nsMacCommandLine::AddToCommandLine(const char* inArgText)


//----------------------------------------------------------------------------------------
nsresult nsMacCommandLine::AddToCommandLine(const char* inOptionString, const FSSpec& inFileSpec)
nsresult nsMacCommandLine::AddToCommandLine(const char* inOptionString, const FSRef* inFSRef)
//----------------------------------------------------------------------------------------
{
  // Convert the filespec to a URL.  Avoid using xpcom because this may be
  // called before xpcom startup.
  FSRef fsRef;
  if (::FSpMakeFSRef(&inFileSpec, &fsRef) != noErr)
    return NS_ERROR_FAILURE;

  CFURLRef url = ::CFURLCreateFromFSRef(nsnull, &fsRef);
  CFURLRef url = ::CFURLCreateFromFSRef(nsnull, inFSRef);
  if (!url)
    return NS_ERROR_FAILURE;

@@ -264,11 +258,11 @@ nsresult nsMacCommandLine::AddToEnvironmentVars(const char* inArgText)


//----------------------------------------------------------------------------------------
OSErr nsMacCommandLine::HandleOpenOneDoc(const FSSpec& inFileSpec, OSType inFileType)
OSErr nsMacCommandLine::HandleOpenOneDoc(const FSRef* inFSRef, OSType inFileType)
//----------------------------------------------------------------------------------------
{
  nsCOMPtr<nsILocalFileMac> inFile;
  nsresult rv = NS_NewLocalFileWithFSSpec(&inFileSpec, PR_TRUE, getter_AddRefs(inFile));
  nsresult rv = NS_NewLocalFileWithFSRef(inFSRef, PR_TRUE, getter_AddRefs(inFile));
  if (NS_FAILED(rv))
    return errAEEventNotHandled;

@@ -313,7 +307,7 @@ OSErr nsMacCommandLine::HandleOpenOneDoc(const FSSpec& inFileSpec, OSType inFile
    // add a command-line "-url" argument to the global list. This means that if
    // the app is opened with documents on the mac, they'll be handled the same
    // way as if they had been typed on the command line in Unix or DOS.
    rv = AddToCommandLine("-url", inFileSpec);
    rv = AddToCommandLine("-url", inFSRef);
    return (NS_SUCCEEDED(rv)) ? noErr : errAEEventNotHandled;
  }

@@ -343,7 +337,7 @@ OSErr nsMacCommandLine::HandleOpenOneDoc(const FSSpec& inFileSpec, OSType inFile
}

//----------------------------------------------------------------------------------------
OSErr nsMacCommandLine::HandlePrintOneDoc(const FSSpec& inFileSpec, OSType fileType)
OSErr nsMacCommandLine::HandlePrintOneDoc(const FSRef* inFSRef, OSType fileType)
//----------------------------------------------------------------------------------------
{
  // If  we are starting up the application,
@@ -351,7 +345,7 @@ OSErr nsMacCommandLine::HandlePrintOneDoc(const FSSpec& inFileSpec, OSType fileT
  // the app is opened with documents on the mac, they'll be handled the same
  // way as if they had been typed on the command line in Unix or DOS.
  if (!mStartedUp)
    return AddToCommandLine("-print", inFileSpec);
    return AddToCommandLine("-print", inFSRef);
  
  // Final case: we're not just starting up. How do we handle this?
  NS_NOTYETIMPLEMENTED("Write Me");
+3 −3
Original line number Diff line number Diff line
@@ -65,11 +65,11 @@ public:
  void            SetupCommandLine(int& argc, char**& argv);
  
  nsresult        AddToCommandLine(const char* inArgText);
  nsresult        AddToCommandLine(const char* inOptionString, const FSSpec& inFileSpec);
  nsresult        AddToCommandLine(const char* inOptionString, const FSRef* inFSRef);
  nsresult        AddToEnvironmentVars(const char* inArgText);

  OSErr           HandleOpenOneDoc(const FSSpec& inFileSpec, OSType inFileType);
  OSErr           HandlePrintOneDoc(const FSSpec& inFileSpec, OSType fileType);
  OSErr           HandleOpenOneDoc(const FSRef* inFSRef, OSType inFileType);
  OSErr           HandlePrintOneDoc(const FSRef* inFSRef, OSType fileType);

	OSErr						DispatchURLToNewBrowser(const char* url);

Loading