Bug 784739 - Switch from NULL to nullptr in widget/android/; r=ehsan

This commit is contained in:
Birunthan Mohanathas
2013-10-10 16:42:52 -04:00
parent 9c97f8fe32
commit c4438f4272
9 changed files with 75 additions and 75 deletions

View File

@@ -77,7 +77,7 @@ jclass AndroidBridge::GetClassGlobalRef(JNIEnv* env, const char* className)
} }
// Local ref no longer necessary because we have a global ref. // Local ref no longer necessary because we have a global ref.
env->DeleteLocalRef(classLocalRef); env->DeleteLocalRef(classLocalRef);
classLocalRef = NULL; classLocalRef = nullptr;
return static_cast<jclass>(classGlobalRef); return static_cast<jclass>(classGlobalRef);
} }
@@ -238,7 +238,7 @@ jstring AndroidBridge::NewJavaString(JNIEnv* env, const PRUnichar* string, uint3
ALOG_BRIDGE("Exceptional exit of: %s", __PRETTY_FUNCTION__); ALOG_BRIDGE("Exceptional exit of: %s", __PRETTY_FUNCTION__);
env->ExceptionDescribe(); env->ExceptionDescribe();
env->ExceptionClear(); env->ExceptionClear();
return NULL; return nullptr;
} }
return ret; return ret;
} }
@@ -676,13 +676,13 @@ AndroidBridge::SetLayerClient(JNIEnv* env, jobject jobj)
// and we had to recreate it, but all the Gecko-side things were not destroyed. // and we had to recreate it, but all the Gecko-side things were not destroyed.
// We therefore need to link up the new java objects to Gecko, and that's what // We therefore need to link up the new java objects to Gecko, and that's what
// we do here. // we do here.
bool resetting = (mLayerClient != NULL); bool resetting = (mLayerClient != nullptr);
if (resetting) { if (resetting) {
// clear out the old layer client // clear out the old layer client
env->DeleteGlobalRef(mLayerClient->wrappedObject()); env->DeleteGlobalRef(mLayerClient->wrappedObject());
delete mLayerClient; delete mLayerClient;
mLayerClient = NULL; mLayerClient = nullptr;
} }
AndroidGeckoLayerClient *client = new AndroidGeckoLayerClient(); AndroidGeckoLayerClient *client = new AndroidGeckoLayerClient();
@@ -726,18 +726,18 @@ EGLSurface
AndroidBridge::ProvideEGLSurface() AndroidBridge::ProvideEGLSurface()
{ {
if (!jEGLSurfacePointerField) { if (!jEGLSurfacePointerField) {
return NULL; return nullptr;
} }
MOZ_ASSERT(mGLControllerObj, "AndroidBridge::ProvideEGLSurface called with a null GL controller ref"); MOZ_ASSERT(mGLControllerObj, "AndroidBridge::ProvideEGLSurface called with a null GL controller ref");
JNIEnv* env = GetJNIForThread(); // called on the compositor thread JNIEnv* env = GetJNIForThread(); // called on the compositor thread
if (!env) { if (!env) {
return NULL; return nullptr;
} }
jobject eglSurface = ProvideEGLSurfaceWrapper(mGLControllerObj); jobject eglSurface = ProvideEGLSurfaceWrapper(mGLControllerObj);
if (!eglSurface) if (!eglSurface)
return NULL; return nullptr;
EGLSurface ret = reinterpret_cast<EGLSurface>(env->GetIntField(eglSurface, jEGLSurfacePointerField)); EGLSurface ret = reinterpret_cast<EGLSurface>(env->GetIntField(eglSurface, jEGLSurfacePointerField));
env->DeleteLocalRef(eglSurface); env->DeleteLocalRef(eglSurface);
@@ -1399,13 +1399,13 @@ AndroidBridge::LockWindow(void *window, unsigned char **bits, int *width, int *h
}; };
int err; int err;
*bits = NULL; *bits = nullptr;
*width = *height = *format = 0; *width = *height = *format = 0;
if (mHasNativeWindowAccess) { if (mHasNativeWindowAccess) {
ANativeWindow_Buffer buffer; ANativeWindow_Buffer buffer;
if ((err = ANativeWindow_lock(window, (void*)&buffer, NULL)) != 0) { if ((err = ANativeWindow_lock(window, (void*)&buffer, nullptr)) != 0) {
ALOG_BRIDGE("ANativeWindow_lock failed! (error %d)", err); ALOG_BRIDGE("ANativeWindow_lock failed! (error %d)", err);
return false; return false;
} }
@@ -1418,7 +1418,7 @@ AndroidBridge::LockWindow(void *window, unsigned char **bits, int *width, int *h
} else if (mHasNativeWindowFallback) { } else if (mHasNativeWindowFallback) {
SurfaceInfo info; SurfaceInfo info;
if ((err = Surface_lock(window, &info, NULL, true)) != 0) { if ((err = Surface_lock(window, &info, nullptr, true)) != 0) {
ALOG_BRIDGE("Surface_lock failed! (error %d)", err); ALOG_BRIDGE("Surface_lock failed! (error %d)", err);
return false; return false;
} }
@@ -1538,8 +1538,8 @@ void AndroidBridge::SyncFrameMetrics(const ScreenPoint& aScrollOffset, float aZo
} }
AndroidBridge::AndroidBridge() AndroidBridge::AndroidBridge()
: mLayerClient(NULL), : mLayerClient(nullptr),
mNativePanZoomController(NULL) mNativePanZoomController(nullptr)
{ {
} }
@@ -1594,7 +1594,7 @@ static void
JavaThreadDetachFunc(void *arg) JavaThreadDetachFunc(void *arg)
{ {
JNIEnv *env = (JNIEnv*) arg; JNIEnv *env = (JNIEnv*) arg;
JavaVM *vm = NULL; JavaVM *vm = nullptr;
env->GetJavaVM(&vm); env->GetJavaVM(&vm);
vm->DetachCurrentThread(); vm->DetachCurrentThread();
} }
@@ -1603,11 +1603,11 @@ extern "C" {
__attribute__ ((visibility("default"))) __attribute__ ((visibility("default")))
JNIEnv * GetJNIForThread() JNIEnv * GetJNIForThread()
{ {
JNIEnv *jEnv = NULL; JNIEnv *jEnv = nullptr;
JavaVM *jVm = mozilla::AndroidBridge::GetVM(); JavaVM *jVm = mozilla::AndroidBridge::GetVM();
if (!jVm) { if (!jVm) {
__android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "Returned a null VM"); __android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "Returned a null VM");
return NULL; return nullptr;
} }
jEnv = static_cast<JNIEnv*>(PR_GetThreadPrivate(sJavaEnvThreadIndex)); jEnv = static_cast<JNIEnv*>(PR_GetThreadPrivate(sJavaEnvThreadIndex));
@@ -1617,10 +1617,10 @@ extern "C" {
int status = jVm->GetEnv((void**) &jEnv, JNI_VERSION_1_2); int status = jVm->GetEnv((void**) &jEnv, JNI_VERSION_1_2);
if (status) { if (status) {
status = jVm->AttachCurrentThread(&jEnv, NULL); status = jVm->AttachCurrentThread(&jEnv, nullptr);
if (status) { if (status) {
__android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "Could not attach"); __android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "Could not attach");
return NULL; return nullptr;
} }
PR_SetThreadPrivate(sJavaEnvThreadIndex, jEnv); PR_SetThreadPrivate(sJavaEnvThreadIndex, jEnv);

View File

@@ -227,7 +227,7 @@ public:
void GetIconForExtension(const nsACString& aFileExt, uint32_t aIconSize, uint8_t * const aBuf); void GetIconForExtension(const nsACString& aFileExt, uint32_t aIconSize, uint8_t * const aBuf);
// Switch Java to composite with the Gecko Compositor thread // Switch Java to composite with the Gecko Compositor thread
void RegisterCompositor(JNIEnv* env = NULL); void RegisterCompositor(JNIEnv* env = nullptr);
EGLSurface ProvideEGLSurface(); EGLSurface ProvideEGLSurface();
bool GetStaticStringField(const char *classID, const char *field, nsAString &result, JNIEnv* env = nullptr); bool GetStaticStringField(const char *classID, const char *field, nsAString &result, JNIEnv* env = nullptr);
@@ -429,7 +429,7 @@ public:
class AutoJObject { class AutoJObject {
public: public:
AutoJObject(JNIEnv* aJNIEnv = NULL) : mObject(NULL) AutoJObject(JNIEnv* aJNIEnv = nullptr) : mObject(nullptr)
{ {
mJNIEnv = aJNIEnv ? aJNIEnv : AndroidBridge::GetJNIEnv(); mJNIEnv = aJNIEnv ? aJNIEnv : AndroidBridge::GetJNIEnv();
} }
@@ -484,7 +484,7 @@ public:
void Purge() { void Purge() {
if (mJNIEnv) { if (mJNIEnv) {
if (mHasFrameBeenPushed) if (mHasFrameBeenPushed)
mJNIEnv->PopLocalFrame(NULL); mJNIEnv->PopLocalFrame(nullptr);
Push(); Push();
} }
} }
@@ -510,7 +510,7 @@ public:
CheckForException(); CheckForException();
if (mHasFrameBeenPushed) if (mHasFrameBeenPushed)
mJNIEnv->PopLocalFrame(NULL); mJNIEnv->PopLocalFrame(nullptr);
} }
private: private:

View File

@@ -17,7 +17,7 @@ AndroidDirectTexture::AndroidDirectTexture(uint32_t width, uint32_t height, uint
, mWidth(width) , mWidth(width)
, mHeight(height) , mHeight(height)
, mFormat(format) , mFormat(format)
, mPendingReallocBuffer(NULL) , mPendingReallocBuffer(nullptr)
{ {
mFrontBuffer = new AndroidGraphicBuffer(width, height, usage, format); mFrontBuffer = new AndroidGraphicBuffer(width, height, usage, format);
mBackBuffer = new AndroidGraphicBuffer(width, height, usage, format); mBackBuffer = new AndroidGraphicBuffer(width, height, usage, format);
@@ -27,12 +27,12 @@ AndroidDirectTexture::~AndroidDirectTexture()
{ {
if (mFrontBuffer) { if (mFrontBuffer) {
delete mFrontBuffer; delete mFrontBuffer;
mFrontBuffer = NULL; mFrontBuffer = nullptr;
} }
if (mBackBuffer) { if (mBackBuffer) {
delete mBackBuffer; delete mBackBuffer;
mBackBuffer = NULL; mBackBuffer = nullptr;
} }
} }
@@ -46,7 +46,7 @@ AndroidDirectTexture::ReallocPendingBuffer()
// It is assumed that mLock is already acquired // It is assumed that mLock is already acquired
if (mPendingReallocBuffer == mBackBuffer) { if (mPendingReallocBuffer == mBackBuffer) {
mBackBuffer->Reallocate(mWidth, mHeight, mFormat); mBackBuffer->Reallocate(mWidth, mHeight, mFormat);
mPendingReallocBuffer = NULL; mPendingReallocBuffer = nullptr;
} }
} }

View File

@@ -265,18 +265,18 @@ AndroidGraphicBuffer::DestroyBuffer()
if (mEGLImage) { if (mEGLImage) {
if (sGLFunctions.EnsureInitialized()) { if (sGLFunctions.EnsureInitialized()) {
sGLFunctions.fDestroyImageKHR(sGLFunctions.fGetDisplay(EGL_DEFAULT_DISPLAY), mEGLImage); sGLFunctions.fDestroyImageKHR(sGLFunctions.fGetDisplay(EGL_DEFAULT_DISPLAY), mEGLImage);
mEGLImage = NULL; mEGLImage = nullptr;
} }
} }
#endif #endif
mEGLImage = NULL; mEGLImage = nullptr;
if (mHandle) { if (mHandle) {
if (sGLFunctions.EnsureInitialized()) { if (sGLFunctions.EnsureInitialized()) {
sGLFunctions.fGraphicBufferDtor(mHandle); sGLFunctions.fGraphicBufferDtor(mHandle);
} }
free(mHandle); free(mHandle);
mHandle = NULL; mHandle = nullptr;
} }
} }
@@ -413,7 +413,7 @@ AndroidGraphicBuffer::EnsureEGLImage()
void* nativeBuffer = sGLFunctions.fGraphicBufferGetNativeBuffer(mHandle); void* nativeBuffer = sGLFunctions.fGraphicBufferGetNativeBuffer(mHandle);
mEGLImage = sGLFunctions.fCreateImageKHR(sGLFunctions.fGetDisplay(EGL_DEFAULT_DISPLAY), EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, (EGLClientBuffer)nativeBuffer, eglImgAttrs); mEGLImage = sGLFunctions.fCreateImageKHR(sGLFunctions.fGetDisplay(EGL_DEFAULT_DISPLAY), EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, (EGLClientBuffer)nativeBuffer, eglImgAttrs);
return mEGLImage != NULL; return mEGLImage != nullptr;
} }
bool bool
@@ -445,7 +445,7 @@ static const char* const sAllowedBoards[] = {
"sgh-i997", // Samsung Infuse 4G "sgh-i997", // Samsung Infuse 4G
"herring", // Samsung Nexus S "herring", // Samsung Nexus S
"sgh-t839", // Samsung Sidekick 4G "sgh-t839", // Samsung Sidekick 4G
NULL nullptr
}; };
bool bool

View File

@@ -813,7 +813,7 @@ Java_org_mozilla_gecko_GeckoAppShell_getNextMessageFromQueue(JNIEnv* jenv, jclas
} }
if (!jMessageQueueCls || !jNextMethod) if (!jMessageQueueCls || !jNextMethod)
return NULL; return nullptr;
if (jMessagesField) { if (jMessagesField) {
jobject msg = jenv->GetObjectField(queue, jMessagesField); jobject msg = jenv->GetObjectField(queue, jMessagesField);
@@ -821,7 +821,7 @@ Java_org_mozilla_gecko_GeckoAppShell_getNextMessageFromQueue(JNIEnv* jenv, jclas
// It turns out to be an order of magnitude more performant to do this extra check here and // It turns out to be an order of magnitude more performant to do this extra check here and
// block less vs. one fewer checks here and more blocking. // block less vs. one fewer checks here and more blocking.
if (!msg) { if (!msg) {
return NULL; return nullptr;
} }
} }
return jenv->CallObjectMethod(queue, jNextMethod); return jenv->CallObjectMethod(queue, jNextMethod);
@@ -905,7 +905,7 @@ Java_org_mozilla_gecko_gfx_NativePanZoomController_destroy(JNIEnv* env, jobject
return; return;
} }
jobject oldRef = AndroidBridge::Bridge()->SetNativePanZoomController(NULL); jobject oldRef = AndroidBridge::Bridge()->SetNativePanZoomController(nullptr);
if (!oldRef) { if (!oldRef) {
MOZ_ASSERT(false, "Clearing a non-existent NPZC"); MOZ_ASSERT(false, "Clearing a non-existent NPZC");
} else { } else {
@@ -966,7 +966,7 @@ Java_org_mozilla_gecko_ANRReporter_requestNativeStack(JNIEnv*, jclass)
// Buffer one sample and let the profiler wait a long time // Buffer one sample and let the profiler wait a long time
profiler_start(100, 10000, NATIVE_STACK_FEATURES, profiler_start(100, 10000, NATIVE_STACK_FEATURES,
sizeof(NATIVE_STACK_FEATURES) / sizeof(char*), sizeof(NATIVE_STACK_FEATURES) / sizeof(char*),
NULL, 0); nullptr, 0);
return JNI_TRUE; return JNI_TRUE;
} }
@@ -975,7 +975,7 @@ Java_org_mozilla_gecko_ANRReporter_getNativeStack(JNIEnv* jenv, jclass)
{ {
if (!profiler_is_active()) { if (!profiler_is_active()) {
// Maybe profiler support is disabled? // Maybe profiler support is disabled?
return NULL; return nullptr;
} }
char *profile = profiler_get_profile(); char *profile = profiler_get_profile();
while (profile && !strlen(profile)) { while (profile && !strlen(profile)) {
@@ -983,7 +983,7 @@ Java_org_mozilla_gecko_ANRReporter_getNativeStack(JNIEnv* jenv, jclass)
sched_yield(); sched_yield();
profile = profiler_get_profile(); profile = profiler_get_profile();
} }
jstring result = NULL; jstring result = nullptr;
if (profile) { if (profile) {
result = jenv->NewStringUTF(profile); result = jenv->NewStringUTF(profile);
free(profile); free(profile);

View File

@@ -45,7 +45,7 @@ extern "C" {
// to missing the classpath // to missing the classpath
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
JNIEnv *env = mozilla::AndroidBridge::GetJNIEnv(); JNIEnv *env = mozilla::AndroidBridge::GetJNIEnv();
if (!env) return NULL; if (!env) return nullptr;
return env->FindClass(className); return env->FindClass(className);
} }
@@ -55,7 +55,7 @@ extern "C" {
JNIEnv *env = mozilla::AndroidBridge::GetJNIEnv(); JNIEnv *env = mozilla::AndroidBridge::GetJNIEnv();
jclass globalRef = static_cast<jclass>(env->NewGlobalRef(env->FindClass(className))); jclass globalRef = static_cast<jclass>(env->NewGlobalRef(env->FindClass(className)));
if (!globalRef) if (!globalRef)
return NULL; return nullptr;
// return the newly create global reference // return the newly create global reference
return globalRef; return globalRef;
@@ -73,7 +73,7 @@ extern "C" {
&foundClass)); &foundClass));
mainThread->Dispatch(runnable_ref, NS_DISPATCH_SYNC); mainThread->Dispatch(runnable_ref, NS_DISPATCH_SYNC);
if (!foundClass) if (!foundClass)
return NULL; return nullptr;
return foundClass; return foundClass;
} }
@@ -84,7 +84,7 @@ extern "C" {
const char *methodName, const char *methodName,
const char *signature) { const char *signature) {
JNIEnv *env = mozilla::AndroidBridge::GetJNIEnv(); JNIEnv *env = mozilla::AndroidBridge::GetJNIEnv();
if (!env) return NULL; if (!env) return nullptr;
return env->GetStaticMethodID(methodClass, methodName, signature); return env->GetStaticMethodID(methodClass, methodName, signature);
} }
@@ -92,7 +92,7 @@ extern "C" {
bool bool
jsjni_ExceptionCheck() { jsjni_ExceptionCheck() {
JNIEnv *env = mozilla::AndroidBridge::GetJNIEnv(); JNIEnv *env = mozilla::AndroidBridge::GetJNIEnv();
if (!env) return NULL; if (!env) return nullptr;
return env->ExceptionCheck(); return env->ExceptionCheck();
} }

View File

@@ -137,7 +137,7 @@ jfieldID AndroidProgressiveUpdateData::jShouldAbortField = 0;
RefCountedJavaObject::~RefCountedJavaObject() { RefCountedJavaObject::~RefCountedJavaObject() {
if (mObject) if (mObject)
GetJNIForThread()->DeleteGlobalRef(mObject); GetJNIForThread()->DeleteGlobalRef(mObject);
mObject = NULL; mObject = nullptr;
} }
void void
@@ -233,19 +233,19 @@ AndroidLocation::CreateGeoPosition(JNIEnv *jenv, jobject jobj)
AutoLocalJNIFrame jniFrame(jenv); AutoLocalJNIFrame jniFrame(jenv);
double latitude = jenv->CallDoubleMethod(jobj, jGetLatitudeMethod); double latitude = jenv->CallDoubleMethod(jobj, jGetLatitudeMethod);
if (jniFrame.CheckForException()) return NULL; if (jniFrame.CheckForException()) return nullptr;
double longitude = jenv->CallDoubleMethod(jobj, jGetLongitudeMethod); double longitude = jenv->CallDoubleMethod(jobj, jGetLongitudeMethod);
if (jniFrame.CheckForException()) return NULL; if (jniFrame.CheckForException()) return nullptr;
double altitude = jenv->CallDoubleMethod(jobj, jGetAltitudeMethod); double altitude = jenv->CallDoubleMethod(jobj, jGetAltitudeMethod);
if (jniFrame.CheckForException()) return NULL; if (jniFrame.CheckForException()) return nullptr;
float accuracy = jenv->CallFloatMethod (jobj, jGetAccuracyMethod); float accuracy = jenv->CallFloatMethod (jobj, jGetAccuracyMethod);
if (jniFrame.CheckForException()) return NULL; if (jniFrame.CheckForException()) return nullptr;
float bearing = jenv->CallFloatMethod (jobj, jGetBearingMethod); float bearing = jenv->CallFloatMethod (jobj, jGetBearingMethod);
if (jniFrame.CheckForException()) return NULL; if (jniFrame.CheckForException()) return nullptr;
float speed = jenv->CallFloatMethod (jobj, jGetSpeedMethod); float speed = jenv->CallFloatMethod (jobj, jGetSpeedMethod);
if (jniFrame.CheckForException()) return NULL; if (jniFrame.CheckForException()) return nullptr;
long long time = jenv->CallLongMethod (jobj, jGetTimeMethod); long long time = jenv->CallLongMethod (jobj, jGetTimeMethod);
if (jniFrame.CheckForException()) return NULL; if (jniFrame.CheckForException()) return nullptr;
return new nsGeoPosition(latitude, longitude, return new nsGeoPosition(latitude, longitude,
altitude, accuracy, altitude, accuracy,
@@ -394,7 +394,7 @@ AndroidGeckoEvent::ReadIntArray(nsTArray<int> &aVals,
int32_t count) int32_t count)
{ {
jintArray jIntArray = (jintArray)jenv->GetObjectField(wrapped_obj, field); jintArray jIntArray = (jintArray)jenv->GetObjectField(wrapped_obj, field);
jint *vals = jenv->GetIntArrayElements(jIntArray, NULL); jint *vals = jenv->GetIntArrayElements(jIntArray, nullptr);
for (int32_t i = 0; i < count; i++) { for (int32_t i = 0; i < count; i++) {
aVals.AppendElement(vals[i]); aVals.AppendElement(vals[i]);
} }
@@ -408,7 +408,7 @@ AndroidGeckoEvent::ReadFloatArray(nsTArray<float> &aVals,
int32_t count) int32_t count)
{ {
jfloatArray jFloatArray = (jfloatArray)jenv->GetObjectField(wrapped_obj, field); jfloatArray jFloatArray = (jfloatArray)jenv->GetObjectField(wrapped_obj, field);
jfloat *vals = jenv->GetFloatArrayElements(jFloatArray, NULL); jfloat *vals = jenv->GetFloatArrayElements(jFloatArray, nullptr);
for (int32_t i = 0; i < count; i++) { for (int32_t i = 0; i < count; i++) {
aVals.AppendElement(vals[i]); aVals.AppendElement(vals[i]);
} }
@@ -1354,7 +1354,7 @@ nsJNIString::nsJNIString(jstring jstr, JNIEnv *jenv)
return; return;
} }
} }
const jchar* jCharPtr = jni->GetStringChars(jstr, NULL); const jchar* jCharPtr = jni->GetStringChars(jstr, nullptr);
if (!jCharPtr) { if (!jCharPtr) {
SetIsVoid(true); SetIsVoid(true);

View File

@@ -64,22 +64,22 @@ NS_DEFINE_NAMED_CID(NS_GFXINFO_CID);
NS_DEFINE_NAMED_CID(NS_ANDROIDBRIDGE_CID); NS_DEFINE_NAMED_CID(NS_ANDROIDBRIDGE_CID);
static const mozilla::Module::CIDEntry kWidgetCIDs[] = { static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
{ &kNS_WINDOW_CID, false, NULL, nsWindowConstructor }, { &kNS_WINDOW_CID, false, nullptr, nsWindowConstructor },
{ &kNS_CHILD_CID, false, NULL, nsWindowConstructor }, { &kNS_CHILD_CID, false, nullptr, nsWindowConstructor },
{ &kNS_APPSHELL_CID, false, NULL, nsAppShellConstructor }, { &kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor },
{ &kNS_SCREENMANAGER_CID, false, NULL, nsScreenManagerAndroidConstructor }, { &kNS_SCREENMANAGER_CID, false, nullptr, nsScreenManagerAndroidConstructor },
{ &kNS_IDLE_SERVICE_CID, false, NULL, nsIdleServiceAndroidConstructor }, { &kNS_IDLE_SERVICE_CID, false, nullptr, nsIdleServiceAndroidConstructor },
{ &kNS_TRANSFERABLE_CID, false, NULL, nsTransferableConstructor }, { &kNS_TRANSFERABLE_CID, false, nullptr, nsTransferableConstructor },
{ &kNS_CLIPBOARD_CID, false, NULL, nsClipboardConstructor }, { &kNS_CLIPBOARD_CID, false, nullptr, nsClipboardConstructor },
{ &kNS_CLIPBOARDHELPER_CID, false, NULL, nsClipboardHelperConstructor }, { &kNS_CLIPBOARDHELPER_CID, false, nullptr, nsClipboardHelperConstructor },
{ &kNS_PRINTSETTINGSSERVICE_CID, false, NULL, nsPrintOptionsAndroidConstructor }, { &kNS_PRINTSETTINGSSERVICE_CID, false, nullptr, nsPrintOptionsAndroidConstructor },
{ &kNS_PRINTSESSION_CID, false, NULL, nsPrintSessionConstructor }, { &kNS_PRINTSESSION_CID, false, nullptr, nsPrintSessionConstructor },
{ &kNS_DEVICE_CONTEXT_SPEC_CID, false, NULL, nsDeviceContextSpecAndroidConstructor }, { &kNS_DEVICE_CONTEXT_SPEC_CID, false, nullptr, nsDeviceContextSpecAndroidConstructor },
{ &kNS_HTMLFORMATCONVERTER_CID, false, NULL, nsHTMLFormatConverterConstructor }, { &kNS_HTMLFORMATCONVERTER_CID, false, nullptr, nsHTMLFormatConverterConstructor },
{ &kNS_IMEPICKER_CID, false, NULL, nsIMEPickerConstructor }, { &kNS_IMEPICKER_CID, false, nullptr, nsIMEPickerConstructor },
{ &kNS_GFXINFO_CID, false, NULL, mozilla::widget::GfxInfoConstructor }, { &kNS_GFXINFO_CID, false, nullptr, mozilla::widget::GfxInfoConstructor },
{ &kNS_ANDROIDBRIDGE_CID, false, NULL, nsAndroidBridgeConstructor }, { &kNS_ANDROIDBRIDGE_CID, false, nullptr, nsAndroidBridgeConstructor },
{ NULL } { nullptr }
}; };
static const mozilla::Module::ContractIDEntry kWidgetContracts[] = { static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
@@ -98,7 +98,7 @@ static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
{ "@mozilla.org/imepicker;1", &kNS_IMEPICKER_CID }, { "@mozilla.org/imepicker;1", &kNS_IMEPICKER_CID },
{ "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID }, { "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID },
{ "@mozilla.org/android/bridge;1", &kNS_ANDROIDBRIDGE_CID }, { "@mozilla.org/android/bridge;1", &kNS_ANDROIDBRIDGE_CID },
{ NULL } { nullptr }
}; };
static void static void
@@ -112,8 +112,8 @@ static const mozilla::Module kWidgetModule = {
mozilla::Module::kVersion, mozilla::Module::kVersion,
kWidgetCIDs, kWidgetCIDs,
kWidgetContracts, kWidgetContracts,
NULL, nullptr,
NULL, nullptr,
nsAppShellInit, nsAppShellInit,
nsWidgetAndroidModuleDtor nsWidgetAndroidModuleDtor
}; };

