Bug 458917 - Windows CE Cleanup. r/sr=stuart+bsmedberg

This commit is contained in:
Doug Turner 2008-10-08 20:51:54 -07:00
parent 34d2ae88fc
commit 996fd0f708
10 changed files with 19 additions and 59 deletions

View File

@ -162,12 +162,6 @@ endif
endif
# the windows ce compiler produces crap when compiling this
# with any optimizations. See bug 304714
ifdef WINCE
MOZ_OPTIMIZE_FLAGS=-Od
endif
ifeq ($(OS_ARCH),WINNT)
ifndef GNU_CXX
ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))

View File

@ -345,7 +345,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
// Create current Date/Time String
if (!mDateFormatter)
mDateFormatter = do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID);
#ifndef WINCE
NS_ENSURE_TRUE(mDateFormatter, NS_ERROR_FAILURE);
nsAutoString formattedDateString;
@ -359,7 +359,6 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
PRUnichar * uStr = ToNewUnicode(formattedDateString);
SetDateTimeStr(uStr); // memory will be freed
}
#endif
// Return our desired size
// Adjustr the reflow size by PrintPreviewScale so the scrollbars end up the

View File

@ -87,10 +87,8 @@
{ 0xa8, 0x16, 0xe6, 0xac, 0x73, 0xa7, 0x04, 0x3c } }
#if defined(XP_MAC) || defined(WINCE)
#if defined(XP_MAC)
#define MAX_REFLOW_DEPTH 75 //setting to 75 to prevent layout from crashing on mac. Bug 55095.
//We will also change this for WinCE as it usually has a strict
//memory upper limit (no vm, ~32mb)
#else
#define MAX_REFLOW_DEPTH 200 //windows and linux (etc) can do much deeper structures.
#endif

View File

@ -377,12 +377,9 @@ nsProfileDirServiceProvider::InitProfileDir(nsIFile *profileDir)
return rv;
}
#if !defined(WINCE)
rv = profileDir->SetPermissions(0700);
if (NS_FAILED(rv))
return rv;
#endif
}
else {
PRBool isDir;

View File

@ -952,7 +952,7 @@ FileSystemDataSource::GetVolumeList(nsISimpleEnumerator** aResult)
}
#endif
#if defined(XP_UNIX) || defined(XP_BEOS)
#if defined(XP_UNIX) || defined(XP_BEOS) || defined(WINCE)
mRDFService->GetResource(NS_LITERAL_CSTRING("file:///"), getter_AddRefs(vol));
volumes->AppendElement(vol);
#endif

View File

@ -99,7 +99,7 @@
#include "nsThreadUtils.h"
#include "nsTObserverArray.h"
#if !defined(WINCE) && !defined(XP_OS2)
#if !defined(XP_OS2)
#include "nsWindowsRegKey.h"
#endif
@ -281,7 +281,7 @@ void XXXNeverCalled()
nsXPCOMCycleCollectionParticipant();
nsCycleCollector_collect();
#if !defined(WINCE) && !defined(XP_OS2)
#if !defined(XP_OS2)
NS_NewWindowsRegKey(nsnull);
#endif

View File

