Bug 690459: Remove usage of PR_TRUE and PR_FALSE from base plugin code. r=jst

This commit is contained in:
Josh Aas 2011-09-30 02:02:59 -04:00
parent 0bc3c6daf0
commit 024548641e
22 changed files with 418 additions and 418 deletions

View File

@ -297,7 +297,7 @@ PluginPRLibrary::IsRemoteDrawingCoreAnimation(NPP instance, bool *aDrawing)
{
nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata;
NS_ENSURE_TRUE(inst, NS_ERROR_NULL_POINTER);
*aDrawing = PR_FALSE;
*aDrawing = false;
return NS_OK;
}
#endif

View File

@ -326,7 +326,7 @@ struct AutoCXPusher
nsIScriptContext *scx = GetScriptContextFromJSContext(cx);
if (scx) {
scx->ScriptEvaluated(PR_TRUE);
scx->ScriptEvaluated(true);
}
}
@ -624,14 +624,14 @@ nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id)
JSContext *cx = GetJSContext(npp);
if (!cx) {
return PR_FALSE;
return false;
}
if (!npobj) {
ThrowJSException(cx,
"Null npobj in nsJSObjWrapper::NP_HasMethod!");
return PR_FALSE;
return false;
}
nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj;
@ -641,7 +641,7 @@ nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id)
JSAutoEnterCompartment ac;
if (!ac.enter(cx, npjsobj->mJSObj))
return PR_FALSE;
return false;
AutoJSExceptionReporter reporter(cx);
@ -660,13 +660,13 @@ doInvoke(NPObject *npobj, NPIdentifier method, const NPVariant *args,
JSContext *cx = GetJSContext(npp);
if (!cx) {
return PR_FALSE;
return false;
}
if (!npobj || !result) {
ThrowJSException(cx, "Null npobj, or result in doInvoke!");
return PR_FALSE;
return false;
}
// Initialize *result
@ -680,14 +680,14 @@ doInvoke(NPObject *npobj, NPIdentifier method, const NPVariant *args,
JSAutoEnterCompartment ac;
if (!ac.enter(cx, npjsobj->mJSObj))
return PR_FALSE;
return false;
AutoJSExceptionReporter reporter(cx);
if (method != NPIdentifier_VOID) {
if (!GetProperty(cx, npjsobj->mJSObj, method, &fv) ||
::JS_TypeOfValue(cx, fv) != JSTYPE_FUNCTION) {
return PR_FALSE;
return false;
}
} else {
fv = OBJECT_TO_JSVAL(npjsobj->mJSObj);
@ -703,7 +703,7 @@ doInvoke(NPObject *npobj, NPIdentifier method, const NPVariant *args,
if (!jsargs) {
::JS_ReportOutOfMemory(cx);
return PR_FALSE;
return false;
}
}
@ -753,10 +753,10 @@ nsJSObjWrapper::NP_Invoke(NPObject *npobj, NPIdentifier method,
NPVariant *result)
{
if (method == NPIdentifier_VOID) {
return PR_FALSE;
return false;
}
return doInvoke(npobj, method, args, argCount, PR_FALSE, result);
return doInvoke(npobj, method, args, argCount, false, result);
}
// static
@ -764,7 +764,7 @@ bool
nsJSObjWrapper::NP_InvokeDefault(NPObject *npobj, const NPVariant *args,
uint32_t argCount, NPVariant *result)
{
return doInvoke(npobj, NPIdentifier_VOID, args, argCount, PR_FALSE,
return doInvoke(npobj, NPIdentifier_VOID, args, argCount, false,
result);
}
@ -776,14 +776,14 @@ nsJSObjWrapper::NP_HasProperty(NPObject *npobj, NPIdentifier id)
JSContext *cx = GetJSContext(npp);
if (!cx) {
return PR_FALSE;
return false;
}
if (!npobj) {
ThrowJSException(cx,
"Null npobj in nsJSObjWrapper::NP_HasProperty!");
return PR_FALSE;
return false;
}
nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj;
@ -795,7 +795,7 @@ nsJSObjWrapper::NP_HasProperty(NPObject *npobj, NPIdentifier id)
JSAutoEnterCompartment ac;
if (!ac.enter(cx, npjsobj->mJSObj))
return PR_FALSE;
return false;
NS_ASSERTION(NPIdentifierIsInt(id) || NPIdentifierIsString(id),
"id must be either string or int!\n");
@ -812,14 +812,14 @@ nsJSObjWrapper::NP_GetProperty(NPObject *npobj, NPIdentifier id,
JSContext *cx = GetJSContext(npp);
if (!cx) {
return PR_FALSE;
return false;
}
if (!npobj) {
ThrowJSException(cx,
"Null npobj in nsJSObjWrapper::NP_GetProperty!");
return PR_FALSE;
return false;
}
nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj;
@ -830,7 +830,7 @@ nsJSObjWrapper::NP_GetProperty(NPObject *npobj, NPIdentifier id,
JSAutoEnterCompartment ac;
if (!ac.enter(cx, npjsobj->mJSObj))
return PR_FALSE;
return false;
jsval v;
return (GetProperty(cx, npjsobj->mJSObj, id, &v) &&
@ -846,14 +846,14 @@ nsJSObjWrapper::NP_SetProperty(NPObject *npobj, NPIdentifier id,
JSContext *cx = GetJSContext(npp);
if (!cx) {
return PR_FALSE;
return false;
}
if (!npobj) {
ThrowJSException(cx,
"Null npobj in nsJSObjWrapper::NP_SetProperty!");
return PR_FALSE;
return false;
}
nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj;
@ -865,7 +865,7 @@ nsJSObjWrapper::NP_SetProperty(NPObject *npobj, NPIdentifier id,
JSAutoEnterCompartment ac;
if (!ac.enter(cx, npjsobj->mJSObj))
return PR_FALSE;
return false;
jsval v = NPVariantToJSVal(npp, cx, value);
js::AutoValueRooter tvr(cx, v);
@ -887,14 +887,14 @@ nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier id)
JSContext *cx = GetJSContext(npp);
if (!cx) {
return PR_FALSE;
return false;
}
if (!npobj) {
ThrowJSException(cx,
"Null npobj in nsJSObjWrapper::NP_RemoveProperty!");
return PR_FALSE;
return false;
}
nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj;
@ -907,7 +907,7 @@ nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier id)
JSAutoEnterCompartment ac;
if (!ac.enter(cx, npjsobj->mJSObj))
return PR_FALSE;
return false;
NS_ASSERTION(NPIdentifierIsInt(id) || NPIdentifierIsString(id),
"id must be either string or int!\n");
@ -944,14 +944,14 @@ nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray,
*count = 0;
if (!cx) {
return PR_FALSE;
return false;
}
if (!npobj) {
ThrowJSException(cx,
"Null npobj in nsJSObjWrapper::NP_Enumerate!");
return PR_FALSE;
return false;
}
nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj;
@ -962,11 +962,11 @@ nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray,
JSAutoEnterCompartment ac;
if (!ac.enter(cx, npjsobj->mJSObj))
return PR_FALSE;
return false;
JSIdArray *ida = ::JS_Enumerate(cx, npjsobj->mJSObj);
if (!ida) {
return PR_FALSE;
return false;
}
*count = ida->length;
@ -976,7 +976,7 @@ nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray,
::JS_DestroyIdArray(cx, ida);
return PR_FALSE;
return false;
}
for (PRUint32 i = 0; i < *count; i++) {
@ -984,7 +984,7 @@ nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray,
if (!::JS_IdToValue(cx, ida->vector[i], &v)) {
::JS_DestroyIdArray(cx, ida);
PR_Free(*idarray);
return PR_FALSE;
return false;
}
NPIdentifier id;
@ -994,7 +994,7 @@ nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray,
::JS_DestroyIdArray(cx, ida);
PR_Free(*idarray);
return PR_FALSE;
return false;
}
id = StringToNPIdentifier(cx, str);
} else {
@ -1008,7 +1008,7 @@ nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray,
::JS_DestroyIdArray(cx, ida);
return PR_TRUE;
return true;
}
//static
@ -1016,7 +1016,7 @@ bool
nsJSObjWrapper::NP_Construct(NPObject *npobj, const NPVariant *args,
uint32_t argCount, NPVariant *result)
{
return doInvoke(npobj, NPIdentifier_VOID, args, argCount, PR_TRUE, result);
return doInvoke(npobj, NPIdentifier_VOID, args, argCount, true, result);
}
@ -1540,7 +1540,7 @@ CallNPMethod(JSContext *cx, uintN argc, jsval *vp)
if (!obj)
return JS_FALSE;
return CallNPMethodInternal(cx, obj, argc, JS_ARGV(cx, vp), vp, PR_FALSE);
return CallNPMethodInternal(cx, obj, argc, JS_ARGV(cx, vp), vp, false);
}
struct NPObjectEnumerateState {
@ -1714,14 +1714,14 @@ static JSBool
NPObjWrapper_Call(JSContext *cx, uintN argc, jsval *vp)
{
return CallNPMethodInternal(cx, JSVAL_TO_OBJECT(JS_CALLEE(cx, vp)), argc,
JS_ARGV(cx, vp), vp, PR_FALSE);
JS_ARGV(cx, vp), vp, false);
}
static JSBool
NPObjWrapper_Construct(JSContext *cx, uintN argc, jsval *vp)
{
return CallNPMethodInternal(cx, JSVAL_TO_OBJECT(JS_CALLEE(cx, vp)), argc,
JS_ARGV(cx, vp), vp, PR_TRUE);
JS_ARGV(cx, vp), vp, true);
}
class NPObjWrapperHashEntry : public PLDHashEntryHdr

View File

@ -239,7 +239,7 @@ static void CheckClassInitialized()
if (!sPluginThreadAsyncCallLock)
sPluginThreadAsyncCallLock = new Mutex("nsNPAPIPlugin.sPluginThreadAsyncCallLock");
initialized = PR_TRUE;
initialized = true;
NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL,("NPN callbacks initialized\n"));
}
@ -290,7 +290,7 @@ static PRInt32 OSXVersion()
#define CGLRendererIntel900ID 0x00024000
static bool GMA9XXGraphics()
{
bool hasIntelGMA9XX = PR_FALSE;
bool hasIntelGMA9XX = false;
CGLRendererInfoObj renderer = 0;
GLint rendererCount = 0;
if (::CGLQueryRendererInfo(0xffffffff, &renderer, &rendererCount) == kCGLNoError) {
@ -298,7 +298,7 @@ static bool GMA9XXGraphics()
GLint rendProp = 0;
if (::CGLDescribeRenderer(renderer, c, kCGLRPRendererID, &rendProp) == kCGLNoError) {
if ((rendProp & CGLRendererIDMatchingMask) == CGLRendererIntel900ID) {
hasIntelGMA9XX = PR_TRUE;
hasIntelGMA9XX = true;
break;
}
}
@ -313,17 +313,17 @@ bool
nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
{
if (PR_GetEnv("MOZ_DISABLE_OOP_PLUGINS")) {
return PR_FALSE;
return false;
}
if (!aPluginTag) {
return PR_FALSE;
return false;
}
#if defined(XP_MACOSX) && defined(__i386__)
// Only allow on Mac OS X 10.6 or higher.
if (OSXVersion() < 0x00001060) {
return PR_FALSE;
return false;
}
// Blacklist Flash 10.0 or lower since it may try to negotiate Carbon/Quickdraw
// which are not supported out of process. Also blacklist Flash 10.1 if this
@ -333,16 +333,16 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
// If the first '.' is before position 2 or the version
// starts with 10.0 then we are dealing with Flash 10 or less.
if (aPluginTag->mVersion.FindChar('.') < 2) {
return PR_FALSE;
return false;
}
if (aPluginTag->mVersion.Length() >= 4) {
nsCString versionPrefix;
aPluginTag->mVersion.Left(versionPrefix, 4);
if (versionPrefix.EqualsASCII("10.0")) {
return PR_FALSE;
return false;
}
if (versionPrefix.EqualsASCII("10.1") && GMA9XXGraphics()) {
return PR_FALSE;
return false;
}
}
}
@ -355,12 +355,12 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
// Always disabled on 2K or less. (bug 536303)
if (osVerInfo.dwMajorVersion < 5 ||
(osVerInfo.dwMajorVersion == 5 && osVerInfo.dwMinorVersion == 0))
return PR_FALSE;
return false;
#endif
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (!prefs) {
return PR_FALSE;
return false;
}
// Get per-library whitelist/blacklist pref string
@ -371,7 +371,7 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
nsCAutoString prefFile(aPluginTag->mFullPath.get());
PRInt32 slashPos = prefFile.RFindCharInSet("/\\");
if (kNotFound == slashPos)
return PR_FALSE;
return false;
prefFile.Cut(0, slashPos + 1);
ToLowerCase(prefFile);
@ -393,7 +393,7 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
if (aPluginTag->mIsJavaPlugin &&
NS_SUCCEEDED(prefs->GetBoolPref("dom.ipc.plugins.java.enabled", &javaIsEnabled)) &&
!javaIsEnabled) {
return PR_FALSE;
return false;
}
PRUint32 prefCount;
@ -425,7 +425,7 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
if (match && NS_SUCCEEDED(prefs->GetBoolPref(prefNames[currentPref],
&oopPluginsEnabled))) {
prefSet = PR_TRUE;
prefSet = true;
break;
}
}
@ -433,7 +433,7 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
}
if (!prefSet) {
oopPluginsEnabled = PR_FALSE;
oopPluginsEnabled = false;
#ifdef XP_MACOSX
#if defined(__i386__)
prefs->GetBoolPref("dom.ipc.plugins.enabled.i386", &oopPluginsEnabled);
@ -581,7 +581,7 @@ MakeNewNPAPIStreamInternal(NPP npp, const char *relativeURL, const char *target,
eNPPStreamTypeInternal type,
bool bDoNotify = false,
void *notifyData = nsnull, uint32_t len = 0,
const char *buf = nsnull, NPBool file = PR_FALSE)
const char *buf = nsnull, NPBool file = false)
{
if (!npp)
return NPERR_INVALID_INSTANCE_ERROR;
@ -608,7 +608,7 @@ MakeNewNPAPIStreamInternal(NPP npp, const char *relativeURL, const char *target,
inst->NewStreamListener(relativeURL, notifyData,
getter_AddRefs(listener));
if (listener) {
static_cast<nsNPAPIPluginStreamListener*>(listener.get())->SetCallNotify(PR_FALSE);
static_cast<nsNPAPIPluginStreamListener*>(listener.get())->SetCallNotify(false);
}
}
@ -1000,7 +1000,7 @@ _geturlnotify(NPP npp, const char* relativeURL, const char* target,
PluginDestructionGuard guard(npp);
return MakeNewNPAPIStreamInternal(npp, relativeURL, target,
eNPPStreamTypeInternal_Get, PR_TRUE,
eNPPStreamTypeInternal_Get, true,
notifyData);
}
@ -1024,7 +1024,7 @@ _posturlnotify(NPP npp, const char *relativeURL, const char *target,
PluginDestructionGuard guard(npp);
return MakeNewNPAPIStreamInternal(npp, relativeURL, target,
eNPPStreamTypeInternal_Post, PR_TRUE,
eNPPStreamTypeInternal_Post, true,
notifyData, len, buf, file);
}
@ -1044,7 +1044,7 @@ _posturl(NPP npp, const char *relativeURL, const char *target,
PluginDestructionGuard guard(npp);
return MakeNewNPAPIStreamInternal(npp, relativeURL, target,
eNPPStreamTypeInternal_Post, PR_FALSE, nsnull,
eNPPStreamTypeInternal_Post, false, nsnull,
len, buf, file);
}
@ -1208,7 +1208,7 @@ _memflush(uint32_t size)
}
NPN_PLUGIN_LOG(PLUGIN_LOG_NOISY, ("NPN_MemFlush: size=%d\n", size));
nsMemory::HeapMinimize(PR_TRUE);
nsMemory::HeapMinimize(true);
return 0;
}
@ -1761,7 +1761,7 @@ _getproperty(NPP npp, NPObject* npobj, NPIdentifier property,
bool javaCompatible = false;
if (NS_FAILED(NS_CheckIsJavaCompatibleURLString(url, &javaCompatible)))
javaCompatible = PR_FALSE;
javaCompatible = false;
if (javaCompatible)
return true;
@ -2025,12 +2025,12 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *) npp->ndata;
bool windowless = false;
inst->IsWindowless(&windowless);
NPBool needXEmbed = PR_FALSE;
NPBool needXEmbed = false;
if (!windowless) {
res = inst->GetValueFromPlugin(NPPVpluginNeedsXEmbed, &needXEmbed);
// If the call returned an error code make sure we still use our default value.
if (NS_FAILED(res)) {
needXEmbed = PR_FALSE;
needXEmbed = false;
}
}
if (windowless || needXEmbed) {
@ -2079,7 +2079,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
#endif
case NPNVjavascriptEnabledBool: {
*(NPBool*)result = PR_FALSE;
*(NPBool*)result = false;
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
bool js = false;;
@ -2091,7 +2091,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
}
case NPNVasdEnabledBool:
*(NPBool*)result = PR_FALSE;
*(NPBool*)result = false;
return NPERR_NO_ERROR;
case NPNVisOfflineBool: {
@ -2124,14 +2124,14 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
case NPNVSupportsXEmbedBool: {
#ifdef MOZ_WIDGET_GTK2
*(NPBool*)result = PR_TRUE;
*(NPBool*)result = true;
#elif defined(MOZ_WIDGET_QT)
// Desktop Flash fail to initialize if browser does not support NPNVSupportsXEmbedBool
// even when wmode!=windowed, lets return fake support
fprintf(stderr, "Fake support for XEmbed plugins in Qt port\n");
*(NPBool*)result = PR_TRUE;
*(NPBool*)result = true;
#else
*(NPBool*)result = PR_FALSE;
*(NPBool*)result = false;
#endif
return NPERR_NO_ERROR;
}
@ -2151,9 +2151,9 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
case NPNVSupportsWindowless: {
#if defined(XP_WIN) || defined(XP_MACOSX) || \
(defined(MOZ_X11) && (defined(MOZ_WIDGET_GTK2) || defined(MOZ_WIDGET_QT)))
*(NPBool*)result = PR_TRUE;
*(NPBool*)result = true;
#else
*(NPBool*)result = PR_FALSE;
*(NPBool*)result = false;
#endif
return NPERR_NO_ERROR;
}
@ -2227,26 +2227,26 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
#ifndef NP_NO_QUICKDRAW
case NPNVsupportsQuickDrawBool: {
*(NPBool*)result = PR_TRUE;
*(NPBool*)result = true;
return NPERR_NO_ERROR;
}
#endif
case NPNVsupportsCoreGraphicsBool: {
*(NPBool*)result = PR_TRUE;
*(NPBool*)result = true;
return NPERR_NO_ERROR;
}
case NPNVsupportsCoreAnimationBool: {
*(NPBool*)result = PR_TRUE;
*(NPBool*)result = true;
return NPERR_NO_ERROR;
}
case NPNVsupportsInvalidatingCoreAnimationBool: {
*(NPBool*)result = PR_TRUE;
*(NPBool*)result = true;
return NPERR_NO_ERROR;
}
@ -2254,13 +2254,13 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
#ifndef NP_NO_CARBON
case NPNVsupportsCarbonBool: {
*(NPBool*)result = PR_TRUE;
*(NPBool*)result = true;
return NPERR_NO_ERROR;
}
#endif
case NPNVsupportsCocoaBool: {
*(NPBool*)result = PR_TRUE;
*(NPBool*)result = true;
return NPERR_NO_ERROR;
}
@ -2830,7 +2830,7 @@ _convertpoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace so
{
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata;
if (!inst)
return PR_FALSE;
return false;
return inst->ConvertPoint(sourceX, sourceY, sourceSpace, destX, destY, destSpace);
}

View File

@ -92,19 +92,19 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance(nsNPAPIPlugin* plugin)
mDrawingModel(0),
#endif
mRunning(NOT_STARTED),
mWindowless(PR_FALSE),
mWindowlessLocal(PR_FALSE),
mTransparent(PR_FALSE),
mUsesDOMForCursor(PR_FALSE),
mInPluginInitCall(PR_FALSE),
mWindowless(false),
mWindowlessLocal(false),
mTransparent(false),
mUsesDOMForCursor(false),
mInPluginInitCall(false),
mPlugin(plugin),
mMIMEType(nsnull),
mOwner(nsnull),
mCurrentPluginEvent(nsnull),
#if defined(MOZ_X11) || defined(XP_WIN) || defined(XP_MACOSX)
mUsePluginLayersPref(PR_TRUE)
mUsePluginLayersPref(true)
#else
mUsePluginLayersPref(PR_FALSE)
mUsePluginLayersPref(false)
#endif
{
NS_ASSERTION(mPlugin != NULL, "Plugin is required when creating an instance.");
@ -404,7 +404,7 @@ nsNPAPIPluginInstance::InitializePlugin()
}
bool oldVal = mInPluginInitCall;
mInPluginInitCall = PR_TRUE;
mInPluginInitCall = true;
// Need this on the stack before calling NPP_New otherwise some callbacks that
// the plugin may make could fail (NPN_HasProperty, for example).
@ -467,7 +467,7 @@ nsresult nsNPAPIPluginInstance::SetWindow(NPWindow* window)
PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::SetWindow (about to call it) this=%p\n",this));
bool oldVal = mInPluginInitCall;
mInPluginInitCall = PR_TRUE;
mInPluginInitCall = true;
NPPAutoPusher nppPusher(&mNPP);
@ -666,7 +666,7 @@ NPError nsNPAPIPluginInstance::SetWindowless(bool aWindowless)
// PluginInstanceChild::InitQuirksMode.
NS_NAMED_LITERAL_CSTRING(silverlight, "application/x-silverlight");
if (!PL_strncasecmp(mMIMEType, silverlight.get(), silverlight.Length())) {
mTransparent = PR_TRUE;
mTransparent = true;
}
}
@ -726,7 +726,7 @@ void nsNPAPIPluginInstance::SetDrawingModel(PRUint32 aModel)
class SurfaceGetter : public nsRunnable {
public:
SurfaceGetter(NPPluginFuncs* aPluginFunctions, NPP_t aNPP) :
mHaveSurface(PR_FALSE), mPluginFunctions(aPluginFunctions), mNPP(aNPP) {
mHaveSurface(false), mPluginFunctions(aPluginFunctions), mNPP(aNPP) {
mLock = new Mutex("SurfaceGetter::Lock");
mCondVar = new CondVar(*mLock, "SurfaceGetter::CondVar");
@ -738,13 +738,13 @@ public:
nsresult Run() {
MutexAutoLock lock(*mLock);
(*mPluginFunctions->getvalue)(&mNPP, kJavaSurface_ANPGetValue, &mSurface);
mHaveSurface = PR_TRUE;
mHaveSurface = true;
mCondVar->Notify();
return NS_OK;
}
void* GetSurface() {
MutexAutoLock lock(*mLock);
mHaveSurface = PR_FALSE;
mHaveSurface = false;
AndroidBridge::Bridge()->PostToJavaThread(this);
while (!mHaveSurface)
mCondVar->Wait();
@ -878,7 +878,7 @@ nsNPAPIPluginInstance::IsWindowless(bool* isWindowless)
{
#ifdef ANDROID
// On android, pre-honeycomb, all plugins are treated as windowless.
*isWindowless = PR_TRUE;
*isWindowless = true;
#else
*isWindowless = mWindowless;
#endif
@ -1057,7 +1057,7 @@ nsNPAPIPluginInstance::PushPopupsEnabledState(bool aEnabled)
PopupControlState oldState =
window->PushPopupControlState(aEnabled ? openAllowed : openAbused,
PR_TRUE);
true);
if (!mPopupStates.AppendElement(oldState)) {
// Appending to our state stack failed, pop what we just pushed.
@ -1172,9 +1172,9 @@ PluginTimerCallback(nsITimer *aTimer, void *aClosure)
// Some plugins (Flash on Android) calls unscheduletimer
// from this callback.
t->inCallback = PR_TRUE;
t->inCallback = true;
(*(t->callback))(npp, id);
t->inCallback = PR_FALSE;
t->inCallback = false;
// Make sure we still have an instance and the timer is still alive
// after the callback.
@ -1208,7 +1208,7 @@ nsNPAPIPluginInstance::ScheduleTimer(uint32_t interval, NPBool repeat, void (*ti
{
nsNPAPITimer *newTimer = new nsNPAPITimer();
newTimer->inCallback = PR_FALSE;
newTimer->inCallback = false;
newTimer->npp = &mNPP;
// generate ID that is unique to this instance
@ -1280,7 +1280,7 @@ nsNPAPIPluginInstance::ConvertPoint(double sourceX, double sourceY, NPCoordinate
if (mOwner)
return mOwner->ConvertPoint(sourceX, sourceY, sourceSpace, destX, destY, destSpace);
return PR_FALSE;
return false;
}
nsresult
@ -1452,7 +1452,7 @@ CarbonEventModelFailureEvent::Run()
{
nsString type = NS_LITERAL_STRING("npapi-carbon-event-model-failure");
nsContentUtils::DispatchTrustedEvent(mContent->GetDocument(), mContent,
type, PR_TRUE, PR_TRUE);
type, true, true);
return NS_OK;
}

View File

@ -127,7 +127,7 @@ nsPluginStreamToFile::WriteSegments(nsReadSegmentFun reader, void * closure,
NS_IMETHODIMP
nsPluginStreamToFile::IsNonBlocking(bool *aNonBlocking)
{
*aNonBlocking = PR_FALSE;
*aNonBlocking = false;
return NS_OK;
}
@ -154,14 +154,14 @@ mStreamListenerPeer(nsnull),
mStreamBufferSize(0),
mStreamBufferByteCount(0),
mStreamType(NP_NORMAL),
mStreamStarted(PR_FALSE),
mStreamCleanedUp(PR_FALSE),
mCallNotify(notifyData ? PR_TRUE : PR_FALSE),
mIsSuspended(PR_FALSE),
mStreamStarted(false),
mStreamCleanedUp(false),
mCallNotify(notifyData ? true : false),
mIsSuspended(false),
mIsPluginInitJSStream(mInst->mInPluginInitCall &&
aURL && strncmp(aURL, "javascript:",
sizeof("javascript:") - 1) == 0),
mRedirectDenied(PR_FALSE),
mRedirectDenied(false),
mResponseHeaderBuf(nsnull)
{
memset(&mNPStream, 0, sizeof(mNPStream));
@ -201,7 +201,7 @@ nsNPAPIPluginStreamListener::CleanUpStream(NPReason reason)
if (mStreamCleanedUp)
return NS_OK;
mStreamCleanedUp = PR_TRUE;
mStreamCleanedUp = true;
StopDataPump();
@ -246,7 +246,7 @@ nsNPAPIPluginStreamListener::CleanUpStream(NPReason reason)
rv = NS_OK;
}
mStreamStarted = PR_FALSE;
mStreamStarted = false;
// fire notification back to plugin, just like before
CallURLNotify(reason);
@ -262,7 +262,7 @@ nsNPAPIPluginStreamListener::CallURLNotify(NPReason reason)
PluginDestructionGuard guard(mInst);
mCallNotify = PR_FALSE; // only do this ONCE and prevent recursion
mCallNotify = false; // only do this ONCE and prevent recursion
nsNPAPIPlugin* plugin = mInst->GetPlugin();
if (!plugin || !plugin->GetLibrary())
@ -357,7 +357,7 @@ nsNPAPIPluginStreamListener::OnStartBinding(nsIPluginStreamInfo* pluginInfo)
return NS_ERROR_FAILURE;
}
mStreamStarted = PR_TRUE;
mStreamStarted = true;
return NS_OK;
}
@ -378,7 +378,7 @@ nsNPAPIPluginStreamListener::SuspendRequest()
if (NS_FAILED(rv))
return;
mIsSuspended = PR_TRUE;
mIsSuspended = true;
pluginInfoNPAPI->SuspendRequests();
}
@ -391,7 +391,7 @@ nsNPAPIPluginStreamListener::ResumeRequest()
pluginInfoNPAPI->ResumeRequests();
mIsSuspended = PR_FALSE;
mIsSuspended = false;
}
nsresult
@ -422,16 +422,16 @@ bool
nsNPAPIPluginStreamListener::PluginInitJSLoadInProgress()
{
if (!mInst)
return PR_FALSE;
return false;
nsTArray<nsNPAPIPluginStreamListener*> *streamListeners = mInst->StreamListeners();
for (unsigned int i = 0; i < streamListeners->Length(); i++) {
if (streamListeners->ElementAt(i)->mIsPluginInitJSStream) {
return PR_TRUE;
return true;
}
}
return PR_FALSE;
return false;
}
// This method is called when there's more data available off the
@ -890,7 +890,7 @@ nsNPAPIPluginStreamListener::URLRedirectResponse(NPBool allow)
{
if (mHTTPRedirectCallback) {
mHTTPRedirectCallback->OnRedirectVerifyCallback(allow ? NS_OK : NS_ERROR_FAILURE);
mRedirectDenied = allow ? PR_FALSE : PR_TRUE;
mRedirectDenied = allow ? false : true;
mHTTPRedirectCallback = nsnull;
}
}

View File

@ -229,7 +229,7 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
NS_ENSURE_ARG(charProp);
*_retval = nsnull;
*persistant = PR_FALSE;
*persistant = false;
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (!prefs)
@ -310,7 +310,7 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
newestPath += NS_LITERAL_STRING("\\bin\\new_plugin");
rv = NS_NewLocalFile(newestPath,
PR_TRUE, getter_AddRefs(localFile));
true, getter_AddRefs(localFile));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIWindowsRegKey> newKey =
@ -366,7 +366,7 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
rv = regKey->ReadStringValue(NS_LITERAL_STRING("InstallDir"), path);
if (NS_SUCCEEDED(rv)) {
path += NS_LITERAL_STRING("\\Plugins");
rv = NS_NewLocalFile(path, PR_TRUE,
rv = NS_NewLocalFile(path, true,
getter_AddRefs(localFile));
}
}
@ -404,7 +404,7 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
rv = regKey->ReadStringValue(NS_LITERAL_STRING("Installation Directory"),
path);
if (NS_SUCCEEDED(rv)) {
rv = NS_NewLocalFile(path, PR_TRUE,
rv = NS_NewLocalFile(path, true,
getter_AddRefs(localFile));
}
}
@ -469,7 +469,7 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
if (!newestPath.IsEmpty()) {
newestPath += NS_LITERAL_STRING("\\browser");
rv = NS_NewLocalFile(newestPath, PR_TRUE,
rv = NS_NewLocalFile(newestPath, true,
getter_AddRefs(localFile));
}
}
@ -521,7 +521,7 @@ nsPluginDirServiceProvider::GetPLIDDirectoriesWithRootKey(PRUint32 aKey, nsCOMAr
rv = childKey->ReadStringValue(NS_LITERAL_STRING("Path"), path);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsILocalFile> localFile;
if (NS_SUCCEEDED(NS_NewLocalFile(path, PR_TRUE,
if (NS_SUCCEEDED(NS_NewLocalFile(path, true,
getter_AddRefs(localFile))) &&
localFile) {
// Some vendors use a path directly to the DLL so chop off

View File

@ -271,10 +271,10 @@ bool ReadSectionHeader(nsPluginManifestLineReader& reader, const char *token)
if (PL_strcmp(values[0]+1, token)) {
break; // it's wrong token
}
return PR_TRUE;
return true;
}
} while (reader.NextLine());
return PR_FALSE;
return false;
}
// Little helper struct to asynchronously reframe any presentations (embedded)
@ -337,7 +337,7 @@ static bool UnloadPluginsASAP()
}
}
return PR_FALSE;
return false;
}
// helper struct for asynchronous handling of plugin unloading
@ -377,7 +377,7 @@ nsresult nsPluginHost::PostPluginUnloadEvent(PRLibrary* aLibrary)
}
nsPluginHost::nsPluginHost()
// No need to initialize members to nsnull, PR_FALSE etc because this class
// No need to initialize members to nsnull, false etc because this class
// has a zeroing operator new.
{
// check to see if pref is set at startup to let plugins take over in
@ -400,8 +400,8 @@ nsPluginHost::nsPluginHost()
nsCOMPtr<nsIObserverService> obsService =
mozilla::services::GetObserverService();
if (obsService) {
obsService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE);
obsService->AddObserver(this, NS_PRIVATE_BROWSING_SWITCH_TOPIC, PR_FALSE);
obsService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
obsService->AddObserver(this, NS_PRIVATE_BROWSING_SWITCH_TOPIC, false);
}
#ifdef PLUGIN_LOGGING
@ -454,7 +454,7 @@ nsPluginHost::GetInst()
bool nsPluginHost::IsRunningPlugin(nsPluginTag * plugin)
{
if (!plugin || !plugin->mEntryPoint) {
return PR_FALSE;
return false;
}
for (PRUint32 i = 0; i < mInstances.Length(); i++) {
@ -462,11 +462,11 @@ bool nsPluginHost::IsRunningPlugin(nsPluginTag * plugin)
if (instance &&
instance->GetPlugin() == plugin->mEntryPoint &&
instance->IsRunning()) {
return PR_TRUE;
return true;
}
}
return PR_FALSE;
return false;
}
nsresult nsPluginHost::ReloadPlugins(bool reloadPages)
@ -488,10 +488,10 @@ nsresult nsPluginHost::ReloadPlugins(bool reloadPages)
// check if plugins changed, no need to do anything else
// if no changes to plugins have been made
// PR_FALSE instructs not to touch the plugin list, just to
// false instructs not to touch the plugin list, just to
// look for possible changes
bool pluginschanged = true;
FindPlugins(PR_FALSE, &pluginschanged);
FindPlugins(false, &pluginschanged);
// if no changed detected, return an appropriate error code
if (!pluginschanged)
@ -534,7 +534,7 @@ nsresult nsPluginHost::ReloadPlugins(bool reloadPages)
}
// set flags
mPluginsLoaded = PR_FALSE;
mPluginsLoaded = false;
// load them again
rv = LoadPlugins();
@ -840,7 +840,7 @@ nsresult nsPluginHost::FindProxyForURL(const char* url, char* *result)
// very little is probably broken by this
*result = PR_smprintf("SOCKS %s:%d", host.get(), port);
} else {
NS_ASSERTION(PR_FALSE, "Unknown proxy type!");
NS_ASSERTION(false, "Unknown proxy type!");
*result = PL_strdup("DIRECT");
}
@ -862,7 +862,7 @@ nsresult nsPluginHost::Destroy()
if (mIsDestroyed)
return NS_OK;
mIsDestroyed = PR_TRUE;
mIsDestroyed = true;
// we should call nsIPluginInstance::Stop and nsIPluginInstance::SetWindow
// for those plugins who want it
@ -879,7 +879,7 @@ nsresult nsPluginHost::Destroy()
// Lets remove any of the temporary files that we created.
if (sPluginTempDir) {
sPluginTempDir->Remove(PR_TRUE);
sPluginTempDir->Remove(true);
NS_RELEASE(sPluginTempDir);
}
@ -903,7 +903,7 @@ void nsPluginHost::OnPluginInstanceDestroyed(nsPluginTag* aPluginTag)
bool hasInstance = false;
for (PRUint32 i = 0; i < mInstances.Length(); i++) {
if (TagForPlugin(mInstances[i]->GetPlugin()) == aPluginTag) {
hasInstance = PR_TRUE;
hasInstance = true;
break;
}
}
@ -1033,7 +1033,7 @@ nsPluginHost::InstantiateEmbeddedPlugin(const char *aMimeType, nsIURI* aURL,
}
bool isJava = false;
nsPluginTag* pluginTag = FindPluginForType(aMimeType, PR_TRUE);
nsPluginTag* pluginTag = FindPluginForType(aMimeType, true);
if (pluginTag) {
isJava = pluginTag->mIsJavaPlugin;
}
@ -1051,7 +1051,7 @@ nsPluginHost::InstantiateEmbeddedPlugin(const char *aMimeType, nsIURI* aURL,
ToLowerCase(contractID);
nsCOMPtr<nsIProtocolHandler> handler = do_GetService(contractID.get());
if (handler)
bCanHandleInternally = PR_TRUE;
bCanHandleInternally = true;
}
// if we don't have a MIME type at this point, we still have one more chance by
@ -1203,7 +1203,7 @@ nsresult nsPluginHost::SetUpPluginInstance(const char *aMimeType,
// ReloadPlugins will do the job smartly: nothing will be done
// if no changes detected, in such a case just return
if (NS_ERROR_PLUGINS_PLUGINSNOTCHANGED == ReloadPlugins(PR_FALSE))
if (NS_ERROR_PLUGINS_PLUGINSNOTCHANGED == ReloadPlugins(false))
return rv;
// other failure return codes may be not fatal, so we can still try
@ -1236,7 +1236,7 @@ nsPluginHost::TrySetUpPluginInstance(const char *aMimeType,
// if don't have a mimetype or no plugin can handle this mimetype
// check by file extension
nsPluginTag* pluginTag = FindPluginForType(aMimeType, PR_TRUE);
nsPluginTag* pluginTag = FindPluginForType(aMimeType, true);
if (!pluginTag) {
nsCOMPtr<nsIURL> url = do_QueryInterface(aURL);
if (!url) return NS_ERROR_FAILURE;
@ -1329,13 +1329,13 @@ nsPluginHost::TrySetUpPluginInstance(const char *aMimeType,
nsresult
nsPluginHost::IsPluginEnabledForType(const char* aMimeType)
{
nsPluginTag *plugin = FindPluginForType(aMimeType, PR_TRUE);
nsPluginTag *plugin = FindPluginForType(aMimeType, true);
if (plugin)
return NS_OK;
// Pass PR_FALSE as the second arg so we can return NS_ERROR_PLUGIN_DISABLED
// Pass false as the second arg so we can return NS_ERROR_PLUGIN_DISABLED
// for disabled plug-ins.
plugin = FindPluginForType(aMimeType, PR_FALSE);
plugin = FindPluginForType(aMimeType, false);
if (!plugin)
return NS_ERROR_FAILURE;
@ -1672,7 +1672,7 @@ nsresult nsPluginHost::GetPlugin(const char *aMimeType, nsNPAPIPlugin** aPlugin)
// If plugins haven't been scanned yet, do so now
LoadPlugins();
nsPluginTag* pluginTag = FindPluginForType(aMimeType, PR_TRUE);
nsPluginTag* pluginTag = FindPluginForType(aMimeType, true);
if (pluginTag) {
rv = NS_OK;
PLUGIN_LOG(PLUGIN_LOG_BASIC,
@ -1921,10 +1921,10 @@ nsPluginHost::IsLiveTag(nsIPluginTag* aPluginTag)
nsPluginTag* tag;
for (tag = mPlugins; tag; tag = tag->mNext) {
if (tag == aPluginTag) {
return PR_TRUE;
return true;
}
}
return PR_FALSE;
return false;
}
nsPluginTag * nsPluginHost::HaveSamePlugin(nsPluginTag * aPluginTag)
@ -1946,16 +1946,16 @@ bool nsPluginHost::IsDuplicatePlugin(nsPluginTag * aPluginTag)
// if those are not equal, we have the same plugin with different path,
// i.e. duplicate, return true
if (!tag->mFileName.Equals(aPluginTag->mFileName))
return PR_TRUE;
return true;
// if they are equal, compare mFullPath fields just in case
// mFileName contained leaf name only, and if not equal, return true
if (!tag->mFullPath.Equals(aPluginTag->mFullPath))
return PR_TRUE;
return true;
}
// we do not have it at all, return false
return PR_FALSE;
return false;
}
typedef NS_NPAPIPLUGIN_CALLBACK(char *, NP_GETMIMEDESCRIPTION)(void);
@ -1967,7 +1967,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
NS_ENSURE_ARG_POINTER(aPluginsChanged);
nsresult rv;
*aPluginsChanged = PR_FALSE;
*aPluginsChanged = false;
#ifdef PLUGIN_LOGGING
nsCAutoString dirPath;
@ -2024,7 +2024,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
bool enabled = true;
bool seenBefore = false;
if (pluginTag) {
seenBefore = PR_TRUE;
seenBefore = true;
// If plugin changed, delete cachedPluginTag and don't use cache
if (LL_NE(fileModTime, pluginTag->mLastModifiedTime)) {
// Plugins has changed. Don't use cached plugin info.
@ -2032,7 +2032,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
pluginTag = nsnull;
// plugin file changed, flag this fact
*aPluginsChanged = PR_TRUE;
*aPluginsChanged = true;
}
else {
// if it is unwanted plugin we are checking for, get it back to the cache info list
@ -2040,7 +2040,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
if (IsDuplicatePlugin(pluginTag)) {
if (!pluginTag->HasFlag(NS_PLUGIN_FLAG_UNWANTED)) {
// Plugin switched from wanted to unwanted
*aPluginsChanged = PR_TRUE;
*aPluginsChanged = true;
}
pluginTag->Mark(NS_PLUGIN_FLAG_UNWANTED);
pluginTag->mNext = mCachedPlugins;
@ -2048,7 +2048,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
} else if (pluginTag->HasFlag(NS_PLUGIN_FLAG_UNWANTED)) {
pluginTag->UnMark(NS_PLUGIN_FLAG_UNWANTED);
// Plugin switched from unwanted to wanted
*aPluginsChanged = PR_TRUE;
*aPluginsChanged = true;
}
}
@ -2104,7 +2104,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
mInvalidPlugins = invalidTag;
// Mark aPluginsChanged so pluginreg is rewritten
*aPluginsChanged = PR_TRUE;
*aPluginsChanged = true;
continue;
}
@ -2128,9 +2128,9 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
if (state == nsIBlocklistService::STATE_BLOCKED)
pluginTag->Mark(NS_PLUGIN_FLAG_BLOCKLISTED);
else if (state == nsIBlocklistService::STATE_SOFTBLOCKED && !seenBefore)
enabled = PR_FALSE;
enabled = false;
else if (state == nsIBlocklistService::STATE_OUTDATED && !seenBefore)
warnOutdated = PR_TRUE;
warnOutdated = true;
}
}
@ -2164,14 +2164,14 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
// we cannot get here if the plugin has just been added
// and thus |pluginTag| is not from cache, because otherwise
// it would not be present in the list;
bAddIt = PR_FALSE;
bAddIt = false;
}
// do it if we still want it
if (bAddIt) {
if (!seenBefore) {
// We have a valid new plugin so report that plugins have changed.
*aPluginsChanged = PR_TRUE;
*aPluginsChanged = true;
}
// If we're not creating a plugin list, simply looking for changes,
@ -2215,7 +2215,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
}
if (warnOutdated) {
mPrefService->SetBoolPref("plugins.update.notifyUser", PR_TRUE);
mPrefService->SetBoolPref("plugins.update.notifyUser", true);
}
return NS_OK;
@ -2240,7 +2240,7 @@ nsresult nsPluginHost::ScanPluginsDirectoryList(nsISimpleEnumerator *dirEnum,
ScanPluginsDirectory(nextDir, aCreatePluginList, &pluginschanged);
if (pluginschanged)
*aPluginsChanged = PR_TRUE;
*aPluginsChanged = true;
// if changes are detected and we are not creating the list, do not proceed
if (!aCreatePluginList && *aPluginsChanged)
@ -2260,7 +2260,7 @@ nsresult nsPluginHost::LoadPlugins()
return NS_OK;
bool pluginschanged;
nsresult rv = FindPlugins(PR_TRUE, &pluginschanged);
nsresult rv = FindPlugins(true, &pluginschanged);
if (NS_FAILED(rv))
return rv;
@ -2289,7 +2289,7 @@ nsresult nsPluginHost::FindPlugins(bool aCreatePluginList, bool * aPluginsChange
NS_ENSURE_ARG_POINTER(aPluginsChanged);
*aPluginsChanged = PR_FALSE;
*aPluginsChanged = false;
nsresult rv;
// Read cached plugins info. If the profile isn't yet available then don't
@ -2320,7 +2320,7 @@ nsresult nsPluginHost::FindPlugins(bool aCreatePluginList, bool * aPluginsChange
ScanPluginsDirectoryList(dirList, aCreatePluginList, &pluginschanged);
if (pluginschanged)
*aPluginsChanged = PR_TRUE;
*aPluginsChanged = true;
// if we are just looking for possible changes,
// no need to proceed if changes are detected
@ -2335,7 +2335,7 @@ nsresult nsPluginHost::FindPlugins(bool aCreatePluginList, bool * aPluginsChange
#endif
}
mPluginsLoaded = PR_TRUE; // at this point 'some' plugins have been loaded,
mPluginsLoaded = true; // at this point 'some' plugins have been loaded,
// the rest is optional
#ifdef XP_WIN
@ -2351,7 +2351,7 @@ nsresult nsPluginHost::FindPlugins(bool aCreatePluginList, bool * aPluginsChange
ScanPluginsDirectoryList(dirList, aCreatePluginList, &pluginschanged);
if (pluginschanged)
*aPluginsChanged = PR_TRUE;
*aPluginsChanged = true;
// if we are just looking for possible changes,
// no need to proceed if changes are detected
@ -2385,7 +2385,7 @@ nsresult nsPluginHost::FindPlugins(bool aCreatePluginList, bool * aPluginsChange
ScanPluginsDirectory(dirToScan, aCreatePluginList, &pluginschanged);
if (pluginschanged)
*aPluginsChanged = PR_TRUE;
*aPluginsChanged = true;
// if we are just looking for possible changes,
// no need to proceed if changes are detected
@ -2413,7 +2413,7 @@ nsresult nsPluginHost::FindPlugins(bool aCreatePluginList, bool * aPluginsChange
// and therefor their info did not get removed from the cache info list during directory scan;
// flag this fact
if (cachecount > 0)
*aPluginsChanged = PR_TRUE;
*aPluginsChanged = true;
}
// Remove unseen invalid plugins
@ -2898,7 +2898,7 @@ nsPluginHost::ReadPluginInfo()
(const char* const*)mimetypes,
(const char* const*)mimedescriptions,
(const char* const*)extensions,
mimetypecount, lastmod, canunload, PR_TRUE);
mimetypecount, lastmod, canunload, true);
if (heapalloced)
delete [] heapalloced;
@ -3063,7 +3063,7 @@ nsresult nsPluginHost::NewPluginURLStream(const nsString& aURL,
if (scriptChannel) {
scriptChannel->SetExecutionPolicy(nsIScriptChannel::EXECUTE_NORMAL);
// Plug-ins seem to depend on javascript: URIs running synchronously
scriptChannel->SetExecuteAsync(PR_FALSE);
scriptChannel->SetExecuteAsync(false);
}
}
@ -3155,8 +3155,8 @@ nsPluginHost::AddHeadersToChannel(const char *aHeadersData,
// Iterate over the nsString: for each "\r\n" delimited chunk,
// add the value as a header to the nsIHTTPChannel
while (PR_TRUE) {
crlf = headersString.Find("\r\n", PR_TRUE);
while (true) {
crlf = headersString.Find("\r\n", true);
if (-1 == crlf) {
rv = NS_OK;
return rv;
@ -3175,7 +3175,7 @@ nsPluginHost::AddHeadersToChannel(const char *aHeadersData,
// FINALLY: we can set the header!
rv = aChannel->SetRequestHeader(headerName, headerValue, PR_TRUE);
rv = aChannel->SetRequestHeader(headerName, headerValue, true);
if (NS_FAILED(rv)) {
rv = NS_ERROR_NULL_POINTER;
return rv;
@ -3401,7 +3401,7 @@ nsPluginHost::HandleBadPlugin(PRLibrary* aLibrary, nsNPAPIPluginInstance *aInsta
if (NS_SUCCEEDED(rv) && checkboxState)
mDontShowBadPluginMessage = PR_TRUE;
mDontShowBadPluginMessage = true;
return rv;
}
@ -3571,7 +3571,7 @@ nsPluginHost::CreateTempFileToPost(const char *aPostDataURL, nsIFile **aTmpFile)
getter_AddRefs(inFile));
if (NS_FAILED(rv)) {
nsCOMPtr<nsILocalFile> localFile;
rv = NS_NewNativeLocalFile(nsDependentCString(aPostDataURL), PR_FALSE,
rv = NS_NewNativeLocalFile(nsDependentCString(aPostDataURL), false,
getter_AddRefs(localFile));
if (NS_FAILED(rv)) return rv;
inFile = localFile;
@ -3642,7 +3642,7 @@ nsPluginHost::CreateTempFileToPost(const char *aPostDataURL, nsIFile **aTmpFile)
if (NS_FAILED(rv) || (bw != br))
break;
firstRead = PR_FALSE;
firstRead = false;
continue;
}
bw = br;
@ -3674,9 +3674,9 @@ nsPluginHost::DeletePluginNativeWindow(nsPluginNativeWindow * aPluginNativeWindo
nsresult
nsPluginHost::InstantiateDummyJavaPlugin(nsIPluginInstanceOwner *aOwner)
{
// Pass PR_FALSE as the second arg, we want the answer to be the
// Pass false as the second arg, we want the answer to be the
// same here whether the Java plugin is enabled or not.
nsPluginTag *plugin = FindPluginForType("application/x-java-vm", PR_FALSE);
nsPluginTag *plugin = FindPluginForType("application/x-java-vm", false);
if (!plugin || !plugin->mIsNPRuntimeEnabledJavaPlugin) {
// No NPRuntime enabled Java plugin found, no point in
@ -3831,21 +3831,21 @@ CheckForDisabledWindows()
nsCOMPtr<nsIWidget> widget;
baseWin->GetMainWidget(getter_AddRefs(widget));
if (widget && !widget->GetParent() &&
NS_SUCCEEDED(widget->IsVisible(aFlag)) && aFlag == PR_TRUE &&
NS_SUCCEEDED(widget->IsEnabled(&aFlag)) && aFlag == PR_FALSE) {
NS_SUCCEEDED(widget->IsVisible(aFlag)) && aFlag == true &&
NS_SUCCEEDED(widget->IsEnabled(&aFlag)) && aFlag == false) {
nsIWidget * child = widget->GetFirstChild();
bool enable = true;
while (child) {
nsWindowType aType;
if (NS_SUCCEEDED(child->GetWindowType(aType)) &&
aType == eWindowType_dialog) {
enable = PR_FALSE;
enable = false;
break;
}
child = child->GetNextSibling();
}
if (enable) {
widget->Enable(PR_TRUE);
widget->Enable(true);
}
}
}
@ -4071,12 +4071,12 @@ PluginDestructionGuard::DelayDestroy(nsNPAPIPluginInstance *aInstance)
while (g != &sListHead) {
if (g->mInstance == aInstance) {
g->mDelayedDestroy = PR_TRUE;
g->mDelayedDestroy = true;
return PR_TRUE;
return true;
}
g = static_cast<PluginDestructionGuard*>(PR_NEXT_LINK(g));
}
return PR_FALSE;
return false;
}

View File

@ -368,7 +368,7 @@ protected:
{
NS_ASSERTION(NS_IsMainThread(), "Should be on the main thread");
mDelayedDestroy = PR_FALSE;
mDelayedDestroy = false;
PR_INIT_CLIST(this);
PR_INSERT_BEFORE(this, &sListHead);

View File

@ -163,7 +163,7 @@ public:
{
nsContentUtils::DispatchTrustedEvent(mContent->GetOwnerDoc(), mContent,
mFinished ? NS_LITERAL_STRING("MozPaintWaitFinished") : NS_LITERAL_STRING("MozPaintWait"),
PR_TRUE, PR_TRUE);
true, true);
return NS_OK;
}
@ -177,7 +177,7 @@ nsPluginInstanceOwner::NotifyPaintWaiter(nsDisplayListBuilder* aBuilder)
{
// This is notification for reftests about async plugin paint start
if (!mWaitingForPaint && !IsUpToDate() && aBuilder->ShouldSyncDecodeImages()) {
nsCOMPtr<nsIRunnable> event = new AsyncPaintWaitEvent(mContent, PR_FALSE);
nsCOMPtr<nsIRunnable> event = new AsyncPaintWaitEvent(mContent, false);
// Run this event as soon as it's safe to do so, since listeners need to
// receive it immediately
mWaitingForPaint = nsContentUtils::AddScriptRunner(event);
@ -218,11 +218,11 @@ nsPluginInstanceOwner::SetCurrentImage(ImageContainer* aContainer)
}
#endif
aContainer->SetCurrentImage(image);
return PR_TRUE;
return true;
}
}
aContainer->SetCurrentImage(nsnull);
return PR_FALSE;
return false;
}
void
@ -308,19 +308,19 @@ nsPluginInstanceOwner::nsPluginInstanceOwner()
memset(&mQDPluginPortCopy, 0, sizeof(NP_Port));
#endif
mInCGPaintLevel = 0;
mSentInitialTopLevelWindowEvent = PR_FALSE;
mSentInitialTopLevelWindowEvent = false;
mColorProfile = nsnull;
mPluginPortChanged = PR_FALSE;
mPluginPortChanged = false;
#endif
mContentFocused = PR_FALSE;
mWidgetVisible = PR_TRUE;
mPluginWindowVisible = PR_FALSE;
mPluginDocumentActiveState = PR_TRUE;
mContentFocused = false;
mWidgetVisible = true;
mPluginWindowVisible = false;
mPluginDocumentActiveState = true;
mNumCachedAttrs = 0;
mNumCachedParams = 0;
mCachedAttrParamNames = nsnull;
mCachedAttrParamValues = nsnull;
mDestroyWidget = PR_FALSE;
mDestroyWidget = false;
#ifdef XP_MACOSX
#ifndef NP_NO_QUICKDRAW
@ -330,7 +330,7 @@ nsPluginInstanceOwner::nsPluginInstanceOwner()
#endif
#endif
mWaitingForPaint = PR_FALSE;
mWaitingForPaint = false;
}
nsPluginInstanceOwner::~nsPluginInstanceOwner()
@ -340,7 +340,7 @@ nsPluginInstanceOwner::~nsPluginInstanceOwner()
if (mWaitingForPaint) {
// We don't care when the event is dispatched as long as it's "soon",
// since whoever needs it will be waiting for it.
nsCOMPtr<nsIRunnable> event = new AsyncPaintWaitEvent(mContent, PR_TRUE);
nsCOMPtr<nsIRunnable> event = new AsyncPaintWaitEvent(mContent, true);
NS_DispatchToMainThread(event);
}
@ -529,7 +529,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL,
nsAutoPopupStatePusher popupStatePusher((PopupControlState)blockPopups);
rv = lh->OnLinkClick(mContent, uri, unitarget.get(),
aPostStream, headersDataStream, PR_TRUE);
aPostStream, headersDataStream, true);
return rv;
}
@ -594,7 +594,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(NPRect *invalidRect)
if (mWaitingForPaint && (!mObjectFrame || IsUpToDate())) {
// We don't care when the event is dispatched as long as it's "soon",
// since whoever needs it will be waiting for it.
nsCOMPtr<nsIRunnable> event = new AsyncPaintWaitEvent(mContent, PR_TRUE);
nsCOMPtr<nsIRunnable> event = new AsyncPaintWaitEvent(mContent, true);
NS_DispatchToMainThread(event);
mWaitingForPaint = false;
}
@ -619,7 +619,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(NPRect *invalidRect)
mWidget->Invalidate(nsIntRect(invalidRect->left, invalidRect->top,
invalidRect->right - invalidRect->left,
invalidRect->bottom - invalidRect->top),
PR_FALSE);
false);
return NS_OK;
}
#endif
@ -752,7 +752,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::SetEventModel(PRInt32 eventModel)
NS_IMETHODIMP nsPluginInstanceOwner::SetWindow()
{
NS_ENSURE_TRUE(mObjectFrame, NS_ERROR_NULL_POINTER);
return mObjectFrame->CallSetWindow(PR_FALSE);
return mObjectFrame->CallSetWindow(false);
}
NPError nsPluginInstanceOwner::ShowNativeContextMenu(NPMenu* menu, void* event)
@ -776,13 +776,13 @@ NPBool nsPluginInstanceOwner::ConvertPoint(double sourceX, double sourceY, NPCoo
{
#ifdef XP_MACOSX
if (!mWidget)
return PR_FALSE;
return false;
return NS_NPAPI_ConvertPointCocoa(mWidget->GetNativeData(NS_NATIVE_WIDGET),
sourceX, sourceY, sourceSpace, destX, destY, destSpace);
#else
// we should implement this for all platforms
return PR_FALSE;
return false;
#endif
}
@ -1297,8 +1297,8 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays()
* leading or trailing white space.''
* However, do not trim consecutive spaces as in bug 122119
*/
name.Trim(" \n\r\t\b", PR_TRUE, PR_TRUE, PR_FALSE);
value.Trim(" \n\r\t\b", PR_TRUE, PR_TRUE, PR_FALSE);
name.Trim(" \n\r\t\b", true, true, false);
value.Trim(" \n\r\t\b", true, true, false);
mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(name);
mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(value);
nextAttrParamIndex++;
@ -1346,11 +1346,11 @@ NPDrawingModel nsPluginInstanceOwner::GetDrawingModel()
bool nsPluginInstanceOwner::IsRemoteDrawingCoreAnimation()
{
if (!mInstance)
return PR_FALSE;
return false;
bool coreAnimation;
if (!NS_SUCCEEDED(mInstance->IsRemoteDrawingCoreAnimation(&coreAnimation)))
return PR_FALSE;
return false;
return coreAnimation;
}
@ -1545,7 +1545,7 @@ void* nsPluginInstanceOwner::SetPluginPortAndDetectChange()
NP_Port* windowQDPort = static_cast<NP_Port*>(mPluginWindow->window);
if (windowQDPort->port != mQDPluginPortCopy.port) {
mQDPluginPortCopy.port = windowQDPort->port;
mPluginPortChanged = PR_TRUE;
mPluginPortChanged = true;
}
} else if (drawingModel == NPDrawingModelCoreGraphics ||
drawingModel == NPDrawingModelCoreAnimation ||
@ -1559,7 +1559,7 @@ void* nsPluginInstanceOwner::SetPluginPortAndDetectChange()
(windowCGPort->window != mCGPluginPortCopy.window)) {
mCGPluginPortCopy.context = windowCGPort->context;
mCGPluginPortCopy.window = windowCGPort->window;
mPluginPortChanged = PR_TRUE;
mPluginPortChanged = true;
}
}
#endif
@ -1691,7 +1691,7 @@ nsresult nsPluginInstanceOwner::DispatchFocusToPlugin(nsIDOMEvent* aFocusEvent)
event.data.lifecycle.action = kLoseFocus_ANPLifecycleAction;
}
else {
NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchFocusToPlugin, wierd eventType");
NS_ASSERTION(false, "nsPluginInstanceOwner::DispatchFocusToPlugin, wierd eventType");
}
mInstance->HandleEvent(&event, nsnull);
}
@ -1717,9 +1717,9 @@ nsresult nsPluginInstanceOwner::DispatchFocusToPlugin(nsIDOMEvent* aFocusEvent)
aFocusEvent->StopPropagation();
}
}
else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchFocusToPlugin failed, focusEvent null");
else NS_ASSERTION(false, "nsPluginInstanceOwner::DispatchFocusToPlugin failed, focusEvent null");
}
else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchFocusToPlugin failed, privateEvent null");
else NS_ASSERTION(false, "nsPluginInstanceOwner::DispatchFocusToPlugin failed, privateEvent null");
return NS_OK;
}
@ -1738,9 +1738,9 @@ nsresult nsPluginInstanceOwner::Text(nsIDOMEvent* aTextEvent)
aTextEvent->StopPropagation();
}
}
else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchTextToPlugin failed, textEvent null");
else NS_ASSERTION(false, "nsPluginInstanceOwner::DispatchTextToPlugin failed, textEvent null");
}
else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchTextToPlugin failed, privateEvent null");
else NS_ASSERTION(false, "nsPluginInstanceOwner::DispatchTextToPlugin failed, privateEvent null");
}
return NS_OK;
@ -1775,9 +1775,9 @@ nsresult nsPluginInstanceOwner::KeyPress(nsIDOMEvent* aKeyEvent)
if (sInKeyDispatch)
return aKeyEvent->PreventDefault(); // consume event
sInKeyDispatch = PR_TRUE;
sInKeyDispatch = true;
nsresult rv = DispatchKeyToPlugin(aKeyEvent);
sInKeyDispatch = PR_FALSE;
sInKeyDispatch = false;
return rv;
}
#endif
@ -1816,9 +1816,9 @@ nsresult nsPluginInstanceOwner::DispatchKeyToPlugin(nsIDOMEvent* aKeyEvent)
aKeyEvent->StopPropagation();
}
}
else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchKeyToPlugin failed, keyEvent null");
else NS_ASSERTION(false, "nsPluginInstanceOwner::DispatchKeyToPlugin failed, keyEvent null");
}
else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchKeyToPlugin failed, privateEvent null");
else NS_ASSERTION(false, "nsPluginInstanceOwner::DispatchKeyToPlugin failed, privateEvent null");
}
return NS_OK;
@ -1854,9 +1854,9 @@ nsPluginInstanceOwner::MouseDown(nsIDOMEvent* aMouseEvent)
return aMouseEvent->PreventDefault(); // consume event
}
}
else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::MouseDown failed, mouseEvent null");
else NS_ASSERTION(false, "nsPluginInstanceOwner::MouseDown failed, mouseEvent null");
}
else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::MouseDown failed, privateEvent null");
else NS_ASSERTION(false, "nsPluginInstanceOwner::MouseDown failed, privateEvent null");
return NS_OK;
}
@ -1882,9 +1882,9 @@ nsresult nsPluginInstanceOwner::DispatchMouseToPlugin(nsIDOMEvent* aMouseEvent)
aMouseEvent->StopPropagation();
}
}
else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchMouseToPlugin failed, mouseEvent null");
else NS_ASSERTION(false, "nsPluginInstanceOwner::DispatchMouseToPlugin failed, mouseEvent null");
}
else NS_ASSERTION(PR_FALSE, "nsPluginInstanceOwner::DispatchMouseToPlugin failed, privateEvent null");
else NS_ASSERTION(false, "nsPluginInstanceOwner::DispatchMouseToPlugin failed, privateEvent null");
return NS_OK;
}
@ -1895,11 +1895,11 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
nsAutoString eventType;
aEvent->GetType(eventType);
if (eventType.EqualsLiteral("focus")) {
mContentFocused = PR_TRUE;
mContentFocused = true;
return DispatchFocusToPlugin(aEvent);
}
if (eventType.EqualsLiteral("blur")) {
mContentFocused = PR_FALSE;
mContentFocused = false;
return DispatchFocusToPlugin(aEvent);
}
if (eventType.EqualsLiteral("mousedown")) {
@ -2202,7 +2202,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const nsGUIEvent& anEvent)
nsPresContext* presContext = mObjectFrame->PresContext();
nsIntPoint ptPx(presContext->AppUnitsToDevPixels(pt.x),
presContext->AppUnitsToDevPixels(pt.y));
nsIntPoint widgetPtPx = ptPx + mObjectFrame->GetWindowOriginInPixels(PR_TRUE);
nsIntPoint widgetPtPx = ptPx + mObjectFrame->GetWindowOriginInPixels(true);
pPluginEvent->lParam = MAKELPARAM(widgetPtPx.x, widgetPtPx.y);
}
}
@ -2612,30 +2612,30 @@ nsPluginInstanceOwner::Destroy()
mCXMenuListener = nsnull;
}
mContent->RemoveEventListener(NS_LITERAL_STRING("focus"), this, PR_FALSE);
mContent->RemoveEventListener(NS_LITERAL_STRING("blur"), this, PR_FALSE);
mContent->RemoveEventListener(NS_LITERAL_STRING("mouseup"), this, PR_FALSE);
mContent->RemoveEventListener(NS_LITERAL_STRING("mousedown"), this, PR_FALSE);
mContent->RemoveEventListener(NS_LITERAL_STRING("mousemove"), this, PR_FALSE);
mContent->RemoveEventListener(NS_LITERAL_STRING("click"), this, PR_FALSE);
mContent->RemoveEventListener(NS_LITERAL_STRING("dblclick"), this, PR_FALSE);
mContent->RemoveEventListener(NS_LITERAL_STRING("mouseover"), this, PR_FALSE);
mContent->RemoveEventListener(NS_LITERAL_STRING("mouseout"), this, PR_FALSE);
mContent->RemoveEventListener(NS_LITERAL_STRING("keypress"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("keydown"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("keyup"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("drop"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragdrop"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("drag"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragenter"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragover"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragleave"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragexit"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragstart"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("draggesture"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragend"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("focus"), this, false);
mContent->RemoveEventListener(NS_LITERAL_STRING("blur"), this, false);
mContent->RemoveEventListener(NS_LITERAL_STRING("mouseup"), this, false);
mContent->RemoveEventListener(NS_LITERAL_STRING("mousedown"), this, false);
mContent->RemoveEventListener(NS_LITERAL_STRING("mousemove"), this, false);
mContent->RemoveEventListener(NS_LITERAL_STRING("click"), this, false);
mContent->RemoveEventListener(NS_LITERAL_STRING("dblclick"), this, false);
mContent->RemoveEventListener(NS_LITERAL_STRING("mouseover"), this, false);
mContent->RemoveEventListener(NS_LITERAL_STRING("mouseout"), this, false);
mContent->RemoveEventListener(NS_LITERAL_STRING("keypress"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("keydown"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("keyup"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("drop"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragdrop"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("drag"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragenter"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragover"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragleave"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragexit"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragstart"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("draggesture"), this, true);
mContent->RemoveEventListener(NS_LITERAL_STRING("dragend"), this, true);
#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
mContent->RemoveEventListener(NS_LITERAL_STRING("text"), this, PR_TRUE);
mContent->RemoveEventListener(NS_LITERAL_STRING("text"), this, true);
#endif
if (mWidget) {
@ -2683,15 +2683,15 @@ nsPluginInstanceOwner::PrepareToStop(bool aDelayedStop)
// Also hide and disable the widget to avoid it from appearing in
// odd places after reparenting it, but before it gets destroyed.
mWidget->Show(PR_FALSE);
mWidget->Enable(PR_FALSE);
mWidget->Show(false);
mWidget->Enable(false);
// Reparent the plugins native window. This relies on the widget
// and plugin et al not holding any other references to its
// parent.
mWidget->SetParent(nsnull);
mDestroyWidget = PR_TRUE;
mDestroyWidget = true;
}
#endif
@ -2858,7 +2858,7 @@ void nsPluginInstanceOwner::Paint(gfxContext* aContext,
/*
gfxMatrix currentMatrix = aContext->CurrentMatrix();
gfxSize scale = currentMatrix.ScaleFactors(PR_TRUE);
gfxSize scale = currentMatrix.ScaleFactors(true);
printf_stderr("!!!!!!!! scale!!: %f x %f\n", scale.width, scale.height);
*/
@ -3028,13 +3028,13 @@ nsPluginInstanceOwner::Renderer::DrawWithXlib(gfxXlibSurface* xsurface,
if (mWindow->x != offset.x || mWindow->y != offset.y) {
mWindow->x = offset.x;
mWindow->y = offset.y;
doupdatewindow = PR_TRUE;
doupdatewindow = true;
}
if (nsIntSize(mWindow->width, mWindow->height) != mPluginSize) {
mWindow->width = mPluginSize.width;
mWindow->height = mPluginSize.height;
doupdatewindow = PR_TRUE;
doupdatewindow = true;
}
// The clip rect is relative to drawable top-left.
@ -3073,7 +3073,7 @@ nsPluginInstanceOwner::Renderer::DrawWithXlib(gfxXlibSurface* xsurface,
mWindow->clipRect.right != newClipRect.right ||
mWindow->clipRect.bottom != newClipRect.bottom) {
mWindow->clipRect = newClipRect;
doupdatewindow = PR_TRUE;
doupdatewindow = true;
}
NPSetWindowCallbackStruct* ws_info =
@ -3083,7 +3083,7 @@ nsPluginInstanceOwner::Renderer::DrawWithXlib(gfxXlibSurface* xsurface,
ws_info->visual = visual;
ws_info->colormap = colormap;
ws_info->depth = gfxXlibSurface::DepthOfVisual(screen, visual);
doupdatewindow = PR_TRUE;
doupdatewindow = true;
}
#endif
@ -3202,39 +3202,39 @@ nsresult nsPluginInstanceOwner::Init(nsPresContext* aPresContext,
mCXMenuListener->Init(aContent);
}
mContent->AddEventListener(NS_LITERAL_STRING("focus"), this, PR_FALSE,
PR_FALSE);
mContent->AddEventListener(NS_LITERAL_STRING("blur"), this, PR_FALSE,
PR_FALSE);
mContent->AddEventListener(NS_LITERAL_STRING("mouseup"), this, PR_FALSE,
PR_FALSE);
mContent->AddEventListener(NS_LITERAL_STRING("mousedown"), this, PR_FALSE,
PR_FALSE);
mContent->AddEventListener(NS_LITERAL_STRING("mousemove"), this, PR_FALSE,
PR_FALSE);
mContent->AddEventListener(NS_LITERAL_STRING("click"), this, PR_FALSE,
PR_FALSE);
mContent->AddEventListener(NS_LITERAL_STRING("dblclick"), this, PR_FALSE,
PR_FALSE);
mContent->AddEventListener(NS_LITERAL_STRING("mouseover"), this, PR_FALSE,
PR_FALSE);
mContent->AddEventListener(NS_LITERAL_STRING("mouseout"), this, PR_FALSE,
PR_FALSE);
mContent->AddEventListener(NS_LITERAL_STRING("keypress"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("keydown"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("keyup"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("drop"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("dragdrop"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("drag"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("dragenter"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("dragover"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("dragleave"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("dragexit"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("dragstart"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("draggesture"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("dragend"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("focus"), this, false,
false);
mContent->AddEventListener(NS_LITERAL_STRING("blur"), this, false,
false);
mContent->AddEventListener(NS_LITERAL_STRING("mouseup"), this, false,
false);
mContent->AddEventListener(NS_LITERAL_STRING("mousedown"), this, false,
false);
mContent->AddEventListener(NS_LITERAL_STRING("mousemove"), this, false,
false);
mContent->AddEventListener(NS_LITERAL_STRING("click"), this, false,
false);
mContent->AddEventListener(NS_LITERAL_STRING("dblclick"), this, false,
false);
mContent->AddEventListener(NS_LITERAL_STRING("mouseover"), this, false,
false);
mContent->AddEventListener(NS_LITERAL_STRING("mouseout"), this, false,
false);
mContent->AddEventListener(NS_LITERAL_STRING("keypress"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("keydown"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("keyup"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("drop"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("dragdrop"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("drag"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("dragenter"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("dragover"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("dragleave"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("dragexit"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("dragstart"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("draggesture"), this, true);
mContent->AddEventListener(NS_LITERAL_STRING("dragend"), this, true);
#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
mContent->AddEventListener(NS_LITERAL_STRING("text"), this, PR_TRUE);
mContent->AddEventListener(NS_LITERAL_STRING("text"), this, true);
#endif
// Register scroll position listeners
@ -3302,7 +3302,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void)
if (NS_OK == rv) {
mWidget = mObjectFrame->GetWidget();
if (PR_TRUE == windowless) {
if (true == windowless) {
mPluginWindow->type = NPWindowTypeDrawable;
// this needs to be a HDC according to the spec, but I do
@ -3348,7 +3348,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void)
#ifdef MAC_CARBON_PLUGINS
// start the idle timer.
StartTimer(PR_TRUE);
StartTimer(true);
#endif
// tell the plugin window about the widget
@ -3475,30 +3475,30 @@ void* nsPluginInstanceOwner::FixUpPluginWindow(PRInt32 inPaintState)
mPluginWindow->clipRect.bottom != oldClipRect.bottom)
{
CallSetWindow();
mPluginPortChanged = PR_FALSE;
mPluginPortChanged = false;
#ifdef MAC_CARBON_PLUGINS
// if the clipRect is of size 0, make the null timer fire less often
CancelTimer();
if (mPluginWindow->clipRect.left == mPluginWindow->clipRect.right ||
mPluginWindow->clipRect.top == mPluginWindow->clipRect.bottom) {
StartTimer(PR_FALSE);
StartTimer(false);
}
else {
StartTimer(PR_TRUE);
StartTimer(true);
}
#endif
} else if (mPluginPortChanged) {
CallSetWindow();
mPluginPortChanged = PR_FALSE;
mPluginPortChanged = false;
}
// After the first NPP_SetWindow call we need to send an initial
// top-level window focus event.
if (eventModel == NPEventModelCocoa && !mSentInitialTopLevelWindowEvent) {
// Set this before calling ProcessEvent to avoid endless recursion.
mSentInitialTopLevelWindowEvent = PR_TRUE;
mSentInitialTopLevelWindowEvent = true;
nsPluginEvent pluginEvent(PR_TRUE, NS_PLUGIN_FOCUS_EVENT, nsnull);
nsPluginEvent pluginEvent(true, NS_PLUGIN_FOCUS_EVENT, nsnull);
NPCocoaEvent cocoaEvent;
InitializeNPCocoaEvent(&cocoaEvent);
cocoaEvent.type = NPCocoaEventWindowFocusChanged;
@ -3529,7 +3529,7 @@ nsPluginInstanceOwner::HidePluginWindow()
mPluginWindow->clipRect.bottom = mPluginWindow->clipRect.top;
mPluginWindow->clipRect.right = mPluginWindow->clipRect.left;
mWidgetVisible = PR_FALSE;
mWidgetVisible = false;
if (mAsyncHidePluginWindow) {
mInstance->AsyncSetWindow(mPluginWindow);
} else {
@ -3605,14 +3605,14 @@ void
nsPluginInstanceOwner::UpdateWindowVisibility(bool aVisible)
{
mPluginWindowVisible = aVisible;
UpdateWindowPositionAndClipRect(PR_TRUE);
UpdateWindowPositionAndClipRect(true);
}
void
nsPluginInstanceOwner::UpdateDocumentActiveState(bool aIsActive)
{
mPluginDocumentActiveState = aIsActive;
UpdateWindowPositionAndClipRect(PR_TRUE);
UpdateWindowPositionAndClipRect(true);
}
#endif // XP_MACOSX
@ -3670,7 +3670,7 @@ nsresult nsPluginDOMContextMenuListener::Init(nsIContent* aContent)
{
nsCOMPtr<nsIDOMEventTarget> receiver(do_QueryInterface(aContent));
if (receiver) {
receiver->AddEventListener(NS_LITERAL_STRING("contextmenu"), this, PR_TRUE);
receiver->AddEventListener(NS_LITERAL_STRING("contextmenu"), this, true);
return NS_OK;
}
@ -3682,7 +3682,7 @@ nsresult nsPluginDOMContextMenuListener::Destroy(nsIContent* aContent)
// Unregister context menu listener
nsCOMPtr<nsIDOMEventTarget> receiver(do_QueryInterface(aContent));
if (receiver) {
receiver->RemoveEventListener(NS_LITERAL_STRING("contextmenu"), this, PR_TRUE);
receiver->RemoveEventListener(NS_LITERAL_STRING("contextmenu"), this, true);
}
return NS_OK;

View File

@ -267,9 +267,9 @@ public:
(MatchPluginName("Shockwave Flash") ||
MatchPluginName("Test Plug-in"));
#elif defined(MOZ_X11) || defined(XP_MACOSX)
return PR_TRUE;
return true;
#else
return PR_FALSE;
return false;
#endif
}

View File

@ -69,7 +69,7 @@ class nsPluginManifestLineReader
bool NextLine()
{
if (mNext >= mLimit)
return PR_FALSE;
return false;
mCur = mNext;
mLength = 0;
@ -79,7 +79,7 @@ class nsPluginManifestLineReader
if (IsEOL(*mNext)) {
if (lastDelimiter) {
if (lastDelimiter && *(mNext - 1) != PLUGIN_REGISTRY_END_OF_LINE_MARKER)
return PR_FALSE;
return false;
*lastDelimiter = '\0';
} else {
*mNext = '\0';
@ -89,14 +89,14 @@ class nsPluginManifestLineReader
if (!IsEOL(*mNext))
break;
}
return PR_TRUE;
return true;
}
if (*mNext == PLUGIN_REGISTRY_FIELD_DELIMITER)
lastDelimiter = mNext;
++mNext;
++mLength;
}
return PR_FALSE;
return false;
}
int ParseLine(char** chunks, int maxChunks)

View File

@ -124,7 +124,7 @@ nsresult nsPluginNativeWindowGtk2::CallSetWindow(nsRefPtr<nsNPAPIPluginInstance>
rv = aPluginInstance->GetValueFromPlugin(NPPVpluginNeedsXEmbed, &needXEmbed);
// If the call returned an error code make sure we still use our default value.
if (NS_FAILED(rv)) {
needXEmbed = PR_FALSE;
needXEmbed = false;
}
#ifdef DEBUG
printf("nsPluginNativeWindowGtk2: NPPVpluginNeedsXEmbed=%d\n", needXEmbed);

View File

@ -151,7 +151,7 @@ private:
NS_IMETHODIMP nsDelayedPopupsEnabledEvent::Run()
{
mInst->PushPopupsEnabledState(PR_FALSE);
mInst->PushPopupsEnabledState(false);
return NS_OK;
}
@ -214,15 +214,15 @@ static bool ProcessFlashMessageDelayed(nsPluginNativeWindowOS2 * aWin,
}
if (msg != WM_USER_FLASH)
return PR_FALSE; // no need to delay
return false; // no need to delay
// do stuff
nsCOMPtr<nsIRunnable> pwe = aWin->GetPluginWindowEvent(hWnd, msg, mp1, mp2);
if (pwe) {
NS_DispatchToCurrentThread(pwe);
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
/*****************************************************************************/
@ -274,7 +274,7 @@ static MRESULT EXPENTRY PluginWndProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM m
nsCOMPtr<nsIWidget> widget;
win->GetPluginWidget(getter_AddRefs(widget));
if (widget)
widget->CaptureMouse(PR_TRUE);
widget->CaptureMouse(true);
break;
}
@ -282,12 +282,12 @@ static MRESULT EXPENTRY PluginWndProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM m
case WM_BUTTON2UP:
case WM_BUTTON3UP: {
if (msg == WM_BUTTON1UP)
enablePopups = PR_TRUE;
enablePopups = true;
nsCOMPtr<nsIWidget> widget;
win->GetPluginWidget(getter_AddRefs(widget));
if (widget)
widget->CaptureMouse(PR_FALSE);
widget->CaptureMouse(false);
break;
}
@ -295,7 +295,7 @@ static MRESULT EXPENTRY PluginWndProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM m
// Ignore repeating keydown messages...
if (SHORT1FROMMP(mp1) & KC_PREVDOWN)
break;
enablePopups = PR_TRUE;
enablePopups = true;
break;
// When the child of a plugin gets the focus, nsWindow doesn't get
@ -340,7 +340,7 @@ static MRESULT EXPENTRY PluginWndProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM m
PRUint16 apiVersion;
if (NS_SUCCEEDED(inst->GetPluginAPIVersion(&apiVersion)) &&
!versionOK(apiVersion, NP_POPUP_API_VERSION))
inst->PushPopupsEnabledState(PR_TRUE);
inst->PushPopupsEnabledState(true);
}
MRESULT res = (MRESULT)TRUE;

View File

@ -189,15 +189,15 @@ static bool ProcessFlashMessageDelayed(nsPluginNativeWindowWin * aWin, nsNPAPIPl
}
if (msg != WM_USER_FLASH)
return PR_FALSE; // no need to delay
return false; // no need to delay
// do stuff
nsCOMPtr<nsIRunnable> pwe = aWin->GetPluginWindowEvent(hWnd, msg, wParam, lParam);
if (pwe) {
NS_DispatchToCurrentThread(pwe);
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
class nsDelayedPopupsEnabledEvent : public nsRunnable
@ -215,7 +215,7 @@ private:
NS_IMETHODIMP nsDelayedPopupsEnabledEvent::Run()
{
mInst->PushPopupsEnabledState(PR_FALSE);
mInst->PushPopupsEnabledState(false);
return NS_OK;
}
@ -239,7 +239,7 @@ static LRESULT CALLBACK PluginWndProcInternal(HWND hWnd, UINT msg, WPARAM wParam
// on the floor if we get into this recursive situation. See bug 192914.
if (win->mPluginType == nsPluginType_Real) {
if (sInMessageDispatch && msg == sLastMsg)
return PR_TRUE;
return true;
// Cache the last message sent
sLastMsg = msg;
}
@ -258,11 +258,11 @@ static LRESULT CALLBACK PluginWndProcInternal(HWND hWnd, UINT msg, WPARAM wParam
nsCOMPtr<nsIWidget> widget;
win->GetPluginWidget(getter_AddRefs(widget));
if (widget)
widget->CaptureMouse(PR_TRUE);
widget->CaptureMouse(true);
break;
}
case WM_LBUTTONUP:
enablePopups = PR_TRUE;
enablePopups = true;
// fall through
case WM_MBUTTONUP:
@ -270,7 +270,7 @@ static LRESULT CALLBACK PluginWndProcInternal(HWND hWnd, UINT msg, WPARAM wParam
nsCOMPtr<nsIWidget> widget;
win->GetPluginWidget(getter_AddRefs(widget));
if (widget)
widget->CaptureMouse(PR_FALSE);
widget->CaptureMouse(false);
break;
}
case WM_KEYDOWN:
@ -281,7 +281,7 @@ static LRESULT CALLBACK PluginWndProcInternal(HWND hWnd, UINT msg, WPARAM wParam
// fall through
case WM_KEYUP:
enablePopups = PR_TRUE;
enablePopups = true;
break;
@ -303,7 +303,7 @@ static LRESULT CALLBACK PluginWndProcInternal(HWND hWnd, UINT msg, WPARAM wParam
nsCOMPtr<nsIWidget> widget;
win->GetPluginWidget(getter_AddRefs(widget));
if (widget) {
nsGUIEvent event(PR_TRUE, NS_PLUGIN_ACTIVATE, widget);
nsGUIEvent event(true, NS_PLUGIN_ACTIVATE, widget);
nsEventStatus status;
widget->DispatchEvent(&event, status);
}
@ -322,9 +322,9 @@ static LRESULT CALLBACK PluginWndProcInternal(HWND hWnd, UINT msg, WPARAM wParam
// recursively.
WNDPROC prevWndProc = win->GetPrevWindowProc();
if (prevWndProc && !sInPreviousMessageDispatch) {
sInPreviousMessageDispatch = PR_TRUE;
sInPreviousMessageDispatch = true;
::CallWindowProc(prevWndProc, hWnd, msg, wParam, lParam);
sInPreviousMessageDispatch = PR_FALSE;
sInPreviousMessageDispatch = false;
}
break;
}
@ -342,18 +342,18 @@ static LRESULT CALLBACK PluginWndProcInternal(HWND hWnd, UINT msg, WPARAM wParam
PRUint16 apiVersion;
if (NS_SUCCEEDED(inst->GetPluginAPIVersion(&apiVersion)) &&
!versionOK(apiVersion, NP_POPUP_API_VERSION)) {
inst->PushPopupsEnabledState(PR_TRUE);
inst->PushPopupsEnabledState(true);
}
}
sInMessageDispatch = PR_TRUE;
sInMessageDispatch = true;
LRESULT res = TRUE;
NS_TRY_SAFE_CALL_RETURN(res,
::CallWindowProc((WNDPROC)win->GetWindowProc(), hWnd, msg, wParam, lParam),
inst);
sInMessageDispatch = PR_FALSE;
sInMessageDispatch = false;
if (inst) {
// Popups are enabled (were enabled before the call to
@ -427,8 +427,8 @@ SetWindowLongHookCheck(HWND hWnd,
if (!win || (win && win->mPluginType != nsPluginType_Flash) ||
(nIndex == GWLP_WNDPROC &&
newLong == reinterpret_cast<LONG_PTR>(PluginWndProc)))
return PR_TRUE;
return PR_FALSE;
return true;
return false;
}
#ifdef _WIN64

View File

@ -73,7 +73,7 @@ PR_BEGIN_MACRO \
{ \
ret = fun; \
} \
MOZ_SEH_EXCEPT(PR_TRUE) \
MOZ_SEH_EXCEPT(true) \
{ \
nsresult res; \
nsCOMPtr<nsIPluginHost> host(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &res));\
@ -96,7 +96,7 @@ PR_BEGIN_MACRO \
{ \
fun; \
} \
MOZ_SEH_EXCEPT(PR_TRUE) \
MOZ_SEH_EXCEPT(true) \
{ \
nsresult res; \
nsCOMPtr<nsIPluginHost> host(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &res));\

View File

@ -93,7 +93,7 @@ NS_IMPL_ISUPPORTS3(nsPluginByteRangeStreamListener,
nsPluginByteRangeStreamListener::nsPluginByteRangeStreamListener(nsIWeakReference* aWeakPtr)
{
mWeakPtrPluginStreamListenerPeer = aWeakPtr;
mRemoveMagicNumber = PR_FALSE;
mRemoveMagicNumber = false;
}
nsPluginByteRangeStreamListener::~nsPluginByteRangeStreamListener()
@ -165,7 +165,7 @@ nsPluginByteRangeStreamListener::OnStartRequest(nsIRequest *request, nsISupports
&bWantsAllNetworkStreams);
// If the call returned an error code make sure we still use our default value.
if (NS_FAILED(rv)) {
bWantsAllNetworkStreams = PR_FALSE;
bWantsAllNetworkStreams = false;
}
if (!bWantsAllNetworkStreams){
@ -176,7 +176,7 @@ nsPluginByteRangeStreamListener::OnStartRequest(nsIRequest *request, nsISupports
// if server cannot continue with byte range (206 status) and sending us whole object (200 status)
// reset this seekable stream & try serve it to plugin instance as a file
mStreamConverter = finalStreamListener;
mRemoveMagicNumber = PR_TRUE;
mRemoveMagicNumber = true;
rv = pslp->ServeStreamAsFile(request, ctxt);
return rv;
@ -229,7 +229,7 @@ CachedFileHolder::CachedFileHolder(nsIFile* cacheFile)
CachedFileHolder::~CachedFileHolder()
{
mFile->Remove(PR_FALSE);
mFile->Remove(false);
}
void
@ -311,15 +311,15 @@ NS_IMPL_ISUPPORTS8(nsPluginStreamListenerPeer,
nsPluginStreamListenerPeer::nsPluginStreamListenerPeer()
{
mStreamType = NP_NORMAL;
mStartBinding = PR_FALSE;
mAbort = PR_FALSE;
mRequestFailed = PR_FALSE;
mStartBinding = false;
mAbort = false;
mRequestFailed = false;
mPendingRequests = 0;
mHaveFiredOnStartRequest = PR_FALSE;
mHaveFiredOnStartRequest = false;
mDataForwardToRequest = nsnull;
mSeekable = PR_FALSE;
mSeekable = false;
mModified = 0;
mStreamOffset = 0;
mStreamComplete = 0;
@ -371,7 +371,7 @@ nsresult nsPluginStreamListenerPeer::Initialize(nsIURI *aURL,
mPendingRequests = 1;
mDataForwardToRequest = new nsHashtable(16, PR_FALSE);
mDataForwardToRequest = new nsHashtable(16, false);
if (!mDataForwardToRequest)
return NS_ERROR_FAILURE;
@ -408,7 +408,7 @@ nsresult nsPluginStreamListenerPeer::InitializeEmbedded(nsIURI *aURL,
mPendingRequests = 1;
mDataForwardToRequest = new nsHashtable(16, PR_FALSE);
mDataForwardToRequest = new nsHashtable(16, false);
if (!mDataForwardToRequest)
return NS_ERROR_FAILURE;
@ -426,7 +426,7 @@ nsresult nsPluginStreamListenerPeer::InitializeFullPage(nsIURI* aURL, nsNPAPIPlu
mURL = aURL;
mDataForwardToRequest = new nsHashtable(16, PR_FALSE);
mDataForwardToRequest = new nsHashtable(16, false);
if (!mDataForwardToRequest)
return NS_ERROR_FAILURE;
@ -534,7 +534,7 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
return NS_OK;
}
mHaveFiredOnStartRequest = PR_TRUE;
mHaveFiredOnStartRequest = true;
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
NS_ENSURE_TRUE(channel, NS_ERROR_FAILURE);
@ -550,7 +550,7 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
// in nsNPAPIPluginStreamListener::CleanUpStream
// return error will cancel this request
// ...and we also need to tell the plugin that
mRequestFailed = PR_TRUE;
mRequestFailed = true;
return NS_ERROR_FAILURE;
}
@ -560,11 +560,11 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
&bWantsAllNetworkStreams);
// If the call returned an error code make sure we still use our default value.
if (NS_FAILED(rv)) {
bWantsAllNetworkStreams = PR_FALSE;
bWantsAllNetworkStreams = false;
}
if (!bWantsAllNetworkStreams) {
mRequestFailed = PR_TRUE;
mRequestFailed = true;
return NS_ERROR_FAILURE;
}
}
@ -604,7 +604,7 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
nsCOMPtr<nsIFileChannel> fileChannel = do_QueryInterface(channel);
if (fileChannel) {
// file does not exist
mRequestFailed = PR_TRUE;
mRequestFailed = true;
return NS_ERROR_FAILURE;
}
mLength = 0;
@ -755,7 +755,7 @@ nsPluginStreamListenerPeer::MakeByteRangeString(NPByteRange* aRangeList, nsACStr
}
// get rid of possible trailing comma
string.Trim(",", PR_FALSE);
string.Trim(",", false);
rangeRequest = string;
*numRequests = requestCnt;
@ -786,9 +786,9 @@ nsPluginStreamListenerPeer::RequestRead(NPByteRange* rangeList)
if (!httpChannel)
return NS_ERROR_FAILURE;
httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Range"), rangeString, PR_FALSE);
httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Range"), rangeString, false);
mAbort = PR_TRUE; // instruct old stream listener to cancel
mAbort = true; // instruct old stream listener to cancel
// the request on the next ODA.
nsCOMPtr<nsIStreamListener> converter;
@ -865,7 +865,7 @@ nsresult nsPluginStreamListenerPeer::ServeStreamAsFile(nsIRequest *request,
owner->SetWindow();
}
mSeekable = PR_FALSE;
mSeekable = false;
mPStreamListener->OnStartBinding(this);
mStreamOffset = 0;
@ -874,7 +874,7 @@ nsresult nsPluginStreamListenerPeer::ServeStreamAsFile(nsIRequest *request,
// then check it out if browser cache is not available
nsCOMPtr<nsICachingChannel> cacheChannel = do_QueryInterface(request);
if (!(cacheChannel && (NS_SUCCEEDED(cacheChannel->SetCacheAsFile(PR_TRUE))))) {
if (!(cacheChannel && (NS_SUCCEEDED(cacheChannel->SetCacheAsFile(true))))) {
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
if (channel) {
SetupPluginCacheFile(channel);
@ -890,16 +890,16 @@ nsresult nsPluginStreamListenerPeer::ServeStreamAsFile(nsIRequest *request,
bool
nsPluginStreamListenerPeer::UseExistingPluginCacheFile(nsPluginStreamListenerPeer* psi)
{
NS_ENSURE_TRUE(psi, PR_FALSE);
NS_ENSURE_TRUE(psi, false);
if (psi->mLength == mLength &&
psi->mModified == mModified &&
mStreamComplete &&
mURLSpec.Equals(psi->mURLSpec))
{
return PR_TRUE;
return true;
}
return PR_FALSE;
return false;
}
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIRequest *request,
@ -922,7 +922,7 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIRequest *request,
if (magicNumber != MAGIC_REQUEST_CONTEXT) {
// this is not one of our range requests
mAbort = PR_FALSE;
mAbort = false;
return NS_BINDING_ABORTED;
}
}
@ -1124,7 +1124,7 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIRequest *request,
}
if (NS_SUCCEEDED(aStatus)) {
mStreamComplete = PR_TRUE;
mStreamComplete = true;
}
return NS_OK;
@ -1203,7 +1203,7 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request,
// Also provide all HTTP response headers to our listener.
httpChannel->VisitResponseHeaders(this);
mSeekable = PR_FALSE;
mSeekable = false;
// first we look for a content-encoding header. If we find one, we tell the
// plugin that stream is not seekable, because the plugin always sees
// uncompressed data, so it can't make meaningful range requests on a
@ -1214,7 +1214,7 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request,
nsCAutoString contentEncoding;
if (NS_SUCCEEDED(httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Encoding"),
contentEncoding))) {
useLocalCache = PR_TRUE;
useLocalCache = true;
} else {
// set seekability (seekable if the stream has a known length and if the
// http server accepts byte ranges).
@ -1224,7 +1224,7 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request,
nsCAutoString range;
if (NS_SUCCEEDED(httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("accept-ranges"), range)) &&
range.Equals(NS_LITERAL_CSTRING("bytes"), nsCaseInsensitiveCStringComparator())) {
mSeekable = PR_TRUE;
mSeekable = true;
}
}
}
@ -1235,7 +1235,7 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request,
if (NS_SUCCEEDED(httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("last-modified"), lastModified)) &&
!lastModified.IsEmpty()) {
PRTime time64;
PR_ParseTimeString(lastModified.get(), PR_TRUE, &time64); //convert string time to integer time
PR_ParseTimeString(lastModified.get(), true, &time64); //convert string time to integer time
// Convert PRTime to unix-style time_t, i.e. seconds since the epoch
double fpTime;
@ -1246,7 +1246,7 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request,
rv = mPStreamListener->OnStartBinding(this);
mStartBinding = PR_TRUE;
mStartBinding = true;
if (NS_FAILED(rv))
return rv;
@ -1259,8 +1259,8 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request,
if (!fileChannel) {
// and browser cache is not available
nsCOMPtr<nsICachingChannel> cacheChannel = do_QueryInterface(request);
if (!(cacheChannel && (NS_SUCCEEDED(cacheChannel->SetCacheAsFile(PR_TRUE))))) {
useLocalCache = PR_TRUE;
if (!(cacheChannel && (NS_SUCCEEDED(cacheChannel->SetCacheAsFile(true))))) {
useLocalCache = true;
}
}
}

View File

@ -133,11 +133,11 @@ private:
nsCOMPtr<nsIPluginInstanceOwner> mOwner;
nsRefPtr<nsNPAPIPluginStreamListener> mPStreamListener;
// Set to PR_TRUE if we request failed (like with a HTTP response of 404)
// Set to true if we request failed (like with a HTTP response of 404)
bool mRequestFailed;
/*
* Set to PR_TRUE after nsIPluginStreamListener::OnStartBinding() has
* Set to true after nsIPluginStreamListener::OnStartBinding() has
* been called. Checked in ::OnStopRequest so we can call the
* plugin's OnStartBinding if, for some reason, it has not already
* been called.

View File

@ -80,7 +80,7 @@ mMimeTypes(aPluginTag->mMimeTypes),
mMimeDescriptions(aPluginTag->mMimeDescriptions),
mExtensions(aPluginTag->mExtensions),
mLibrary(nsnull),
mCanUnloadLibrary(PR_TRUE),
mCanUnloadLibrary(true),
mIsJavaPlugin(aPluginTag->mIsJavaPlugin),
mIsNPRuntimeEnabledJavaPlugin(aPluginTag->mIsNPRuntimeEnabledJavaPlugin),
mIsFlashPlugin(aPluginTag->mIsFlashPlugin),
@ -98,13 +98,13 @@ mName(aPluginInfo->fName),
mDescription(aPluginInfo->fDescription),
mLibrary(nsnull),
#ifdef XP_MACOSX
mCanUnloadLibrary(PR_FALSE),
mCanUnloadLibrary(false),
#else
mCanUnloadLibrary(PR_TRUE),
mCanUnloadLibrary(true),
#endif
mIsJavaPlugin(PR_FALSE),
mIsNPRuntimeEnabledJavaPlugin(PR_FALSE),
mIsFlashPlugin(PR_FALSE),
mIsJavaPlugin(false),
mIsNPRuntimeEnabledJavaPlugin(false),
mIsFlashPlugin(false),
mFileName(aPluginInfo->fFileName),
mFullPath(aPluginInfo->fFullPath),
mVersion(aPluginInfo->fVersion),
@ -124,16 +124,16 @@ mFlags(NS_PLUGIN_FLAG_ENABLED)
// This "magic MIME type" should not be exposed, but is just a signal
// to the browser that this is new-style java.
// Don't add it or its associated information to our arrays.
mIsNPRuntimeEnabledJavaPlugin = PR_TRUE;
mIsNPRuntimeEnabledJavaPlugin = true;
continue;
}
}
mMimeTypes.AppendElement(nsCString(currentMIMEType));
if (nsPluginHost::IsJavaMIMEType(currentMIMEType)) {
mIsJavaPlugin = PR_TRUE;
mIsJavaPlugin = true;
}
else if (strcmp(currentMIMEType, "application/x-shockwave-flash") == 0) {
mIsFlashPlugin = PR_TRUE;
mIsFlashPlugin = true;
}
} else {
continue;
@ -197,8 +197,8 @@ mName(aName),
mDescription(aDescription),
mLibrary(nsnull),
mCanUnloadLibrary(aCanUnload),
mIsJavaPlugin(PR_FALSE),
mIsNPRuntimeEnabledJavaPlugin(PR_FALSE),
mIsJavaPlugin(false),
mIsNPRuntimeEnabledJavaPlugin(false),
mFileName(aFileName),
mFullPath(aFullPath),
mVersion(aVersion),
@ -208,14 +208,14 @@ mFlags(0) // Caller will read in our flags from cache
for (PRInt32 i = 0; i < aVariants; i++) {
if (mIsJavaPlugin && aMimeTypes[i] &&
strcmp(aMimeTypes[i], "application/x-java-vm-npruntime") == 0) {
mIsNPRuntimeEnabledJavaPlugin = PR_TRUE;
mIsNPRuntimeEnabledJavaPlugin = true;
continue;
}
mMimeTypes.AppendElement(nsCString(aMimeTypes[i]));
mMimeDescriptions.AppendElement(nsCString(aMimeDescriptions[i]));
mExtensions.AppendElement(nsCString(aExtensions[i]));
if (nsPluginHost::IsJavaMIMEType(mMimeTypes[i].get())) {
mIsJavaPlugin = PR_TRUE;
mIsJavaPlugin = true;
}
}
@ -424,7 +424,7 @@ nsPluginTag::RegisterWithCategoryManager(bool aOverrideInternalTypes,
if (strcmp(value, contractId) == 0) {
catMan->DeleteCategoryEntry("Gecko-Content-Viewers",
mMimeTypes[i].get(),
PR_TRUE);
true);
}
}
} else {
@ -439,7 +439,7 @@ nsPluginTag::RegisterWithCategoryManager(bool aOverrideInternalTypes,
catMan->AddCategoryEntry("Gecko-Content-Viewers",
mMimeTypes[i].get(),
contractId,
PR_FALSE, /* persist: broken by bug 193031 */
false, /* persist: broken by bug 193031 */
aOverrideInternalTypes, /* replace if we're told to */
nsnull);
}
@ -458,9 +458,9 @@ void nsPluginTag::Mark(PRUint32 mask)
// Update entries in the category manager if necessary.
if (mPluginHost && wasEnabled != IsEnabled()) {
if (wasEnabled)
RegisterWithCategoryManager(PR_FALSE, nsPluginTag::ePluginUnregister);
RegisterWithCategoryManager(false, nsPluginTag::ePluginUnregister);
else
RegisterWithCategoryManager(PR_FALSE, nsPluginTag::ePluginRegister);
RegisterWithCategoryManager(false, nsPluginTag::ePluginRegister);
}
}
@ -471,9 +471,9 @@ void nsPluginTag::UnMark(PRUint32 mask)
// Update entries in the category manager if necessary.
if (mPluginHost && wasEnabled != IsEnabled()) {
if (wasEnabled)
RegisterWithCategoryManager(PR_FALSE, nsPluginTag::ePluginUnregister);
RegisterWithCategoryManager(false, nsPluginTag::ePluginUnregister);
else
RegisterWithCategoryManager(PR_FALSE, nsPluginTag::ePluginRegister);
RegisterWithCategoryManager(false, nsPluginTag::ePluginRegister);
}
}
@ -494,21 +494,21 @@ bool nsPluginTag::IsEnabled()
bool nsPluginTag::Equals(nsPluginTag *aPluginTag)
{
NS_ENSURE_TRUE(aPluginTag, PR_FALSE);
NS_ENSURE_TRUE(aPluginTag, false);
if ((!mName.Equals(aPluginTag->mName)) ||
(!mDescription.Equals(aPluginTag->mDescription)) ||
(mMimeTypes.Length() != aPluginTag->mMimeTypes.Length())) {
return PR_FALSE;
return false;
}
for (PRUint32 i = 0; i < mMimeTypes.Length(); i++) {
if (!mMimeTypes[i].Equals(aPluginTag->mMimeTypes[i])) {
return PR_FALSE;
return false;
}
}
return PR_TRUE;
return true;
}
void nsPluginTag::TryUnloadPlugin()
@ -533,6 +533,6 @@ void nsPluginTag::TryUnloadPlugin()
// Remove mime types added to the category manager
// only if we were made 'active' by setting the host
if (mPluginHost) {
RegisterWithCategoryManager(PR_FALSE, nsPluginTag::ePluginUnregister);
RegisterWithCategoryManager(false, nsPluginTag::ePluginUnregister);
}
}

View File

@ -114,9 +114,9 @@ bool nsPluginsDir::IsPluginFile(nsIFile* file)
*/
if (!strcmp(fileName.get(), "VerifiedDownloadPlugin.plugin")) {
NS_WARNING("Preventing load of VerifiedDownloadPlugin.plugin (see bug 436575)");
return PR_FALSE;
return false;
}
return PR_TRUE;
return true;
}
// Caller is responsible for freeing returned buffer.
@ -392,7 +392,7 @@ static bool IsCompatibleArch(nsIFile *file)
{
CFURLRef pluginURL = NULL;
if (NS_FAILED(toCFURLRef(file, pluginURL)))
return PR_FALSE;
return false;
bool isPluginFile = false;
@ -411,7 +411,7 @@ static bool IsCompatibleArch(nsIFile *file)
uint32 pluginLibArchitectures;
nsresult rv = mozilla::ipc::GeckoChildProcessHost::GetArchitecturesForBinary(executablePath, &pluginLibArchitectures);
if (NS_FAILED(rv)) {
return PR_FALSE;
return false;
}
uint32 containerArchitectures = mozilla::ipc::GeckoChildProcessHost::GetSupportedArchitecturesForProcessType(GeckoProcessType_Plugin);

View File

@ -172,7 +172,7 @@ bool nsPluginsDir::IsPluginFile(nsIFile* file)
{
nsCAutoString leaf;
if (NS_FAILED(file->GetNativeLeafName(leaf)))
return PR_FALSE;
return false;
const char *leafname = leaf.get();
@ -183,10 +183,10 @@ bool nsPluginsDir::IsPluginFile(nsIFile* file)
(0 == strnicmp( &(leafname[len - 4]), ".dll", 4)) &&
(0 == strnicmp( leafname, "np", 2)))
{
return PR_TRUE;
return true;
}
}
return PR_FALSE;
return false;
}
// nsPluginFile implementation

View File

@ -121,12 +121,12 @@ static bool LoadExtraSharedLib(const char *name, char **soname, bool tryToGetSon
tempSpec.value.pathname = name;
handle = PR_LoadLibraryWithFlags(tempSpec, PR_LD_NOW|PR_LD_GLOBAL);
if (!handle) {
ret = PR_FALSE;
ret = false;
DisplayPR_LoadLibraryErrorMessage(name);
if (tryToGetSoname) {
SearchForSoname(name, soname);
if (*soname) {
ret = LoadExtraSharedLib((const char *) *soname, NULL, PR_FALSE);
ret = LoadExtraSharedLib((const char *) *soname, NULL, false);
}
}
}
@ -158,7 +158,7 @@ static void LoadExtraSharedLibs()
res = prefs->GetCharPref(PREF_PLUGINS_SONAME, &sonameList);
if (!sonameList) {
// pref is not set, lets use hardcoded list
prefSonameListIsSet = PR_FALSE;
prefSonameListIsSet = false;
sonameList = PL_strdup(DEFAULT_EXTRA_LIBS_LIST);
}
if (sonameList) {
@ -187,7 +187,7 @@ static void LoadExtraSharedLibs()
*p = 0;
}
} else {
head = PR_FALSE;
head = false;
p++;
}
}
@ -202,7 +202,7 @@ static void LoadExtraSharedLibs()
//get just a file name
arrayOfLibs[i] = PL_strrchr(arrayOfLibs[i], '/') + 1;
} else
tryToGetSoname = PR_FALSE;
tryToGetSoname = false;
}
char *soname = NULL;
if (LoadExtraSharedLib(arrayOfLibs[i], &soname, tryToGetSoname)) {
@ -245,7 +245,7 @@ bool nsPluginsDir::IsPluginFile(nsIFile* file)
{
nsCAutoString filename;
if (NS_FAILED(file->GetNativeLeafName(filename)))
return PR_FALSE;
return false;
#ifdef ANDROID
// It appears that if you load
@ -254,21 +254,21 @@ bool nsPluginsDir::IsPluginFile(nsIFile* file)
// Since these are just helper libs, we can ignore.
const char *cFile = filename.get();
if (strstr(cFile, "libstagefright") != NULL)
return PR_FALSE;
return false;
#endif
NS_NAMED_LITERAL_CSTRING(dllSuffix, LOCAL_PLUGIN_DLL_SUFFIX);
if (filename.Length() > dllSuffix.Length() &&
StringEndsWith(filename, dllSuffix))
return PR_TRUE;
return true;
#ifdef LOCAL_PLUGIN_DLL_ALT_SUFFIX
NS_NAMED_LITERAL_CSTRING(dllAltSuffix, LOCAL_PLUGIN_DLL_ALT_SUFFIX);
if (filename.Length() > dllAltSuffix.Length() &&
StringEndsWith(filename, dllAltSuffix))
return PR_TRUE;
return true;
#endif
return PR_FALSE;
return false;
}
/* nsPluginFile implementation */

View File

@ -208,7 +208,7 @@ static bool CanLoadPlugin(const PRUnichar* aBinaryPath)
return canLoad;
#else
// Assume correct binaries for unhandled cases.
return PR_TRUE;
return true;
#endif
}
@ -219,7 +219,7 @@ bool nsPluginsDir::IsPluginFile(nsIFile* file)
{
nsCAutoString path;
if (NS_FAILED(file->GetNativePath(path)))
return PR_FALSE;
return false;
const char *cPath = path.get();
@ -241,12 +241,12 @@ bool nsPluginsDir::IsPluginFile(nsIFile* file)
// don't load OJI-based Java plugins
if (!PL_strncasecmp(filename, "npoji", 5) ||
!PL_strncasecmp(filename, "npjava", 6))
return PR_FALSE;
return PR_TRUE;
return false;
return true;
}
}
return PR_FALSE;
return false;
}
/* nsPluginFile implementation */
@ -283,7 +283,7 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary)
return NS_ERROR_FILE_INVALID_PATH;
if (Substring(pluginFolderPath, idx).LowerCaseEqualsLiteral("\\np32dsw.dll")) {
protectCurrentDirectory = PR_FALSE;
protectCurrentDirectory = false;
}
pluginFolderPath.SetLength(idx);