View File

@@ -188,7 +188,7 @@ nsWindow::~nsWindow()
if (mLayerManager == sLayerManager) { if (mLayerManager == sLayerManager) {
// If this window was the one that created the global OMTC layer manager // If this window was the one that created the global OMTC layer manager
// and compositor, then we should null those out. // and compositor, then we should null those out.
SetCompositor(NULL, NULL, NULL); SetCompositor(nullptr, nullptr, nullptr);
} }
} }
@@ -1154,9 +1154,9 @@ void *
nsWindow::GetNativeData(uint32_t aDataType) nsWindow::GetNativeData(uint32_t aDataType)
{ {
switch (aDataType) { switch (aDataType) {
// used by GLContextProviderEGL, NULL is EGL_DEFAULT_DISPLAY // used by GLContextProviderEGL, nullptr is EGL_DEFAULT_DISPLAY
case NS_NATIVE_DISPLAY: case NS_NATIVE_DISPLAY:
return NULL; return nullptr;
case NS_NATIVE_WIDGET: case NS_NATIVE_WIDGET:
return (void *) this; return (void *) this;
@@ -1619,7 +1619,7 @@ nsWindow::InitKeyEvent(WidgetKeyboardEvent& event, AndroidGeckoEvent& key,
event.isChar = (charCode >= ' '); event.isChar = (charCode >= ' ');
event.charCode = event.isChar ? charCode : 0; event.charCode = event.isChar ? charCode : 0;
event.keyCode = (event.charCode > 0) ? 0 : domKeyCode; event.keyCode = (event.charCode > 0) ? 0 : domKeyCode;
event.pluginEvent = NULL; event.pluginEvent = nullptr;
} else { } else {
#ifdef DEBUG #ifdef DEBUG
if (event.message != NS_KEY_DOWN && event.message != NS_KEY_UP) { if (event.message != NS_KEY_DOWN && event.message != NS_KEY_UP) {