diff --git a/.hgtags b/.hgtags index b6ade4a0049..724d9f43df6 100644 --- a/.hgtags +++ b/.hgtags @@ -96,3 +96,4 @@ d7ce9089999719d5186595d160f25123a4e63e39 FIREFOX_AURORA_23_BASE 8d3810543edccf4fbe458178b88dd4a6e420b010 FIREFOX_AURORA_24_BASE ad0ae007aa9e03cd74e9005cd6652e544139b3b5 FIREFOX_AURORA_25_BASE 2520866d58740851d862c7c59246a4e3f8b4a176 FIREFOX_AURORA_26_BASE +05025f4889a0bf4dc99ce0c244c750adc002f015 FIREFOX_AURORA_27_BASE diff --git a/b2g/confvars.sh b/b2g/confvars.sh index ae91b669a4e..d8ce0a26bb3 100644 --- a/b2g/confvars.sh +++ b/b2g/confvars.sh @@ -5,7 +5,7 @@ MOZ_APP_BASENAME=B2G MOZ_APP_VENDOR=Mozilla -MOZ_APP_VERSION=27.0a1 +MOZ_APP_VERSION=28.0a1 MOZ_APP_UA_NAME=Firefox MOZ_UA_OS_AGNOSTIC=1 diff --git a/browser/config/version.txt b/browser/config/version.txt index d4cc67689ea..70bb3e86ee9 100644 --- a/browser/config/version.txt +++ b/browser/config/version.txt @@ -1 +1 @@ -27.0a1 +28.0a1 diff --git a/build/docs/test_manifests.rst b/build/docs/test_manifests.rst index db708db7990..cab4a1a5ab9 100644 --- a/build/docs/test_manifests.rst +++ b/build/docs/test_manifests.rst @@ -53,7 +53,11 @@ In summary, manifests are ini files with section names describing test files:: Keys under sections can hold metadata about each test:: [test_foo.js] - skip-if = os == win + skip-if = os == "win" + [test_foo.js] + skip-if = os == "linux" && debug + [test_baz.js] + fail-if = os == "mac" || os == "android" There is a special **DEFAULT** section whose keys/metadata apply to all sections/tests:: diff --git a/config/Makefile.in b/config/Makefile.in index a99dbcdb14a..87c01c58634 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -4,10 +4,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# For sanity's sake, we compile nsinstall without the wrapped system -# headers, so that we can use it to set up the wrapped system headers. -VISIBILITY_FLAGS = - # STDCXX_COMPAT is not needed here, and will actually fail because # libstdc++-compat is not built yet. MOZ_LIBSTDCXX_HOST_VERSION = diff --git a/config/milestone.txt b/config/milestone.txt index 970ef7956a8..132ff5fe00a 100644 --- a/config/milestone.txt +++ b/config/milestone.txt @@ -10,4 +10,4 @@ # hardcoded milestones in the tree from these two files. #-------------------------------------------------------- -27.0a1 +28.0a1 diff --git a/config/moz.build b/config/moz.build index d7bcbad52e6..6580cd583af 100644 --- a/config/moz.build +++ b/config/moz.build @@ -5,6 +5,9 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. NO_DIST_INSTALL = True +# For sanity's sake, we compile nsinstall without the wrapped system +# headers, so that we can use it to set up the wrapped system headers. +NO_VISIBILITY_FLAGS = True CONFIGURE_SUBST_FILES += [ 'autoconf.mk', diff --git a/content/html/content/src/HTMLInputElement.cpp b/content/html/content/src/HTMLInputElement.cpp index d8da381dc3a..c1033db7152 100644 --- a/content/html/content/src/HTMLInputElement.cpp +++ b/content/html/content/src/HTMLInputElement.cpp @@ -4614,9 +4614,6 @@ HTMLInputElement::SetSelectionRange(int32_t aSelectionStart, aRv = textControlFrame->SetSelectionRange(aSelectionStart, aSelectionEnd, dir); if (!aRv.Failed()) { aRv = textControlFrame->ScrollSelectionIntoView(); - nsRefPtr event = - new nsAsyncDOMEvent(this, NS_LITERAL_STRING("select"), true, false); - event->PostDOMEvent(); } } } @@ -4740,6 +4737,11 @@ HTMLInputElement::SetRangeText(const nsAString& aReplacement, uint32_t aStart, Optional direction; SetSelectionRange(aSelectionStart, aSelectionEnd, direction, aRv); + if (!aRv.Failed()) { + nsRefPtr event = + new nsAsyncDOMEvent(this, NS_LITERAL_STRING("select"), true, false); + event->PostDOMEvent(); + } } int32_t diff --git a/content/html/content/src/HTMLTextAreaElement.cpp b/content/html/content/src/HTMLTextAreaElement.cpp index eef6d6ace68..26188506a5a 100644 --- a/content/html/content/src/HTMLTextAreaElement.cpp +++ b/content/html/content/src/HTMLTextAreaElement.cpp @@ -888,9 +888,6 @@ HTMLTextAreaElement::SetSelectionRange(uint32_t aSelectionStart, rv = textControlFrame->SetSelectionRange(aSelectionStart, aSelectionEnd, dir); if (NS_SUCCEEDED(rv)) { rv = textControlFrame->ScrollSelectionIntoView(); - nsRefPtr event = - new nsAsyncDOMEvent(this, NS_LITERAL_STRING("select"), true, false); - event->PostDOMEvent(); } } } @@ -995,6 +992,11 @@ HTMLTextAreaElement::SetRangeText(const nsAString& aReplacement, Optional direction; SetSelectionRange(aSelectionStart, aSelectionEnd, direction, aRv); + if (!aRv.Failed()) { + nsRefPtr event = + new nsAsyncDOMEvent(this, NS_LITERAL_STRING("select"), true, false); + event->PostDOMEvent(); + } } nsresult diff --git a/content/html/content/test/forms/test_set_range_text.html b/content/html/content/test/forms/test_set_range_text.html index eb136d91835..9f37f0e7981 100644 --- a/content/html/content/test/forms/test_set_range_text.html +++ b/content/html/content/test/forms/test_set_range_text.html @@ -81,6 +81,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=850364 ok(true, "select event should be fired for " + aEvent.target.id); if (++numOfSelectCalls == expectedNumOfSelectCalls) { SimpleTest.finish(); + } else if (numOfSelectCalls > expectedNumOfSelectCalls) { + ok(false, "Too many select events were fired"); } }, false); @@ -97,7 +99,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=850364 is(elem.selectionEnd, 4, msg + ".selectionEnd == 4"); elem.setRangeText("mnk"); is(elem.value, "0mnk6789ABCDEF", msg + ".value == \"0mnk6789ABCDEF\""); - expectedNumOfSelectCalls += 3; + expectedNumOfSelectCalls += 2; //test SetRange(replacement, start, end, mode) with start > end try { @@ -159,7 +161,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=850364 is(elem.value, "0Z23456789", msg + ".value == \"0Z23456789\""); is(elem.selectionStart, 6, msg + ".selectionStart == 6, with \"preserve\""); is(elem.selectionEnd, 9, msg + ".selectionEnd == 9, with \"preserve\""); - expectedNumOfSelectCalls += 2; + expectedNumOfSelectCalls += 1; //subcase: selection{Start|End} < end elem.value = "0123456789"; @@ -168,7 +170,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=850364 is(elem.value, "01QRST9", msg + ".value == \"01QRST9\""); is(elem.selectionStart, 2, msg + ".selectionStart == 2, with \"preserve\""); is(elem.selectionEnd, 6, msg + ".selectionEnd == 6, with \"preserve\""); - expectedNumOfSelectCalls += 2; + expectedNumOfSelectCalls += 1; //subcase: selectionStart > end, selectionEnd < end elem.value = "0123456789"; @@ -177,7 +179,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=850364 is(elem.value, "0QRST56789", msg + ".value == \"0QRST56789\""); is(elem.selectionStart, 1, msg + ".selectionStart == 1, with \"default\""); is(elem.selectionEnd, 5, msg + ".selectionEnd == 5, with \"default\""); - expectedNumOfSelectCalls += 2; + expectedNumOfSelectCalls += 1; //subcase: selectionStart < end, selectionEnd > end elem.value = "0123456789"; @@ -186,7 +188,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=850364 is(elem.value, "01QRST6789", msg + ".value == \"01QRST6789\""); is(elem.selectionStart, 2, msg + ".selectionStart == 2, with \"default\""); is(elem.selectionEnd, 9, msg + ".selectionEnd == 9, with \"default\""); - expectedNumOfSelectCalls += 2; + expectedNumOfSelectCalls += 1; } } diff --git a/content/html/document/src/HTMLAllCollection.cpp b/content/html/document/src/HTMLAllCollection.cpp index 9051e9e1b0f..d7651f5a5ba 100644 --- a/content/html/document/src/HTMLAllCollection.cpp +++ b/content/html/document/src/HTMLAllCollection.cpp @@ -10,7 +10,7 @@ #include "nsDOMClassInfo.h" #include "nsHTMLDocument.h" #include "jsapi.h" -#include "js/GCAPI.h" +#include "nsWrapperCacheInlines.h" namespace mozilla { namespace dom { diff --git a/content/media/TextTrack.cpp b/content/media/TextTrack.cpp index 94a9b0a79f7..25db345c509 100644 --- a/content/media/TextTrack.cpp +++ b/content/media/TextTrack.cpp @@ -182,8 +182,8 @@ void TextTrack::SetReadyState(uint16_t aState) { mReadyState = aState; - if (mReadyState == HTMLTrackElement::LOADED || - mReadyState == HTMLTrackElement::ERROR) { + if (mMediaElement && (mReadyState == HTMLTrackElement::LOADED || + mReadyState == HTMLTrackElement::ERROR)) { mMediaElement->RemoveTextTrack(this, true); } } diff --git a/content/media/WebVTTListener.cpp b/content/media/WebVTTListener.cpp index ee0490c602c..28c93352789 100644 --- a/content/media/WebVTTListener.cpp +++ b/content/media/WebVTTListener.cpp @@ -107,7 +107,8 @@ WebVTTListener::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) { if (mElement->ReadyState() != HTMLTrackElement::ERROR) { - mElement->mTrack->SetReadyState(HTMLTrackElement::LOADED); + TextTrack* track = mElement->Track(); + track->SetReadyState(HTMLTrackElement::LOADED); } // Attempt to parse any final data the parser might still have. mParserWrapper->Flush(); diff --git a/content/media/gstreamer/GStreamerLoader.cpp b/content/media/gstreamer/GStreamerLoader.cpp index b8d6fdc7ad4..5961b23198b 100644 --- a/content/media/gstreamer/GStreamerLoader.cpp +++ b/content/media/gstreamer/GStreamerLoader.cpp @@ -7,6 +7,7 @@ #include #include "GStreamerLoader.h" +#include "mozilla/NullPtr.h" #define LIBGSTREAMER 0 #define LIBGSTAPP 1 diff --git a/content/xbl/src/nsBindingManager.cpp b/content/xbl/src/nsBindingManager.cpp index da99a64e2cf..e401709cf1c 100644 --- a/content/xbl/src/nsBindingManager.cpp +++ b/content/xbl/src/nsBindingManager.cpp @@ -33,6 +33,7 @@ #include "nsRuleProcessorData.h" #include "nsIWeakReference.h" +#include "nsWrapperCacheInlines.h" #include "nsIXPConnect.h" #include "nsDOMCID.h" #include "nsIDOMScriptObjectFactory.h" diff --git a/db/sqlite3/src/Makefile.in b/db/sqlite3/src/Makefile.in index 0b9ff796650..cd5ab62697b 100644 --- a/db/sqlite3/src/Makefile.in +++ b/db/sqlite3/src/Makefile.in @@ -7,7 +7,6 @@ SHORT_LIBNAME = mozsqlt3 ifndef MOZ_FOLD_LIBS FORCE_SHARED_LIB = 1 endif -VISIBILITY_FLAGS = LIB_IS_C_ONLY = 1 ifeq ($(OS_ARCH),WINNT) diff --git a/db/sqlite3/src/moz.build b/db/sqlite3/src/moz.build index 3860c214476..f6f4a5e7bee 100644 --- a/db/sqlite3/src/moz.build +++ b/db/sqlite3/src/moz.build @@ -5,6 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. MODULE = 'sqlite3' +NO_VISIBILITY_FLAGS = True EXPORTS += [ 'sqlite3.h', diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 6938ea3cea5..c9f9bd8b337 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -656,7 +656,7 @@ VibrateWindowListener::HandleEvent(nsIDOMEvent* aEvent) nsCOMPtr window = do_QueryReferent(mWindow); hal::CancelVibrate(window); RemoveListener(); - gVibrateWindowListener = NULL; + gVibrateWindowListener = nullptr; // Careful: The line above might have deleted |this|! } diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index a37c0a2d6e2..58584daef02 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -3606,7 +3606,7 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx, } // Handle resolving if id refers to a name resolved by DOM worker code. - JS::Rooted tmp(cx, NULL); + JS::Rooted tmp(cx, nullptr); if (!ResolveWorkerClasses(cx, obj, id, flags, &tmp)) { return NS_ERROR_FAILURE; } diff --git a/dom/base/nsDOMJSUtils.h b/dom/base/nsDOMJSUtils.h index 1f7e9d5909a..3d1d1ab5a62 100644 --- a/dom/base/nsDOMJSUtils.h +++ b/dom/base/nsDOMJSUtils.h @@ -37,9 +37,9 @@ JSObject* GetDefaultScopeFromJSContext(JSContext *cx); // ((JS::Value*)aArgv)[0], ..., ((JS::Value*)aArgv)[aArgc - 1] // The resulting object will take a copy of the array, and ensure each // element is rooted. -// Optionally, aArgv may be NULL, in which case the array is allocated and -// rooted, but all items remain NULL. This presumably means the caller will -// then QI us for nsIJSArgArray, and set our array elements. +// Optionally, aArgv may be nullptr, in which case the array is allocated and +// rooted, but all items remain nullptr. This presumably means the caller +// will then QI us for nsIJSArgArray, and set our array elements. nsresult NS_CreateJSArgv(JSContext *aContext, uint32_t aArgc, void *aArgv, nsIJSArgArray **aArray); diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index d2d0a20b86c..a3f7d1bccfa 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -145,7 +145,7 @@ static const char* kObservedPrefs[] = { "accessibility.tabfocus_applies_to_xul", "accessibility.mouse_focuses_formcontrol", "focusmanager.testmode", - NULL + nullptr }; nsFocusManager::nsFocusManager() diff --git a/dom/base/nsFocusManager.h b/dom/base/nsFocusManager.h index 17e332391a1..ffadbfa426e 100644 --- a/dom/base/nsFocusManager.h +++ b/dom/base/nsFocusManager.h @@ -518,7 +518,7 @@ private: // When a mouse down event process is finished, ESM sets focus to the target // content. Therefore, while DOM event handlers are handling mouse down // events, the handlers should be able to steal focus from any elements even - // if focus is in chrome content. So, if this isn't NULL and the caller + // if focus is in chrome content. So, if this isn't nullptr and the caller // can access the document node, the caller should succeed in moving focus. nsCOMPtr mMouseDownEventHandlingDocument; diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 8a507e17b14..527a9773180 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -676,7 +676,7 @@ nsOuterWindowProxy::preventExtensions(JSContext *cx, JS::Handle proxy) { // See above. - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_CANT_CHANGE_EXTENSIBILITY); return false; } @@ -1222,7 +1222,7 @@ nsGlobalWindow::~nsGlobalWindow() if (IsOuterWindow()) { JSObject *proxy = GetWrapperPreserveColor(); if (proxy) { - js::SetProxyExtra(proxy, 0, js::PrivateValue(NULL)); + js::SetProxyExtra(proxy, 0, js::PrivateValue(nullptr)); } // An outer window is destroyed with inner windows still possibly @@ -2115,7 +2115,7 @@ CreateNativeGlobalForInner(JSContext* aCx, MOZ_ASSERT(aPrincipal); MOZ_ASSERT(aHolder); - nsGlobalWindow *top = NULL; + nsGlobalWindow *top = nullptr; if (aNewInner->GetOuterWindow()) { top = aNewInner->GetTop(); } @@ -2396,7 +2396,7 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument, return NS_ERROR_FAILURE; } - js::SetProxyExtra(mJSObject, 0, js::PrivateValue(NULL)); + js::SetProxyExtra(mJSObject, 0, js::PrivateValue(nullptr)); JS::Rooted obj(cx, mJSObject); outerObject = xpc::TransplantObject(cx, obj, outerObject); @@ -3133,7 +3133,7 @@ void nsGlobalWindow::OnFinalize(JSObject* aObject) { if (aObject == mJSObject) { - mJSObject = NULL; + mJSObject = nullptr; } } @@ -5618,7 +5618,7 @@ nsGlobalWindow::SetFullScreenInternal(bool aFullScreen, bool aRequireTrust) pmService->NewWakeLock(NS_LITERAL_STRING("DOM_Fullscreen"), this, getter_AddRefs(mWakeLock)); } else if (mWakeLock && !mFullScreen) { mWakeLock->Unlock(); - mWakeLock = NULL; + mWakeLock = nullptr; } return NS_OK; @@ -10441,7 +10441,7 @@ nsGlobalWindow::ShowSlowScriptDialog() } } - // GetStringFromName can return NS_OK and still give NULL string + // GetStringFromName can return NS_OK and still give nullptr string if (NS_FAILED(rv) || !title || !msg || !stopButton || !waitButton || (!debugButton && debugPossible) || !neverShowDlg) { NS_ERROR("Failed to get localized strings."); @@ -10956,7 +10956,7 @@ nsGlobalWindow::GetParentInternal() return parent; } - return NULL; + return nullptr; } void @@ -12697,7 +12697,7 @@ nsGlobalWindow::SyncGamepadState() { FORWARD_TO_INNER_VOID(SyncGamepadState, ()); if (mHasSeenGamepadInput) { - mGamepads.EnumerateRead(EnumGamepadsForSync, NULL); + mGamepads.EnumerateRead(EnumGamepadsForSync, nullptr); } } #endif diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 8f3265f02b5..b2576ffe4fd 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -1062,7 +1062,7 @@ nsJSContext::BindCompiledEventHandler(nsISupports* aTarget, rv = NS_ERROR_OUT_OF_MEMORY; } } else { - funobj = NULL; + funobj = nullptr; } aBoundHandler.set(funobj); @@ -1187,9 +1187,8 @@ nsJSContext::SetProperty(JS::Handle aTarget, const char* aPropName, n } JS::Value vargs = OBJECT_TO_JSVAL(args); - return JS_DefineProperty(mContext, aTarget, aPropName, vargs, NULL, NULL, 0) - ? NS_OK - : NS_ERROR_FAILURE; + return JS_DefineProperty(mContext, aTarget, aPropName, vargs, + nullptr, nullptr, 0) ? NS_OK : NS_ERROR_FAILURE; } nsresult @@ -2519,7 +2518,7 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescrip if (!sShuttingDown) { CallCreateInstance("@mozilla.org/timer;1", &sInterSliceGCTimer); sInterSliceGCTimer->InitWithFuncCallback(InterSliceGCTimerFired, - NULL, + nullptr, NS_INTERSLICE_GC_DELAY, nsITimer::TYPE_ONE_SHOT); } diff --git a/dom/base/nsJSTimeoutHandler.cpp b/dom/base/nsJSTimeoutHandler.cpp index 7bc69d45c0a..3cc8311999f 100644 --- a/dom/base/nsJSTimeoutHandler.cpp +++ b/dom/base/nsJSTimeoutHandler.cpp @@ -93,7 +93,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsJSScriptTimeoutHandler) JS_GetObjectFunction(js::UncheckedUnwrap(tmp->mFunction->Callable())); if (fun && JS_GetFunctionId(fun)) { JSFlatString *funId = JS_ASSERT_STRING_IS_FLAT(JS_GetFunctionId(fun)); - size_t size = 1 + JS_PutEscapedFlatString(NULL, 0, funId, 0); + size_t size = 1 + JS_PutEscapedFlatString(nullptr, 0, funId, 0); char *funIdName = new char[size]; if (funIdName) { JS_PutEscapedFlatString(funIdName, size, funId, 0); diff --git a/dom/base/nsWindowMemoryReporter.cpp b/dom/base/nsWindowMemoryReporter.cpp index 087c2aefa9b..daa97ed1847 100644 --- a/dom/base/nsWindowMemoryReporter.cpp +++ b/dom/base/nsWindowMemoryReporter.cpp @@ -100,7 +100,7 @@ nsWindowMemoryReporter::Init() nsCOMPtr os = services::GetObserverService(); if (os) { // DOM_WINDOW_DESTROYED_TOPIC announces what we call window "detachment", - // when a window's docshell is set to NULL. + // when a window's docshell is set to nullptr. os->AddObserver(sWindowReporter, DOM_WINDOW_DESTROYED_TOPIC, /* weakRef = */ true); os->AddObserver(sWindowReporter, "after-minimize-memory-usage", @@ -185,7 +185,7 @@ CollectWindowReports(nsGlobalWindow *aWindow, // Avoid calling aWindow->GetTop() if there's no outer window. It will work // just fine, but will spew a lot of warnings. - nsGlobalWindow *top = NULL; + nsGlobalWindow *top = nullptr; nsCOMPtr location; if (aWindow->GetOuterWindow()) { // Our window should have a null top iff it has a null docshell. @@ -483,9 +483,12 @@ nsWindowMemoryReporter::CollectReports(nsIMemoryReporterCallback* aCb, WindowPaths topWindowPaths; // Collect window memory usage. - nsWindowSizes windowTotalSizes(NULL); - nsCOMPtr addonManager = - do_GetService("@mozilla.org/addons/integration;1"); + nsWindowSizes windowTotalSizes(nullptr); + nsCOMPtr addonManager; + if (XRE_GetProcessType() == GeckoProcessType_Default) { + // Only try to access the service from the main process. + addonManager = do_GetService("@mozilla.org/addons/integration;1"); + } for (uint32_t i = 0; i < windows.Length(); i++) { rv = CollectWindowReports(windows[i], addonManager, &windowTotalSizes, &ghostWindows, @@ -772,7 +775,7 @@ GetNonDetachedWindowDomainsEnumerator(const uint64_t& aId, nsGlobalWindow* aWind */ void nsWindowMemoryReporter::CheckForGhostWindows( - nsTHashtable *aOutGhostIDs /* = NULL */) + nsTHashtable *aOutGhostIDs /* = nullptr */) { nsCOMPtr tldService = do_GetService( NS_EFFECTIVETLDSERVICE_CONTRACTID); diff --git a/dom/base/nsWindowMemoryReporter.h b/dom/base/nsWindowMemoryReporter.h index 2f38343c894..dbf38084f06 100644 --- a/dom/base/nsWindowMemoryReporter.h +++ b/dom/base/nsWindowMemoryReporter.h @@ -202,7 +202,7 @@ private: * This is called asynchronously after we observe a DOM window being detached * from its docshell, and also right before we generate a memory report. */ - void CheckForGhostWindows(nsTHashtable *aOutGhostIDs = NULL); + void CheckForGhostWindows(nsTHashtable *aOutGhostIDs = nullptr); /** * Maps a weak reference to a detached window (nsIWeakReference) to the time diff --git a/dom/bindings/BindingDeclarations.h b/dom/bindings/BindingDeclarations.h index 5c28363ebba..482aebf7a71 100644 --- a/dom/bindings/BindingDeclarations.h +++ b/dom/bindings/BindingDeclarations.h @@ -459,7 +459,7 @@ GetWrapperCache(nsGlobalWindow*) inline nsWrapperCache* GetWrapperCache(void* p) { - return NULL; + return nullptr; } // Helper template for smart pointers to resolve ambiguity between diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index 227ace74897..e97b26c2353 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -263,7 +263,7 @@ DefineConstants(JSContext* cx, JS::Handle obj, { for (; cs->name; ++cs) { bool ok = - JS_DefineProperty(cx, obj, cs->name, cs->value, NULL, NULL, + JS_DefineProperty(cx, obj, cs->name, cs->value, nullptr, nullptr, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT); if (!ok) { return false; @@ -329,8 +329,8 @@ InterfaceObjectToString(JSContext* cx, unsigned argc, JS::Value *vp) JS::Rooted callee(cx, &args.callee()); if (!args.thisv().isObject()) { - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_CONVERT_TO, - "null", "object"); + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, + JSMSG_CANT_CONVERT_TO, "null", "object"); return false; } @@ -344,7 +344,8 @@ InterfaceObjectToString(JSContext* cx, unsigned argc, JS::Value *vp) const jschar* name = JS_GetInternedStringCharsAndLength(jsname, &length); if (js::GetObjectJSClass(&args.thisv().toObject()) != clasp) { - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_INCOMPATIBLE_PROTO, + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, + JSMSG_INCOMPATIBLE_PROTO, NS_ConvertUTF16toUTF8(name).get(), "toString", "object"); return false; @@ -429,7 +430,7 @@ CreateInterfaceObject(JSContext* cx, JS::Handle global, ctorNargs); } if (!constructor) { - return NULL; + return nullptr; } if (constructorClass) { @@ -441,12 +442,12 @@ CreateInterfaceObject(JSContext* cx, JS::Handle global, InterfaceObjectToString, 0, 0)); if (!toString) { - return NULL; + return nullptr; } JSString *str = ::JS_InternString(cx, name); if (!str) { - return NULL; + return nullptr; } JSObject* toStringObj = JS_GetFunctionObject(toString); js::SetFunctionNativeReserved(toStringObj, TOSTRING_CLASS_RESERVED_SLOT, @@ -457,7 +458,7 @@ CreateInterfaceObject(JSContext* cx, JS::Handle global, if (!JS_DefineProperty(cx, constructor, "length", JS::Int32Value(ctorNargs), nullptr, nullptr, JSPROP_READONLY | JSPROP_PERMANENT)) { - return NULL; + return nullptr; } } @@ -497,7 +498,7 @@ CreateInterfaceObject(JSContext* cx, JS::Handle global, } if (proto && !JS_LinkConstructorAndPrototype(cx, constructor, proto)) { - return NULL; + return nullptr; } if (defineOnGlobal && !DefineConstructor(cx, global, name, constructor)) { @@ -558,7 +559,7 @@ CreateInterfacePrototypeObject(JSContext* cx, JS::Handle global, JS::Rooted ourProto(cx, JS_NewObjectWithUniqueType(cx, protoClass, parentProto, global)); if (!ourProto) { - return NULL; + return nullptr; } if (properties) { @@ -703,8 +704,8 @@ NativeInterface2JSObjectAndThrowIfFailed(JSContext* aCx, MOZ_ASSERT(NS_IsMainThread()); - if (!XPCConvert::NativeInterface2JSObject(aRetval, NULL, aHelper, aIID, - NULL, aAllowNativeWrapper, &rv)) { + if (!XPCConvert::NativeInterface2JSObject(aRetval, nullptr, aHelper, aIID, + nullptr, aAllowNativeWrapper, &rv)) { // I can't tell if NativeInterface2JSObject throws JS exceptions // or not. This is a sloppy stab at the right semantics; the // method really ought to be fixed to behave consistently. diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index 75c7884473b..2d520a98472 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -1032,7 +1032,7 @@ inline bool WrapObject(JSContext* cx, JS::Handle scope, T* p, JS::MutableHandle rval) { - return WrapObject(cx, scope, p, NULL, rval); + return WrapObject(cx, scope, p, nullptr, rval); } // Helper to make it possible to wrap directly out of an nsCOMPtr @@ -1050,7 +1050,7 @@ inline bool WrapObject(JSContext* cx, JS::Handle scope, const nsCOMPtr& p, JS::MutableHandle rval) { - return WrapObject(cx, scope, p, NULL, rval); + return WrapObject(cx, scope, p, nullptr, rval); } // Helper to make it possible to wrap directly out of an nsRefPtr @@ -1068,7 +1068,7 @@ inline bool WrapObject(JSContext* cx, JS::Handle scope, const nsRefPtr& p, JS::MutableHandle rval) { - return WrapObject(cx, scope, p, NULL, rval); + return WrapObject(cx, scope, p, nullptr, rval); } // Specialization to make it easy to use WrapObject in codegen. diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp index 420ee6f84e8..3bb3185d181 100644 --- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -154,7 +154,8 @@ bool DOMProxyHandler::preventExtensions(JSContext *cx, JS::Handle proxy) { // Throw a TypeError, per WebIDL. - JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_CHANGE_EXTENSIBILITY); + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, + JSMSG_CANT_CHANGE_EXTENSIBILITY); return false; } @@ -192,7 +193,7 @@ DOMProxyHandler::defineProperty(JSContext* cx, JS::Handle proxy, JS:: return JS_ReportErrorFlagsAndNumber(cx, JSREPORT_WARNING | JSREPORT_STRICT | JSREPORT_STRICT_MODE_ERROR, - js_GetErrorMessage, NULL, + js_GetErrorMessage, nullptr, JSMSG_GETTER_ONLY); } diff --git a/dom/bluetooth/BluetoothService.h b/dom/bluetooth/BluetoothService.h index 4aa1c412849..fc22a85804c 100644 --- a/dom/bluetooth/BluetoothService.h +++ b/dom/bluetooth/BluetoothService.h @@ -117,7 +117,7 @@ public: * Returns the path of the default adapter, implemented via a platform * specific method. * - * @return Default adapter path/name on success, NULL otherwise + * @return NS_OK on success, NS_ERROR_FAILURE otherwise */ virtual nsresult GetDefaultAdapterPathInternal(BluetoothReplyRunnable* aRunnable) = 0; diff --git a/dom/bluetooth/BluetoothUtils.cpp b/dom/bluetooth/BluetoothUtils.cpp index 32422b5b1ab..17a39642a9e 100644 --- a/dom/bluetooth/BluetoothUtils.cpp +++ b/dom/bluetooth/BluetoothUtils.cpp @@ -111,7 +111,7 @@ BroadcastSystemMessage(const nsAString& aType, NS_ASSERTION(!::JS_IsExceptionPending(cx), "Shouldn't get here when an exception is pending!"); - JS::RootedObject obj(cx, JS_NewObject(cx, NULL, NULL, NULL)); + JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, nullptr, nullptr)); if (!obj) { BT_WARNING("Failed to new JSObject for system message!"); return false; diff --git a/dom/bluetooth/ObexBase.cpp b/dom/bluetooth/ObexBase.cpp index 0b643d35f1b..a11026b6a93 100644 --- a/dom/bluetooth/ObexBase.cpp +++ b/dom/bluetooth/ObexBase.cpp @@ -95,7 +95,7 @@ ParseHeaders(const uint8_t* aHeaderStart, switch (headerId >> 6) { case 0x00: - // NULL terminated Unicode text, length prefixed with 2-byte + // Null-terminated Unicode text, length prefixed with 2-byte // unsigned integer. case 0x01: // byte sequence, length prefixed with 2 byte unsigned integer. diff --git a/dom/bluetooth/linux/BluetoothDBusService.cpp b/dom/bluetooth/linux/BluetoothDBusService.cpp index 475e406d9c8..1a0469ac726 100644 --- a/dom/bluetooth/linux/BluetoothDBusService.cpp +++ b/dom/bluetooth/linux/BluetoothDBusService.cpp @@ -580,7 +580,7 @@ GetProperty(DBusMessageIter aIter, Properties* aPropertyTypes, InfallibleTArray& aProperties) { DBusMessageIter prop_val, array_val_iter; - char* property = NULL; + char* property = nullptr; uint32_t array_type; int i, expectedType, receivedType; @@ -942,14 +942,14 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data) goto handle_error; } - dbus_connection_send(conn, reply, NULL); + dbus_connection_send(conn, reply, nullptr); dbus_message_unref(reply); v = parameters; } else if (dbus_message_is_method_call(msg, DBUS_AGENT_IFACE, "Authorize")) { // This method gets called when the service daemon needs to authorize a // connection/service request. const char *uuid; - if (!dbus_message_get_args(msg, NULL, + if (!dbus_message_get_args(msg, nullptr, DBUS_TYPE_OBJECT_PATH, &objectPath, DBUS_TYPE_STRING, &uuid, DBUS_TYPE_INVALID)) { @@ -987,7 +987,7 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data) goto handle_error; } - dbus_connection_send(conn, reply, NULL); + dbus_connection_send(conn, reply, nullptr); dbus_message_unref(reply); return DBUS_HANDLER_RESULT_HANDLED; } else if (dbus_message_is_method_call(msg, DBUS_AGENT_IFACE, @@ -995,7 +995,7 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data) // This method gets called when the service daemon needs to confirm a // passkey for an authentication. uint32_t passkey; - if (!dbus_message_get_args(msg, NULL, + if (!dbus_message_get_args(msg, nullptr, DBUS_TYPE_OBJECT_PATH, &objectPath, DBUS_TYPE_UINT32, &passkey, DBUS_TYPE_INVALID)) { @@ -1019,7 +1019,7 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data) // This method gets called when the service daemon needs to get the passkey // for an authentication. The return value should be a string of 1-16 // characters length. The string can be alphanumeric. - if (!dbus_message_get_args(msg, NULL, + if (!dbus_message_get_args(msg, nullptr, DBUS_TYPE_OBJECT_PATH, &objectPath, DBUS_TYPE_INVALID)) { errorStr.AssignLiteral("Invalid arguments for RequestPinCode() method"); @@ -1040,7 +1040,7 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data) // This method gets called when the service daemon needs to get the passkey // for an authentication. The return value should be a numeric value // between 0-999999. - if (!dbus_message_get_args(msg, NULL, + if (!dbus_message_get_args(msg, nullptr, DBUS_TYPE_OBJECT_PATH, &objectPath, DBUS_TYPE_INVALID)) { errorStr.AssignLiteral("Invalid arguments for RequestPasskey() method"); @@ -1068,7 +1068,7 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data) goto handle_error; } - dbus_connection_send(conn, reply, NULL); + dbus_connection_send(conn, reply, nullptr); dbus_message_unref(reply); // Do not send an notification to upper layer, too annoying. @@ -1138,7 +1138,7 @@ public: if (!dbus_connection_register_object_path(threadConnection->GetConnection(), KEY_REMOTE_AGENT, mAgentVTable, - NULL)) { + nullptr)) { BT_WARNING("%s: Can't register object path %s for remote device agent!", __FUNCTION__, KEY_REMOTE_AGENT); return; @@ -1157,7 +1157,7 @@ public: void Handle(DBusMessage* aReply) { static const DBusObjectPathVTable sAgentVTable = { - NULL, AgentEventFilter, NULL, NULL, NULL, NULL + nullptr, AgentEventFilter, nullptr, nullptr, nullptr, nullptr }; MOZ_ASSERT(!NS_IsMainThread()); // DBus thread @@ -1227,7 +1227,7 @@ private: if (!dbus_connection_register_object_path(threadConnection->GetConnection(), KEY_LOCAL_AGENT, aAgentVTable, - NULL)) { + nullptr)) { BT_WARNING("%s: Can't register object path %s for agent!", __FUNCTION__, KEY_LOCAL_AGENT); return false; @@ -1341,7 +1341,7 @@ EventFilter(DBusConnection* aConn, DBusMessage* aMsg, void* aData) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } - if (dbus_message_get_path(aMsg) == NULL) { + if (dbus_message_get_path(aMsg) == nullptr) { BT_WARNING("DBusMessage %s has no bluetooth destination, ignoring\n", dbus_message_get_member(aMsg)); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; @@ -1664,7 +1664,7 @@ BluetoothDBusService::StartInternal() // Add a filter for all incoming messages_base if (!dbus_connection_add_filter(mConnection->GetConnection(), - EventFilter, NULL, NULL)) { + EventFilter, nullptr, nullptr)) { BT_WARNING("Cannot create DBus Event Filter for DBus Thread!"); return NS_ERROR_FAILURE; } diff --git a/dom/browser-element/BrowserElementParent.cpp b/dom/browser-element/BrowserElementParent.cpp index 17de9033b10..7975dbad73e 100644 --- a/dom/browser-element/BrowserElementParent.cpp +++ b/dom/browser-element/BrowserElementParent.cpp @@ -226,7 +226,7 @@ BrowserElementParent::OpenWindowInProcess(nsIDOMWindow* aOpenerWindow, const nsACString& aFeatures, nsIDOMWindow** aReturnWindow) { - *aReturnWindow = NULL; + *aReturnWindow = nullptr; // If we call window.open from an