@ -127,7 +127,7 @@ NS_DECL_CLASSINFO(nsStringInputStream)
#include "SpecialSystemDirectory.h"
#if defined(XP_WIN) && !defined(WINCE)
#if defined(XP_WIN)
#include "nsWindowsRegKey.h"
#endif
@ -438,7 +438,7 @@ static const nsModuleComponentInfo components[] = {
COMPONENT(UUID_GENERATOR, nsUUIDGeneratorConstructor),
#if defined(XP_WIN) && !defined(WINCE)
#if defined(XP_WIN)
COMPONENT(WINDOWSREGKEY, nsWindowsRegKeyConstructor),
#endif

View File

@ -124,7 +124,7 @@ static HINSTANCE gShell32DLLInst = NULL;
NS_COM void StartupSpecialSystemDirectory()
{
#if defined (XP_WIN) && !defined (WINCE)
#if defined (XP_WIN)
// SHGetKnownFolderPath is only available on Windows Vista
// so that we need to use GetProcAddress to get the pointer.
gShell32DLLInst = LoadLibrary("Shell32.dll");
@ -522,8 +522,8 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory,
#endif
case OS_TemporaryDirectory:
#if defined (XP_WIN) && !defined (WINCE)
{
#if defined (XP_WIN)
{
DWORD len = ::GetTempPathW(MAX_PATH, path);
if (len == 0)
break;
@ -531,12 +531,6 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory,
PR_TRUE,
aFile);
}
#elif defined (WINCE)
{
return NS_NewNativeLocalFile(NS_LITERAL_CSTRING("\\Temp"),
PR_TRUE,
aFile);
}
#elif defined(XP_OS2)
{
char *tPath = PR_GetEnv("TMP");

View File

@ -85,11 +85,7 @@
#endif
// define default product directory
#ifdef WINCE
#define DEFAULT_PRODUCT_DIR NS_LITERAL_CSTRING("Mozilla")
#else
#define DEFAULT_PRODUCT_DIR NS_LITERAL_CSTRING(MOZ_USER_DIR)
#endif
// Locally defined keys used by nsAppDirectoryEnumerator
#define NS_ENV_PLUGINS_DIR "EnvPlugins" // env var MOZ_PLUGIN_PATH
@ -350,15 +346,6 @@ NS_METHOD nsAppFileLocationProvider::GetProductDirectory(nsILocalFile **aLocalFi
if (NS_FAILED(rv)) return rv;
rv = directoryService->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(localDir));
if (NS_FAILED(rv)) return rv;
#elif defined(WINCE)
nsCOMPtr<nsIProperties> directoryService =
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
directoryService->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(localDir));
if (localDir)
rv = localDir->AppendNative(NS_LITERAL_CSTRING("profile"));
if (NS_FAILED(rv)) return rv;
#elif defined(XP_WIN)
nsCOMPtr<nsIProperties> directoryService =
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);

View File

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -95,6 +95,7 @@ unsigned char *_mbsstr( const unsigned char *str,
}
#endif
#ifndef WINCE
class nsDriveEnumerator : public nsISimpleEnumerator
{
public:
@ -116,7 +117,6 @@ private:
//----------------------------------------------------------------------------
// short cut resolver
//----------------------------------------------------------------------------
#ifndef WINCE
class ShortcutResolver
{
public:
@ -227,6 +227,7 @@ static void NS_DestroyShortcutResolver()
delete gResolver;
gResolver = nsnull;
}
#endif
@ -2579,6 +2580,7 @@ nsLocalFile::GetDirectoryEntries(nsISimpleEnumerator * *entries)
nsresult rv;
*entries = nsnull;
#ifndef WINCE
if (mWorkingPath.EqualsLiteral("\\\\.")) {
nsDriveEnumerator *drives = new nsDriveEnumerator;
if (!drives)
@ -2592,6 +2594,7 @@ nsLocalFile::GetDirectoryEntries(nsISimpleEnumerator * *entries)
*entries = drives;
return NS_OK;
}
#endif
PRBool isDir;
rv = IsDirectory(&isDir);
@ -2612,6 +2615,7 @@ nsLocalFile::GetDirectoryEntries(nsISimpleEnumerator * *entries)
}
*entries = dirEnum;
return NS_OK;
}
@ -2961,6 +2965,7 @@ nsLocalFile::GlobalShutdown()
#endif
}
#ifndef WINCE
NS_IMPL_ISUPPORTS1(nsDriveEnumerator, nsISimpleEnumerator)
nsDriveEnumerator::nsDriveEnumerator()
@ -2974,9 +2979,6 @@ nsDriveEnumerator::~nsDriveEnumerator()
nsresult nsDriveEnumerator::Init()
{
#ifdef WINCE
return NS_OK;
#else
/* If the length passed to GetLogicalDriveStrings is smaller
* than the length of the string it would return, it returns
* the length required for the string. */
@ -2988,26 +2990,16 @@ nsresult nsDriveEnumerator::Init()
return NS_ERROR_FAILURE;
mLetter = mDrives.get();
return NS_OK;
#endif
}
NS_IMETHODIMP nsDriveEnumerator::HasMoreElements(PRBool *aHasMore)
{
#ifdef WINCE
*aHasMore = FALSE;
#else
*aHasMore = *mLetter != '\0';
#endif
return NS_OK;
}
NS_IMETHODIMP nsDriveEnumerator::GetNext(nsISupports **aNext)
{
#ifdef WINCE
nsILocalFile *file;
nsresult rv = NS_NewLocalFile(NS_LITERAL_STRING("\\"), PR_FALSE, &file);
*aNext = file;
#else
/* GetLogicalDrives stored in mLetter is a concatenation
* of null terminated strings, followed by a null terminator. */
if (!*mLetter) {
@ -3017,11 +3009,10 @@ NS_IMETHODIMP nsDriveEnumerator::GetNext(nsISupports **aNext)
NS_ConvertASCIItoUTF16 drive(mLetter);
mLetter += drive.Length() + 1;
nsILocalFile *file;
nsresult rv =
NS_NewLocalFile(drive, PR_FALSE, &file);
nsresult rv = NS_NewLocalFile(drive, PR_FALSE, &file);
*aNext = file;
#endif
return rv;
}
#endif