Backed out 2 changesets (bug 784739) because of Windows build failures
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 02 Apr 2013 23:04:49 -0400
changeset 127038 84588077a188bb1ffb7fa120bc8496baec103e1d
parent 127037 06ae36377cfa1051c664a9e3c80b319e2bfc7f6f
child 127039 e60919ded78375ac743af283825c92db3c8cedaa
push id24501
push useremorley@mozilla.com
push dateWed, 03 Apr 2013 10:40:03 +0000
treeherdermozilla-central@3a5929ebc886 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs784739
milestone23.0a1
backs out06ae36377cfa1051c664a9e3c80b319e2bfc7f6f
e56f91d780df95c62c87cbba433362b28a9c57b3
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 784739) because of Windows build failures Backed out changeset 06ae36377cfa (bug 784739) Backed out changeset e56f91d780df (bug 784739)
browser/app/nsBrowserApp.cpp
browser/components/build/nsModule.cpp
browser/components/migration/src/nsIEHistoryEnumerator.cpp
browser/components/shell/src/nsGNOMEShellService.cpp
browser/components/shell/src/nsMacShellService.cpp
browser/components/shell/src/nsWindowsShellService.cpp
browser/metro/shell/commandexecutehandler/CEHHelper.cpp
browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp
browser/metro/shell/linktool/linktool.cpp
browser/metro/shell/testing/metrotestharness.cpp
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -72,17 +72,17 @@ static void Output(const char *fmt, ... 
                       0,
                       msg,
                       -1,
                       wide_msg,
                       _countof(wide_msg));
 #if MOZ_WINCONSOLE
   fwprintf_s(stderr, wide_msg);
 #else
-  MessageBoxW(nullptr, wide_msg, L"Firefox", MB_OK
+  MessageBoxW(NULL, wide_msg, L"Firefox", MB_OK
                                         | MB_ICONERROR
                                         | MB_SETFOREGROUND);
 #endif
 #endif
 
   va_end(ap);
 }
 
@@ -320,41 +320,41 @@ static int do_main(int argc, char* argv[
     if (NS_FAILED(testFile->GetNativePath(path))) {
       Output("Couldn't get test file path.\n");
       return 255;
     }
 
     // Check for a metro test harness command line args file
     HANDLE hTestFile = CreateFileA(path.get(),
                                    GENERIC_READ,
-                                   0, nullptr, OPEN_EXISTING,
+                                   0, NULL, OPEN_EXISTING,
                                    FILE_ATTRIBUTE_NORMAL,
-                                   nullptr);
+                                   NULL);
     if (hTestFile != INVALID_HANDLE_VALUE) {
       // Typical test harness command line args string is around 100 bytes.
       char buffer[1024];
       memset(buffer, 0, sizeof(buffer));
       DWORD bytesRead = 0;
       if (!ReadFile(hTestFile, (VOID*)buffer, sizeof(buffer)-1,
-                    &bytesRead, nullptr) || !bytesRead) {
+                    &bytesRead, NULL) || !bytesRead) {
         CloseHandle(hTestFile);
         printf("failed to read test file '%s'", testFile);
         return -1;
       }
       CloseHandle(hTestFile);
 
       // Build new args array
       char* newArgv[20];
       int newArgc = 1;
 
       memset(newArgv, 0, sizeof(newArgv));
 
       char* ptr = buffer;
       newArgv[0] = ptr;
-      while (*ptr != 0 &&
+      while (*ptr != NULL &&
              (ptr - buffer) < sizeof(buffer) &&
              newArgc < ARRAYSIZE(newArgv)) {
         if (isspace(*ptr)) {
           *ptr = '\0';
           ptr++;
           // Check for the console id the metrotestharness passes in, we need
           // to connect up to this so test output goes to the right place.
           if (ptr && !strncmp(ptr, kMetroConsoleIdParam, strlen(kMetroConsoleIdParam))) {
@@ -456,23 +456,23 @@ InitXPCOMGlue(const char *argv0, nsIFile
     CFURLRef fwurl = CFBundleCopyPrivateFrameworksURL(appBundle);
     CFURLRef absfwurl = nullptr;
     if (fwurl) {
       absfwurl = CFURLCopyAbsoluteURL(fwurl);
       CFRelease(fwurl);
     }
     if (absfwurl) {
       CFURLRef xulurl =
-        CFURLCreateCopyAppendingPathComponent(nullptr, absfwurl,
+        CFURLCreateCopyAppendingPathComponent(NULL, absfwurl,
                                               CFSTR("XUL.framework"),
                                               true);
 
       if (xulurl) {
         CFURLRef xpcomurl =
-          CFURLCreateCopyAppendingPathComponent(nullptr, xulurl,
+          CFURLCreateCopyAppendingPathComponent(NULL, xulurl,
                                                 CFSTR("libxpcom.dylib"),
                                                 false);
 
         if (xpcomurl) {
           if (CFURLGetFileSystemRepresentation(xpcomurl, true,
                                                (UInt8*) exePath,
                                                sizeof(exePath)) &&
               access(tbuffer, R_OK | X_OK) == 0) {
--- a/browser/components/build/nsModule.cpp
+++ b/browser/components/build/nsModule.cpp
@@ -56,30 +56,30 @@ NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
 NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID);
 #if defined(XP_WIN)
 NS_DEFINE_NAMED_CID(NS_WINIEHISTORYENUMERATOR_CID);
 #elif defined(XP_MACOSX)
 NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
 #endif
 
 static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
-    { &kNS_BROWSERDIRECTORYPROVIDER_CID, false, nullptr, DirectoryProviderConstructor },
+    { &kNS_BROWSERDIRECTORYPROVIDER_CID, false, NULL, DirectoryProviderConstructor },
 #if defined(XP_WIN)
-    { &kNS_SHELLSERVICE_CID, false, nullptr, nsWindowsShellServiceConstructor },
+    { &kNS_SHELLSERVICE_CID, false, NULL, nsWindowsShellServiceConstructor },
 #elif defined(MOZ_WIDGET_GTK2)
-    { &kNS_SHELLSERVICE_CID, false, nullptr, nsGNOMEShellServiceConstructor },
+    { &kNS_SHELLSERVICE_CID, false, NULL, nsGNOMEShellServiceConstructor },
 #endif
-    { &kNS_FEEDSNIFFER_CID, false, nullptr, nsFeedSnifferConstructor },
-    { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, nullptr, AboutRedirector::Create },
+    { &kNS_FEEDSNIFFER_CID, false, NULL, nsFeedSnifferConstructor },
+    { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, NULL, AboutRedirector::Create },
 #if defined(XP_WIN)
-    { &kNS_WINIEHISTORYENUMERATOR_CID, false, nullptr, nsIEHistoryEnumeratorConstructor },
+    { &kNS_WINIEHISTORYENUMERATOR_CID, false, NULL, nsIEHistoryEnumeratorConstructor },
 #elif defined(XP_MACOSX)
-    { &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor },
+    { &kNS_SHELLSERVICE_CID, false, NULL, nsMacShellServiceConstructor },
 #endif
-    { nullptr }
+    { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
     { NS_BROWSERDIRECTORYPROVIDER_CONTRACTID, &kNS_BROWSERDIRECTORYPROVIDER_CID },
 #if defined(XP_WIN)
     { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
 #elif defined(MOZ_WIDGET_GTK2)
     { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
@@ -107,23 +107,23 @@ static const mozilla::Module::ContractID
 #ifdef MOZ_SERVICES_HEALTHREPORT
     { NS_ABOUT_MODULE_CONTRACTID_PREFIX "healthreport", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
 #endif
 #if defined(XP_WIN)
     { NS_IEHISTORYENUMERATOR_CONTRACTID, &kNS_WINIEHISTORYENUMERATOR_CID },
 #elif defined(XP_MACOSX)
     { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
 #endif
-    { nullptr }
+    { NULL }
 };
 
 static const mozilla::Module::CategoryEntry kBrowserCategories[] = {
     { XPCOM_DIRECTORY_PROVIDER_CATEGORY, "browser-directory-provider", NS_BROWSERDIRECTORYPROVIDER_CONTRACTID },
     { NS_CONTENT_SNIFFER_CATEGORY, "Feed Sniffer", NS_FEEDSNIFFER_CONTRACTID },
-    { nullptr }
+    { NULL }
 };
 
 static const mozilla::Module kBrowserModule = {
     mozilla::Module::kVersion,
     kBrowserCIDs,
     kBrowserContracts,
     kBrowserCategories
 };
--- a/browser/components/migration/src/nsIEHistoryEnumerator.cpp
+++ b/browser/components/migration/src/nsIEHistoryEnumerator.cpp
@@ -40,32 +40,32 @@ namespace {
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsIEHistoryEnumerator
 
 NS_IMPL_ISUPPORTS1(nsIEHistoryEnumerator, nsISimpleEnumerator)
 
 nsIEHistoryEnumerator::nsIEHistoryEnumerator()
 {
-  ::CoInitialize(nullptr);  
+  ::CoInitialize(NULL);  
 }
 
 nsIEHistoryEnumerator::~nsIEHistoryEnumerator()
 {
   ::CoUninitialize();
 }
 
 void
 nsIEHistoryEnumerator::EnsureInitialized()
 {
   if (mURLEnumerator)
     return;
 
   HRESULT hr = ::CoCreateInstance(CLSID_CUrlHistory,
-                                  nullptr,
+                                  NULL,
                                   CLSCTX_INPROC_SERVER,
                                   IID_IUrlHistoryStg2,
                                   getter_AddRefs(mIEHistory));
   if (FAILED(hr))
     return;
 
   hr = mIEHistory->EnumUrls(getter_AddRefs(mURLEnumerator));
   if (FAILED(hr))
--- a/browser/components/shell/src/nsGNOMEShellService.cpp
+++ b/browser/components/shell/src/nsGNOMEShellService.cpp
@@ -147,17 +147,17 @@ nsGNOMEShellService::GetAppPathFromLaunc
 }
 
 bool
 nsGNOMEShellService::KeyMatchesAppName(const char *aKeyValue) const
 {
 
   gchar *commandPath;
   if (mUseLocaleFilenames) {
-    gchar *nativePath = g_filename_from_utf8(aKeyValue, -1, nullptr, nullptr, nullptr);
+    gchar *nativePath = g_filename_from_utf8(aKeyValue, -1, NULL, NULL, NULL);
     if (!nativePath) {
       NS_ERROR("Error converting path to filesystem encoding");
       return false;
     }
 
     commandPath = g_find_program_in_path(nativePath);
     g_free(nativePath);
   } else {
@@ -177,17 +177,17 @@ nsGNOMEShellService::CheckHandlerMatches
 {
   gint argc;
   gchar **argv;
   nsAutoCString command(handler);
 
   // The string will be something of the form: [/path/to/]browser "%s"
   // We want to remove all of the parameters and get just the binary name.
 
-  if (g_shell_parse_argv(command.get(), &argc, &argv, nullptr) && argc > 0) {
+  if (g_shell_parse_argv(command.get(), &argc, &argv, NULL) && argc > 0) {
     command.Assign(argv[0]);
     g_strfreev(argv);
   }
 
   if (!KeyMatchesAppName(command.get()))
     return false; // the handler is set to another app
 
   return true;
@@ -375,17 +375,17 @@ WriteImage(const nsCString& aPath, imgIC
     do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
   if (!imgToPixbuf)
       return NS_ERROR_NOT_AVAILABLE;
 
   GdkPixbuf* pixbuf = imgToPixbuf->ConvertImageToPixbuf(aImage);
   if (!pixbuf)
       return NS_ERROR_NOT_AVAILABLE;
 
-  gboolean res = gdk_pixbuf_save(pixbuf, aPath.get(), "png", nullptr, nullptr);
+  gboolean res = gdk_pixbuf_save(pixbuf, aPath.get(), "png", NULL, NULL);
 
   g_object_unref(pixbuf);
   return res ? NS_OK : NS_ERROR_FAILURE;
 #endif
 }
                  
 NS_IMETHODIMP
 nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement, 
@@ -449,17 +449,17 @@ nsGNOMEShellService::SetDesktopBackgroun
   // mirrored to GConf by the gsettings->gconf bridge in gnome-settings-daemon
   nsCOMPtr<nsIGSettingsService> gsettings = 
     do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
   if (gsettings) {
     nsCOMPtr<nsIGSettingsCollection> background_settings;
     gsettings->GetCollectionForSchema(
       NS_LITERAL_CSTRING(kDesktopBGSchema), getter_AddRefs(background_settings));
     if (background_settings) {
-      gchar *file_uri = g_filename_to_uri(filePath.get(), nullptr, nullptr);
+      gchar *file_uri = g_filename_to_uri(filePath.get(), NULL, NULL);
       if (!file_uri)
          return NS_ERROR_FAILURE;
 
       background_settings->SetString(NS_LITERAL_CSTRING(kDesktopOptionGSKey),
                                      options);
 
       background_settings->SetString(NS_LITERAL_CSTRING(kDesktopImageGSKey),
                                      nsDependentCString(file_uri));
@@ -610,33 +610,33 @@ nsGNOMEShellService::OpenApplication(int
   bool requiresTerminal;
   gconf->HandlerRequiresTerminal(scheme, &requiresTerminal);
   if (requiresTerminal)
     return NS_ERROR_FAILURE;
 
   // Perform shell argument expansion
   int argc;
   char **argv;
-  if (!g_shell_parse_argv(appCommand.get(), &argc, &argv, nullptr))
+  if (!g_shell_parse_argv(appCommand.get(), &argc, &argv, NULL))
     return NS_ERROR_FAILURE;
 
   char **newArgv = new char*[argc + 1];
   int newArgc = 0;
 
   // Run through the list of arguments.  Copy all of them to the new
   // argv except for %s, which we skip.
   for (int i = 0; i < argc; ++i) {
     if (strcmp(argv[i], "%s") != 0)
       newArgv[newArgc++] = argv[i];
   }
 
   newArgv[newArgc] = nullptr;
 
-  gboolean err = g_spawn_async(nullptr, newArgv, nullptr, G_SPAWN_SEARCH_PATH,
-                               nullptr, nullptr, nullptr, nullptr);
+  gboolean err = g_spawn_async(NULL, newArgv, NULL, G_SPAWN_SEARCH_PATH,
+                               NULL, NULL, NULL, NULL);
 
   g_strfreev(argv);
   delete[] newArgv;
 
   return err ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
--- a/browser/components/shell/src/nsMacShellService.cpp
+++ b/browser/components/shell/src/nsMacShellService.cpp
@@ -35,23 +35,23 @@ NS_IMETHODIMP
 nsMacShellService::IsDefaultBrowser(bool aStartupCheck,
                                     bool aForAllTypes,
                                     bool* aIsDefaultBrowser)
 {
   *aIsDefaultBrowser = false;
 
   CFStringRef firefoxID = ::CFBundleGetIdentifier(::CFBundleGetMainBundle());
   if (!firefoxID) {
-    // CFBundleGetIdentifier is expected to return nullptr only if the specified
+    // CFBundleGetIdentifier is expected to return NULL only if the specified
     // bundle doesn't have a bundle identifier in its plist. In this case, that
     // means a failure, since our bundle does have an identifier.
     return NS_ERROR_FAILURE;
   }
 
-  // Get the default http handler's bundle ID (or nullptr if it has not been explicitly set)
+  // Get the default http handler's bundle ID (or NULL if it has not been explicitly set)
   CFStringRef defaultBrowserID = ::LSCopyDefaultHandlerForURLScheme(CFSTR("http"));
   if (defaultBrowserID) {
     *aIsDefaultBrowser = ::CFStringCompare(firefoxID, defaultBrowserID, 0) == kCFCompareEqualTo;
     ::CFRelease(defaultBrowserID);
   }
 
   // If this is the first browser window, maintain internal state that we've
   // checked this session (so that subsequent window opens don't show the 
@@ -254,17 +254,17 @@ nsMacShellService::OnStateChange(nsIWebP
 
     AEDesc tAEDesc = { typeNull, nil };
     OSErr err = noErr;
     AliasHandle aliasHandle = nil;
     FSRef pictureRef;
     OSStatus status;
 
     // Convert the path into a FSRef
-    status = ::FSPathMakeRef((const UInt8*)nativePath.get(), &pictureRef, nullptr);
+    status = ::FSPathMakeRef((const UInt8*)nativePath.get(), &pictureRef, NULL);
     if (status == noErr) {
       err = ::FSNewAlias(nil, &pictureRef, &aliasHandle);
       if (err == noErr && aliasHandle == nil)
         err = paramErr;
 
       if (err == noErr) {
         // We need the descriptor (based on the picture file reference)
         // for the 'Set Desktop Picture' apple event.
@@ -307,31 +307,31 @@ nsMacShellService::OpenApplication(int32
   nsresult rv = NS_OK;
   CFURLRef appURL = nil;
   OSStatus err = noErr;
 
   switch (aApplication) {
   case nsIShellService::APPLICATION_MAIL:
     {
       CFURLRef tempURL = ::CFURLCreateWithString(kCFAllocatorDefault,
-                                                 CFSTR("mailto:"), nullptr);
-      err = ::LSGetApplicationForURL(tempURL, kLSRolesAll, nullptr, &appURL);
+                                                 CFSTR("mailto:"), NULL);
+      err = ::LSGetApplicationForURL(tempURL, kLSRolesAll, NULL, &appURL);
       ::CFRelease(tempURL);
     }
     break;
   case nsIShellService::APPLICATION_NEWS:
     {
       CFURLRef tempURL = ::CFURLCreateWithString(kCFAllocatorDefault,
-                                                 CFSTR("news:"), nullptr);
-      err = ::LSGetApplicationForURL(tempURL, kLSRolesAll, nullptr, &appURL);
+                                                 CFSTR("news:"), NULL);
+      err = ::LSGetApplicationForURL(tempURL, kLSRolesAll, NULL, &appURL);
       ::CFRelease(tempURL);
     }
     break;
   case nsIMacShellService::APPLICATION_KEYCHAIN_ACCESS:
-    err = ::LSGetApplicationForInfo('APPL', 'kcmr', nullptr, kLSRolesAll, nullptr,
+    err = ::LSGetApplicationForInfo('APPL', 'kcmr', NULL, kLSRolesAll, NULL,
                                     &appURL);
     break;
   case nsIMacShellService::APPLICATION_NETWORK:
     {
       nsCOMPtr<nsIFile> lf;
       rv = NS_NewNativeLocalFile(NETWORK_PREFPANE, true, getter_AddRefs(lf));
       NS_ENSURE_SUCCESS(rv, rv);
       bool exists;
@@ -351,17 +351,17 @@ nsMacShellService::OpenApplication(int32
       if (!exists)
         return NS_ERROR_FILE_NOT_FOUND;
       return lf->Launch();
     }  
     break;
   }
 
   if (appURL && err == noErr) {
-    err = ::LSOpenCFURLRef(appURL, nullptr);
+    err = ::LSOpenCFURLRef(appURL, NULL);
     rv = err != noErr ? NS_ERROR_FAILURE : NS_OK;
 
     ::CFRelease(appURL);
   }
 
   return rv;
 }
 
@@ -389,35 +389,35 @@ nsMacShellService::OpenApplicationWithUR
   nsCOMPtr<nsILocalFileMac> lfm(do_QueryInterface(aApplication));
   CFURLRef appURL;
   nsresult rv = lfm->GetCFURL(&appURL);
   if (NS_FAILED(rv))
     return rv;
   
   const nsCString spec(aURI);
   const UInt8* uriString = (const UInt8*)spec.get();
-  CFURLRef uri = ::CFURLCreateWithBytes(nullptr, uriString, aURI.Length(),
-                                        kCFStringEncodingUTF8, nullptr);
+  CFURLRef uri = ::CFURLCreateWithBytes(NULL, uriString, aURI.Length(),
+                                        kCFStringEncodingUTF8, NULL);
   if (!uri) 
     return NS_ERROR_OUT_OF_MEMORY;
   
-  CFArrayRef uris = ::CFArrayCreate(nullptr, (const void**)&uri, 1, nullptr);
+  CFArrayRef uris = ::CFArrayCreate(NULL, (const void**)&uri, 1, NULL);
   if (!uris) {
     ::CFRelease(uri);
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   LSLaunchURLSpec launchSpec;
   launchSpec.appURL = appURL;
   launchSpec.itemURLs = uris;
-  launchSpec.passThruParams = nullptr;
+  launchSpec.passThruParams = NULL;
   launchSpec.launchFlags = kLSLaunchDefaults;
-  launchSpec.asyncRefCon = nullptr;
+  launchSpec.asyncRefCon = NULL;
   
-  OSErr err = ::LSOpenFromURLSpec(&launchSpec, nullptr);
+  OSErr err = ::LSOpenFromURLSpec(&launchSpec, NULL);
   
   ::CFRelease(uris);
   ::CFRelease(uri);
   
   return err != noErr ? NS_ERROR_FAILURE : NS_OK;
 }
 
 NS_IMETHODIMP
@@ -428,21 +428,21 @@ nsMacShellService::GetDefaultFeedReader(
 
   CFStringRef defaultHandlerID = ::LSCopyDefaultHandlerForURLScheme(CFSTR("feed"));
   if (!defaultHandlerID) {
     defaultHandlerID = ::CFStringCreateWithCString(kCFAllocatorDefault,
                                                    SAFARI_BUNDLE_IDENTIFIER,
                                                    kCFStringEncodingASCII);
   }
 
-  CFURLRef defaultHandlerURL = nullptr;
+  CFURLRef defaultHandlerURL = NULL;
   OSStatus status = ::LSFindApplicationForInfo(kLSUnknownCreator,
                                                defaultHandlerID,
-                                               nullptr, // inName
-                                               nullptr, // outAppRef
+                                               NULL, // inName
+                                               NULL, // outAppRef
                                                &defaultHandlerURL);
 
   if (status == noErr && defaultHandlerURL) {
     nsCOMPtr<nsILocalFileMac> defaultReader =
       do_CreateInstance("@mozilla.org/file/local;1", &rv);
     if (NS_SUCCEEDED(rv)) {
       rv = defaultReader->InitWithCFURL(defaultHandlerURL);
       if (NS_SUCCEEDED(rv)) {
--- a/browser/components/shell/src/nsWindowsShellService.cpp
+++ b/browser/components/shell/src/nsWindowsShellService.cpp
@@ -218,18 +218,18 @@ GetHelperPath(nsAutoString& aPath)
 }
 
 nsresult
 LaunchHelper(nsAutoString& aPath)
 {
   STARTUPINFOW si = {sizeof(si), 0};
   PROCESS_INFORMATION pi = {0};
 
-  if (!CreateProcessW(nullptr, (LPWSTR)aPath.get(), nullptr, nullptr, FALSE, 0, nullptr,
-                      nullptr, &si, &pi)) {
+  if (!CreateProcessW(NULL, (LPWSTR)aPath.get(), NULL, NULL, FALSE, 0, NULL,
+                      NULL, &si, &pi)) {
     return NS_ERROR_FAILURE;
   }
 
   CloseHandle(pi.hProcess);
   CloseHandle(pi.hThread);
   return NS_OK;
 }
 
@@ -356,17 +356,17 @@ IsAARDefaultHTML(IApplicationAssociation
 }
 
 bool
 nsWindowsShellService::IsDefaultBrowserVista(bool aCheckAllTypes,
                                              bool* aIsDefaultBrowser)
 {
   IApplicationAssociationRegistration* pAAR;
   HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,
-                                nullptr,
+                                NULL,
                                 CLSCTX_INPROC,
                                 IID_IApplicationAssociationRegistration,
                                 (void**)&pAAR);
 
   if (SUCCEEDED(hr)) {
     if (aCheckAllTypes) {
       BOOL res;
       hr = pAAR->QueryAppIsDefaultAll(AL_EFFECTIVE,
@@ -442,17 +442,17 @@ nsWindowsShellService::IsDefaultBrowser(
     rv = OpenKeyForReading(HKEY_CLASSES_ROOT, keyName, &theKey);
     if (NS_FAILED(rv)) {
       *aIsDefaultBrowser = false;
       return NS_OK;
     }
 
     ::ZeroMemory(currValue, sizeof(currValue));
     DWORD len = sizeof currValue;
-    res = ::RegQueryValueExW(theKey, L"", nullptr, nullptr, (LPBYTE)currValue, &len);
+    res = ::RegQueryValueExW(theKey, L"", NULL, NULL, (LPBYTE)currValue, &len);
     // Close the key that was opened.
     ::RegCloseKey(theKey);
     if (REG_FAILED(res) ||
         !valueData.Equals(currValue, CaseInsensitiveCompare)) {
       // Key wasn't set or was set to something other than our registry entry.
       NS_ConvertUTF8toUTF16 oldValueData(settings->oldValueData);
       offset = oldValueData.Find("%APPPATH%");
       oldValueData.Replace(offset, 9, appLongPath);
@@ -511,28 +511,28 @@ nsWindowsShellService::IsDefaultBrowser(
         // If disabling DDE fails try to disable it using the helper
         // application when setting Firefox as the default browser.
         *aIsDefaultBrowser = false;
         return NS_OK;
       }
 
       ::ZeroMemory(currValue, sizeof(currValue));
       DWORD len = sizeof currValue;
-      res = ::RegQueryValueExW(theKey, L"", nullptr, nullptr, (LPBYTE)currValue,
+      res = ::RegQueryValueExW(theKey, L"", NULL, NULL, (LPBYTE)currValue,
                                &len);
       // Close the key that was opened.
       ::RegCloseKey(theKey);
       if (REG_FAILED(res) || PRUnichar('\0') != *currValue) {
         // Key wasn't set or was set to something other than our registry entry.
         // Delete the key along with all of its childrean and then recreate it.
         const nsString &flatName = PromiseFlatString(keyName);
         ::SHDeleteKeyW(HKEY_CURRENT_USER, flatName.get());
-        res = ::RegCreateKeyExW(HKEY_CURRENT_USER, flatName.get(), 0, nullptr,
-                                REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, nullptr,
-                                &theKey, nullptr);
+        res = ::RegCreateKeyExW(HKEY_CURRENT_USER, flatName.get(), 0, NULL,
+                                REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL,
+                                &theKey, NULL);
         if (REG_FAILED(res)) {
           // If disabling DDE fails try to disable it using the helper
           // application when setting Firefox as the default browser.
           *aIsDefaultBrowser = false;
           return NS_OK;
         }
 
         res = ::RegSetValueExW(theKey, L"", 0, REG_SZ, (const BYTE *) L"",
@@ -559,17 +559,17 @@ nsWindowsShellService::IsDefaultBrowser(
     }
 
     NS_ConvertUTF8toUTF16 oldValueOpen(OLD_VAL_OPEN);
     int32_t offset = oldValueOpen.Find("%APPPATH%");
     oldValueOpen.Replace(offset, 9, appLongPath);
 
     ::ZeroMemory(currValue, sizeof(currValue));
     DWORD len = sizeof currValue;
-    res = ::RegQueryValueExW(theKey, L"", nullptr, nullptr, (LPBYTE)currValue,
+    res = ::RegQueryValueExW(theKey, L"", NULL, NULL, (LPBYTE)currValue,
                              &len);
 
     // Don't update the FTP protocol handler's shell open command when the
     // current registry value doesn't exist or matches the old format.
     if (REG_FAILED(res) ||
         !oldValueOpen.Equals(currValue, CaseInsensitiveCompare)) {
       ::RegCloseKey(theKey);
       return NS_OK;
@@ -601,17 +601,17 @@ nsWindowsShellService::GetCanSetDesktopB
   return NS_OK;
 }
 
 static nsresult
 DynSHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
 {
   typedef HRESULT (WINAPI * SHOpenWithDialogPtr)(HWND hwndParent,
                                                  const OPENASINFO *poainfo);
-  static SHOpenWithDialogPtr SHOpenWithDialogFn = nullptr;
+  static SHOpenWithDialogPtr SHOpenWithDialogFn = NULL;
   if (!SHOpenWithDialogFn) {
     // shell32.dll is in the knownDLLs list so will always be loaded from the
     // system32 directory.
     static const PRUnichar kSehllLibraryName[] =  L"shell32.dll";
     HMODULE shellDLL = ::LoadLibraryW(kSehllLibraryName);
     if (!shellDLL) {
       return NS_ERROR_FAILURE;
     }
@@ -645,36 +645,36 @@ nsWindowsShellService::LaunchControlPane
     return NS_ERROR_FAILURE;
   }
 
   WCHAR params[] = L"control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram";
   STARTUPINFOW si = {sizeof(si), 0};
   si.dwFlags = STARTF_USESHOWWINDOW;
   si.wShowWindow = SW_SHOWDEFAULT;
   PROCESS_INFORMATION pi = {0};
-  if (!CreateProcessW(controlEXEPath, params, nullptr, nullptr, FALSE, 0, nullptr,
-                      nullptr, &si, &pi)) {
+  if (!CreateProcessW(controlEXEPath, params, NULL, NULL, FALSE, 0, NULL,
+                      NULL, &si, &pi)) {
     return NS_ERROR_FAILURE;
   }
   CloseHandle(pi.hProcess);
   CloseHandle(pi.hThread);
 
   return NS_OK;
 }
 
 nsresult
 nsWindowsShellService::LaunchHTTPHandlerPane()
 {
   OPENASINFO info;
   info.pcszFile = L"http";
-  info.pcszClass = nullptr;
+  info.pcszClass = NULL;
   info.oaifInFlags = OAIF_FORCE_REGISTRATION | 
                      OAIF_URL_PROTOCOL |
                      OAIF_REGISTER_EXT;
-  return DynSHOpenWithDialog(nullptr, &info);
+  return DynSHOpenWithDialog(NULL, &info);
 }
 
 NS_IMETHODIMP
 nsWindowsShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers)
 {
   nsAutoString appHelperPath;
   if (NS_FAILED(GetHelperPath(appHelperPath)))
     return NS_ERROR_FAILURE;
@@ -1023,18 +1023,18 @@ nsWindowsShellService::OpenApplication(i
   while (cursor < end);
 
   STARTUPINFOW si;
   PROCESS_INFORMATION pi;
 
   ::ZeroMemory(&si, sizeof(STARTUPINFOW));
   ::ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
 
-  BOOL success = ::CreateProcessW(nullptr, (LPWSTR)path.get(), nullptr,
-                                  nullptr, FALSE, 0, nullptr,  nullptr,
+  BOOL success = ::CreateProcessW(NULL, (LPWSTR)path.get(), NULL,
+                                  NULL, FALSE, 0, NULL,  NULL,
                                   &si, &pi);
   if (!success)
     return NS_ERROR_FAILURE;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/browser/metro/shell/commandexecutehandler/CEHHelper.cpp
+++ b/browser/metro/shell/commandexecutehandler/CEHHelper.cpp
@@ -18,29 +18,29 @@ typedef HRESULT (WINAPI*D3D10CreateDevic
 typedef HRESULT(WINAPI*CreateDXGIFactory1Func)(REFIID , void **);
 
 void
 Log(const wchar_t *fmt, ...)
 {
 #if !defined(SHOW_CONSOLE)
   return;
 #endif
-  va_list a = nullptr;
+  va_list a = NULL;
   wchar_t szDebugString[1024];
   if(!lstrlenW(fmt))
     return;
   va_start(a,fmt);
   vswprintf(szDebugString, 1024, fmt, a);
   va_end(a);
   if(!lstrlenW(szDebugString))
     return;
 
   DWORD len;
-  WriteConsoleW(sCon, szDebugString, lstrlenW(szDebugString), &len, nullptr);
-  WriteConsoleW(sCon, L"\n", 1, &len, nullptr);
+  WriteConsoleW(sCon, szDebugString, lstrlenW(szDebugString), &len, NULL);
+  WriteConsoleW(sCon, L"\n", 1, &len, NULL);
 
   if (IsDebuggerPresent()) {  
     OutputDebugStringW(szDebugString);
     OutputDebugStringW(L"\n");
   }
 }
 
 #if defined(SHOW_CONSOLE)
@@ -48,17 +48,17 @@ void
 SetupConsole()
 {
   FILE *fp;
   AllocConsole();
   sCon = GetStdHandle(STD_OUTPUT_HANDLE); 
   int fd = _open_osfhandle(reinterpret_cast<intptr_t>(sCon), 0);
   fp = _fdopen(fd, "w");
   *stdout = *fp;
-  setvbuf(stdout, nullptr, _IONBF, 0);
+  setvbuf(stdout, NULL, _IONBF, 0);
 }
 #endif
 
 bool
 IsDX10Available()
 {
   DWORD isDX10Available;
   if (GetDWORDRegKey(metroDX10Available, isDX10Available)) {
@@ -99,29 +99,29 @@ IsDX10Available()
   CComPtr<IDXGIAdapter1> adapter1;
   if (FAILED(factory1->EnumAdapters1(0, &adapter1))) {
     SetDWORDRegKey(metroDX10Available, 0);
     return false;
   }
 
   CComPtr<ID3D10Device1> device;
   // Try for DX10.1
-  if (FAILED(createD3DDevice(adapter1, D3D10_DRIVER_TYPE_HARDWARE, nullptr,
+  if (FAILED(createD3DDevice(adapter1, D3D10_DRIVER_TYPE_HARDWARE, NULL,
                              D3D10_CREATE_DEVICE_BGRA_SUPPORT |
                              D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS,
                              D3D10_FEATURE_LEVEL_10_1,
                              D3D10_1_SDK_VERSION, &device))) {
     // Try for DX10
-    if (FAILED(createD3DDevice(adapter1, D3D10_DRIVER_TYPE_HARDWARE, nullptr,
+    if (FAILED(createD3DDevice(adapter1, D3D10_DRIVER_TYPE_HARDWARE, NULL,
                                D3D10_CREATE_DEVICE_BGRA_SUPPORT |
                                D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS,
                                D3D10_FEATURE_LEVEL_10_0,
                                D3D10_1_SDK_VERSION, &device))) {
       // Try for DX9.3 (we fall back to cairo and cairo has support for D3D 9.3)
-      if (FAILED(createD3DDevice(adapter1, D3D10_DRIVER_TYPE_HARDWARE, nullptr,
+      if (FAILED(createD3DDevice(adapter1, D3D10_DRIVER_TYPE_HARDWARE, NULL,
                                  D3D10_CREATE_DEVICE_BGRA_SUPPORT |
                                  D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS,
                                  D3D10_FEATURE_LEVEL_9_3,
                                  D3D10_1_SDK_VERSION, &device))) {
 
         SetDWORDRegKey(metroDX10Available, 0);
         return false;
       }
--- a/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp
+++ b/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp
@@ -37,17 +37,17 @@ static const WCHAR* kFirefoxExe = L"fire
 static const WCHAR* kMetroFirefoxExe = L"firefox.exe";
 static const WCHAR* kDefaultMetroBrowserIDPathKey = L"FirefoxURL";
 static const WCHAR* kDemoMetroBrowserIDPathKey = L"Mozilla.Firefox.URL";
 
 template <class T>void SafeRelease(T **ppT)
 {
   if (*ppT) {
     (*ppT)->Release();
-    *ppT = nullptr;
+    *ppT = NULL;
   }
 }
 
 template <class T> HRESULT SetInterface(T **ppT, IUnknown *punk)
 {
   SafeRelease(ppT);
   return punk ? punk->QueryInterface(ppT) : E_NOINTERFACE;
 }
@@ -58,18 +58,18 @@ class __declspec(uuid("5100FEC1-212B-4BF
                         public IInitializeCommand,
                         public IObjectWithSite,
                         public IExecuteCommandApplicationHostEnvironment
 {
 public:
 
   CExecuteCommandVerb() :
     mRef(1),
-    mShellItemArray(nullptr),
-    mUnkSite(nullptr),
+    mShellItemArray(NULL),
+    mUnkSite(NULL),
     mTargetIsFileSystemLink(false),
     mIsDesktopRequest(true),
     mRequestMet(false)
   {
   }
 
   bool RequestMet() { return mRequestMet; }
   long RefCount() { return mRef; }
@@ -143,34 +143,34 @@ public:
     aArray->GetCount(&count);
     if (!count) {
       return E_FAIL;
     }
 
 #ifdef SHOW_CONSOLE
     Log(L"SetSelection param count: %d", count);
     for (DWORD idx = 0; idx < count; idx++) {
-      IShellItem* item = nullptr;
+      IShellItem* item = NULL;
       if (SUCCEEDED(aArray->GetItemAt(idx, &item))) {
-        LPWSTR str = nullptr;
+        LPWSTR str = NULL;
         if (FAILED(item->GetDisplayName(SIGDN_FILESYSPATH, &str))) {
           if (FAILED(item->GetDisplayName(SIGDN_URL, &str))) {
             Log(L"Failed to get a shell item array item.");
             item->Release();
             continue;
           }
         }
         item->Release();
         Log(L"SetSelection param: '%s'", str);
         CoTaskMemFree(str);
       }
     }
 #endif
 
-    IShellItem* item = nullptr;
+    IShellItem* item = NULL;
     if (FAILED(aArray->GetItemAt(0, &item))) {
       return E_FAIL;
     }
 
     bool isFileSystem = false;
     if (!SetTargetPath(item) || !mTarget.GetLength()) {
       Log(L"SetTargetPath failed.");
       return E_FAIL;
@@ -178,17 +178,17 @@ public:
     item->Release();
 
     Log(L"SetSelection target: %s", mTarget);
     return S_OK;
   }
 
   IFACEMETHODIMP GetSelection(REFIID aRefID, void **aInt)
   {
-    *aInt = nullptr;
+    *aInt = NULL;
     return mShellItemArray ? mShellItemArray->QueryInterface(aRefID, aInt) : E_FAIL;
   }
 
   // IInitializeCommand
   IFACEMETHODIMP Initialize(PCWSTR aVerb, IPropertyBag* aPropBag)
   {
     if (!aVerb)
       return E_FAIL;
@@ -202,41 +202,41 @@ public:
   IFACEMETHODIMP SetSite(IUnknown *aUnkSite)
   {
     SetInterface(&mUnkSite, aUnkSite);
     return S_OK;
   }
 
   IFACEMETHODIMP GetSite(REFIID aRefID, void **aInt)
   {
-    *aInt = nullptr;
+    *aInt = NULL;
     return mUnkSite ? mUnkSite->QueryInterface(aRefID, aInt) : E_FAIL;
   }
 
   // IExecuteCommandApplicationHostEnvironment
   IFACEMETHODIMP GetValue(AHE_TYPE *aLaunchType)
   {
     Log(L"IExecuteCommandApplicationHostEnvironment::GetValue()");
     *aLaunchType = AHE_DESKTOP;
     mIsDesktopRequest = true;
 
     if (!mUnkSite) {
       Log(L"No mUnkSite.");
       return S_OK;
     }
 
     HRESULT hr;
-    IServiceProvider* pSvcProvider = nullptr;
+    IServiceProvider* pSvcProvider = NULL;
     hr = mUnkSite->QueryInterface(IID_IServiceProvider, (void**)&pSvcProvider);
     if (!pSvcProvider) {
       Log(L"Couldn't get IServiceProvider service from explorer. (%X)", hr);
       return S_OK;
     }
 
-    IExecuteCommandHost* pHost = nullptr;
+    IExecuteCommandHost* pHost = NULL;
     // If we can't get this it's a conventional desktop launch
     hr = pSvcProvider->QueryService(SID_ExecuteCommandHost,
                                     IID_IExecuteCommandHost, (void**)&pHost);
     if (!pHost) {
       Log(L"Couldn't get IExecuteCommandHost service from explorer. (%X)", hr);
       SafeRelease(&pSvcProvider);
       return S_OK;
     }
@@ -277,17 +277,17 @@ public:
     return S_OK;
   }
 
   bool IsDefaultBrowser()
   {
     bool result = false;
     IApplicationAssociationRegistration* pAAR;
     HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,
-                                  nullptr,
+                                  NULL,
                                   CLSCTX_INPROC,
                                   IID_IApplicationAssociationRegistration,
                                   (void**)&pAAR);
     if (SUCCEEDED(hr)) {
       BOOL res;
       hr = pAAR->QueryAppIsDefaultAll(AL_EFFECTIVE,
                                       APP_REG_NAME,
                                       &res);
@@ -343,17 +343,17 @@ private:
  *
  * @aPathBuffer Buffer to fill
  */
 static bool GetModulePath(CStringW& aPathBuffer)
 {
   WCHAR buffer[MAX_PATH];
   memset(buffer, 0, sizeof(buffer));
 
-  if (!GetModuleFileName(nullptr, buffer, MAX_PATH)) {
+  if (!GetModuleFileName(NULL, buffer, MAX_PATH)) {
     Log(L"GetModuleFileName failed.");
     return false;
   }
 
   WCHAR* slash = wcsrchr(buffer, '\\');
   if (!slash)
     return false;
   *slash = '\0';
@@ -395,17 +395,17 @@ static bool GetDefaultBrowserAppModelID(
 
   HKEY key;
   if (RegOpenKeyExW(HKEY_CLASSES_ROOT, kDefaultMetroBrowserIDPathKey,
                     0, KEY_READ, &key) != ERROR_SUCCESS) {
     return false;
   }
   DWORD len = aCharLength * sizeof(WCHAR);
   memset(aIDBuffer, 0, len);
-  if (RegQueryValueExW(key, L"AppUserModelID", nullptr, nullptr,
+  if (RegQueryValueExW(key, L"AppUserModelID", NULL, NULL,
                        (LPBYTE)aIDBuffer, &len) != ERROR_SUCCESS || !len) {
     RegCloseKey(key);
     return false;
   }
   RegCloseKey(key);
   return true;
 }
 
@@ -487,17 +487,17 @@ bool CExecuteCommandVerb::SetTargetPath(
 {
   if (!aItem)
     return false;
 
   CString cstrText;
   CComPtr<IDataObject> object;
   // Check the underlying data object first to insure we get
   // absolute uri. See chromium bug 157184.
-  if (SUCCEEDED(aItem->BindToHandler(nullptr, BHID_DataObject,
+  if (SUCCEEDED(aItem->BindToHandler(NULL, BHID_DataObject,
                                      IID_IDataObject,
                                      reinterpret_cast<void**>(&object))) &&
       GetPlainText(object, cstrText)) {
     wchar_t scheme[16];
     URL_COMPONENTS components = {0};
     components.lpszScheme = scheme;
     components.dwSchemeLength = sizeof(scheme)/sizeof(scheme[0]);
     components.dwStructSize = sizeof(components);
@@ -510,17 +510,17 @@ bool CExecuteCommandVerb::SetTargetPath(
     mTargetIsFileSystemLink = (components.nScheme == INTERNET_SCHEME_FILE);
     mTarget = cstrText;
     return true;
   }
 
   Log(L"No data object or data object has no text.");
 
   // Use the shell item display name
-  LPWSTR str = nullptr;
+  LPWSTR str = NULL;
   mTargetIsFileSystemLink = true;
   if (FAILED(aItem->GetDisplayName(SIGDN_FILESYSPATH, &str))) {
     mTargetIsFileSystemLink = false;
     if (FAILED(aItem->GetDisplayName(SIGDN_URL, &str))) {
       Log(L"Failed to get parameter string.");
       return false;
     }
   }
@@ -550,22 +550,22 @@ void CExecuteCommandVerb::LaunchDesktopB
     params += "\"";
   }
 
   Log(L"Desktop Launch: verb:%s exe:%s params:%s", mVerb, browserPath, params); 
 
   SHELLEXECUTEINFOW seinfo;
   memset(&seinfo, 0, sizeof(seinfo));
   seinfo.cbSize = sizeof(SHELLEXECUTEINFOW);
-  seinfo.fMask  = nullptr;
-  seinfo.hwnd   = nullptr;
-  seinfo.lpVerb = nullptr;
+  seinfo.fMask  = NULL;
+  seinfo.hwnd   = NULL;
+  seinfo.lpVerb = NULL;
   seinfo.lpFile = browserPath;
   seinfo.lpParameters =  params;
-  seinfo.lpDirectory  = nullptr;
+  seinfo.lpDirectory  = NULL;
   seinfo.nShow  = SW_SHOWNORMAL;
         
   ShellExecuteExW(&seinfo);
 }
 
 class AutoSetRequestMet
 {
 public:
@@ -589,19 +589,19 @@ IFACEMETHODIMP CExecuteCommandVerb::Exec
 
   // Launch on the desktop
   if (mIsDesktopRequest) {
     LaunchDesktopBrowser();
     return S_OK;
   }
 
   // Launch into Metro
-  IApplicationActivationManager* activateMgr = nullptr;
+  IApplicationActivationManager* activateMgr = NULL;
   DWORD processID;
-  if (FAILED(CoCreateInstance(CLSID_ApplicationActivationManager, nullptr,
+  if (FAILED(CoCreateInstance(CLSID_ApplicationActivationManager, NULL,
                               CLSCTX_LOCAL_SERVER,
                               IID_IApplicationActivationManager,
                               (void**)&activateMgr))) {
     Log(L"CoCreateInstance failed, launching on desktop.");
     LaunchDesktopBrowser();
     return S_OK;
   }
   
@@ -611,17 +611,17 @@ IFACEMETHODIMP CExecuteCommandVerb::Exec
     Log(L"GetDefaultBrowserAppModelID failed, launching on desktop.");
     activateMgr->Release();
     LaunchDesktopBrowser();
     return S_OK;
   }
 
   // Hand off focus rights to the out-of-process activation server. Without
   // this the metro interface won't launch.
-  hr = CoAllowSetForegroundWindow(activateMgr, nullptr);
+  hr = CoAllowSetForegroundWindow(activateMgr, NULL);
   if (FAILED(hr)) {
     Log(L"CoAllowSetForegroundWindow result %X", hr);
     activateMgr->Release();
     return false;
   }
 
   Log(L"Metro Launch: verb:%s appid:%s params:%s", mVerb, appModelID, mTarget); 
 
@@ -681,33 +681,33 @@ ClassFactory::Register(CLSCTX aClass, RE
   return CoRegisterClassObject(__uuidof(CExecuteCommandVerb),
                                static_cast<IClassFactory *>(this),
                                aClass, aUse, &mRegID);
 }
 
 STDMETHODIMP
 ClassFactory::QueryInterface(REFIID riid, void **ppv)
 {
-  IUnknown *punk = nullptr;
+  IUnknown *punk = NULL;
   if (riid == IID_IUnknown || riid == IID_IClassFactory) {
     punk = static_cast<IClassFactory*>(this);
   }
   *ppv = punk;
   if (punk) {
     punk->AddRef();
     return S_OK;
   } else {
     return E_NOINTERFACE;
   }
 }
 
 STDMETHODIMP
 ClassFactory::CreateInstance(IUnknown *punkOuter, REFIID riid, void **ppv)
 {
-  *ppv = nullptr;
+  *ppv = NULL;
   if (punkOuter)
     return CLASS_E_NOAGGREGATION;
   return mUnkObject->QueryInterface(riid, ppv);
 }
 
 LONG gObjRefCnt;
 
 STDMETHODIMP
@@ -725,36 +725,36 @@ int APIENTRY wWinMain(HINSTANCE, HINSTAN
 {
 #if defined(SHOW_CONSOLE)
   SetupConsole();
 #endif
   //Log(pszCmdLine);
 
   if (!wcslen(pszCmdLine) || StrStrI(pszCmdLine, L"-Embedding"))
   {
-      CoInitialize(nullptr);
+      CoInitialize(NULL);
 
       CExecuteCommandVerb *pHandler = new CExecuteCommandVerb();
       if (!pHandler)
         return E_OUTOFMEMORY;
 
       IUnknown* ppi;
       pHandler->QueryInterface(IID_IUnknown, (void**)&ppi);
       if (!ppi)
         return E_FAIL;
 
       ClassFactory classFactory(ppi);
       ppi->Release();
-      ppi = nullptr;
+      ppi = NULL;
 
       // REGCLS_SINGLEUSE insures we only get used once and then discarded.
       if (FAILED(classFactory.Register(CLSCTX_LOCAL_SERVER, REGCLS_SINGLEUSE)))
         return -1;
 
-      if (!SetTimer(nullptr, 1, HEARTBEAT_MSEC, nullptr)) {
+      if (!SetTimer(NULL, 1, HEARTBEAT_MSEC, NULL)) {
         Log(L"Failed to set timer, can't process request.");
         return -1;
       }
 
       MSG msg;
       long beatCount = 0;
       while (GetMessage(&msg, 0, 0, 0) > 0) {
         if (msg.message == WM_TIMER) {
--- a/browser/metro/shell/linktool/linktool.cpp
+++ b/browser/metro/shell/linktool/linktool.cpp
@@ -32,20 +32,20 @@ void DumpParameters(LPCWSTR aTargetPath,
   if (aDescription)
     wprintf(L"description: '%s'\n", aDescription);
 }
 
 HRESULT
 SetShortcutProps(LPCWSTR aShortcutPath, LPCWSTR aAppModelID, bool aSetID, bool aSetMode) 
 {
   HRESULT hres; 
-  ::CoInitialize(nullptr);
+  ::CoInitialize(NULL);
 
-  IPropertyStore *m_pps = nullptr;
-  if (FAILED(hres = SHGetPropertyStoreFromParsingName(aShortcutPath, nullptr, GPS_READWRITE, IID_PPV_ARGS(&m_pps)))) {
+  IPropertyStore *m_pps = NULL;
+  if (FAILED(hres = SHGetPropertyStoreFromParsingName(aShortcutPath, NULL, GPS_READWRITE, IID_PPV_ARGS(&m_pps)))) {
     printf("SHGetPropertyStoreFromParsingName failed\n");
     goto Exit;
   }
 
   if (aSetMode) {
     PROPVARIANT propvar;
     if (FAILED(hres = InitPropVariantFromBoolean(true, &propvar)) ||
         FAILED(hres = m_pps->SetValue(PKEY_AppUserModel_IsDualMode, propvar))) {
@@ -74,20 +74,20 @@ SetShortcutProps(LPCWSTR aShortcutPath, 
   CoUninitialize();
   return hres;
 }
 
 HRESULT
 PrintShortcutProps(LPCWSTR aTargetPath) 
 {
   HRESULT hres; 
-  ::CoInitialize(nullptr);
+  ::CoInitialize(NULL);
 
-  IPropertyStore *m_pps = nullptr;
-  if (FAILED(hres = SHGetPropertyStoreFromParsingName(aTargetPath, nullptr, GPS_READWRITE, IID_PPV_ARGS(&m_pps)))) {
+  IPropertyStore *m_pps = NULL;
+  if (FAILED(hres = SHGetPropertyStoreFromParsingName(aTargetPath, NULL, GPS_READWRITE, IID_PPV_ARGS(&m_pps)))) {
     printf("SHGetPropertyStoreFromParsingName failed\n");
     goto Exit;
   }
 
   bool found = false;
 
   PROPVARIANT propvar;
   if (SUCCEEDED(hres = m_pps->GetValue(PKEY_AppUserModel_IsDualMode, &propvar)) && propvar.vt == VT_BOOL && propvar.boolVal == -1) {
@@ -120,32 +120,32 @@ PrintShortcutProps(LPCWSTR aTargetPath)
 HRESULT
 CreateLink(LPCWSTR aTargetPath, LPCWSTR aShortcutPath, LPCWSTR aDescription) 
 { 
     HRESULT hres;
     IShellLink* psl;
  
     wprintf(L"creating shortcut: '%s'\n",  aShortcutPath);
 
-    CoInitialize(nullptr);
+    CoInitialize(NULL);
 
-    hres = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER,
+    hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
                             IID_IShellLink, (LPVOID*)&psl);
     if (FAILED(hres)) {
       CoUninitialize();
       return hres;
     }
     psl->SetPath(aTargetPath);
     if (aDescription) {
       psl->SetDescription(aDescription);
     } else {
       psl->SetDescription(L"");
     }
  
-    IPersistFile* ppf = nullptr;
+    IPersistFile* ppf = NULL;
     hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
  
     if (SUCCEEDED(hres)) {
         hres = ppf->Save(aShortcutPath, TRUE);
         ppf->Release();
     }
     psl->Release();
     CoUninitialize();
@@ -256,31 +256,31 @@ int wmain(int argc, WCHAR* argv[])
   }
 
   if (updateFound && !appModelIDFound && !modeFound) {
     printf("no properties selected.\n");
     return -1;
   }
 
   if (createShortcutFound) {
-    if (FAILED(hres = CreateLink(targetPathStr, shortcutPathStr, (descriptionFound ? descriptionStr : nullptr)))) {
+    if (FAILED(hres = CreateLink(targetPathStr, shortcutPathStr, (descriptionFound ? descriptionStr : NULL)))) {
       printf("failed creating shortcut HRESULT=%X\n", hres);
       return -1;
     }
   }
 
   LPCWSTR target;
   if (createShortcutFound) {
     target = shortcutPathStr;
   } else {
     target = targetPathStr;
   }
 
   if (appModelIDFound || modeFound) {
-    if (FAILED(hres = SetShortcutProps(target, (appModelIDFound ? appModelIDStr : nullptr), appModelIDFound, modeFound))) {
+    if (FAILED(hres = SetShortcutProps(target, (appModelIDFound ? appModelIDStr : NULL), appModelIDFound, modeFound))) {
       printf("failed adding property HRESULT=%X\n", hres);
       return -1;
     }
   }
 
 	return 0;
 }
 
--- a/browser/metro/shell/testing/metrotestharness.cpp
+++ b/browser/metro/shell/testing/metrotestharness.cpp
@@ -32,33 +32,33 @@ CString sAppParams;
 CString sFirefoxPath;
 
 // The tests file we write out for firefox.exe which contains test
 // startup command line paramters.
 #define kMetroTestFile "tests.ini"
 
 static void Log(const wchar_t *fmt, ...)
 {
-  va_list a = nullptr;
+  va_list a = NULL;
   wchar_t szDebugString[1024];
   if(!lstrlenW(fmt))
     return;
   va_start(a,fmt);
   vswprintf(szDebugString, 1024, fmt, a);
   va_end(a);
   if(!lstrlenW(szDebugString))
     return;
 
   wprintf(L"INFO | metrotestharness.exe | %s\n", szDebugString);
   fflush(stdout);
 }
 
 static void Fail(const wchar_t *fmt, ...)
 {
-  va_list a = nullptr;
+  va_list a = NULL;
   wchar_t szDebugString[1024];
   if(!lstrlenW(fmt))
     return;
   va_start(a,fmt);
   vswprintf(szDebugString, 1024, fmt, a);
   va_end(a);
   if(!lstrlenW(szDebugString))
     return;
@@ -72,17 +72,17 @@ static void Fail(const wchar_t *fmt, ...
  *
  * @aPathBuffer Buffer to fill
  */
 static bool GetModulePath(CStringW& aPathBuffer)
 {
   WCHAR buffer[MAX_PATH];
   memset(buffer, 0, sizeof(buffer));
 
-  if (!GetModuleFileName(nullptr, buffer, MAX_PATH)) {
+  if (!GetModuleFileName(NULL, buffer, MAX_PATH)) {
     Fail(L"GetModuleFileName failed.");
     return false;
   }
 
   WCHAR* slash = wcsrchr(buffer, '\\');
   if (!slash)
     return false;
   *slash = '\0';
@@ -127,17 +127,17 @@ static bool GetDefaultBrowserAppModelID(
                     0, KEY_READ, &key) != ERROR_SUCCESS) {
     if (RegOpenKeyExW(HKEY_CLASSES_ROOT, kDemoMetroBrowserIDPathKey,
                       0, KEY_READ, &key) != ERROR_SUCCESS) {
       return false;
     }
   }
   DWORD len = aCharLength * sizeof(WCHAR);
   memset(aIDBuffer, 0, len);
-  if (RegQueryValueExW(key, L"AppUserModelID", nullptr, nullptr,
+  if (RegQueryValueExW(key, L"AppUserModelID", NULL, NULL,
                        (LPBYTE)aIDBuffer, &len) != ERROR_SUCCESS || !len) {
     RegCloseKey(key);
     return false;
   }
   RegCloseKey(key);
   return true;
 }
 
@@ -167,17 +167,17 @@ static void AddConsoleIdToParams()
 static bool Launch()
 {
   Log(L"Launching browser...");
 
   DWORD processID;
 
   // The interface that allows us to activate the browser
   CComPtr<IApplicationActivationManager> activateMgr;
-  if (FAILED(CoCreateInstance(CLSID_ApplicationActivationManager, nullptr,
+  if (FAILED(CoCreateInstance(CLSID_ApplicationActivationManager, NULL,
                               CLSCTX_LOCAL_SERVER,
                               IID_IApplicationActivationManager,
                               (void**)&activateMgr))) {
     Fail(L"CoCreateInstance CLSID_ApplicationActivationManager failed.");
     return false;
   }
   
   HRESULT hr;
@@ -186,17 +186,17 @@ static bool Launch()
   if (!GetDefaultBrowserAppModelID(appModelID, (sizeof(appModelID)/sizeof(WCHAR)))) {
     Fail(L"GetDefaultBrowserAppModelID failed.");
     return false;
   }
   Log(L"App model id='%s'", appModelID);
 
   // Hand off focus rights to the out-of-process activation server. Without
   // this the metro interface won't launch.
-  hr = CoAllowSetForegroundWindow(activateMgr, nullptr);
+  hr = CoAllowSetForegroundWindow(activateMgr, NULL);
   if (FAILED(hr)) {
     Fail(L"CoAllowSetForegroundWindow result %X", hr);
     return false;
   }
 
   Log(L"Harness process id: %d", GetCurrentProcessId());
 
   // Because we can't pass command line args, we store params in a
@@ -210,43 +210,43 @@ static bool Launch()
       return false;
     }
     testFilePath = sFirefoxPath.Mid(0, index);
     testFilePath += "\\";
     testFilePath += kMetroTestFile;
   } else {
     // Use the module path
     char path[MAX_PATH];
-    if (!GetModuleFileNameA(nullptr, path, MAX_PATH)) {
+    if (!GetModuleFileNameA(NULL, path, MAX_PATH)) {
       Fail(L"GetModuleFileNameA errorno=%d", GetLastError());
       return false;
     }
     char* slash = strrchr(path, '\\');
     if (!slash)
       return false;
     *slash = '\0'; // no trailing slash
     testFilePath = path;
     testFilePath += "\\";
     testFilePath += kMetroTestFile;
   }
 
   Log(L"Writing out tests.ini to: '%s'", CStringW(testFilePath));
   HANDLE hTestFile = CreateFileA(testFilePath, GENERIC_WRITE,
-                                 0, nullptr, CREATE_ALWAYS,
+                                 0, NULL, CREATE_ALWAYS,
                                  FILE_ATTRIBUTE_NORMAL,
-                                 nullptr);
+                                 NULL);
   if (hTestFile == INVALID_HANDLE_VALUE) {
     Fail(L"CreateFileA errorno=%d", GetLastError());
     return false;
   }
 
   DeleteTestFileHelper dtf(testFilePath);
 
   CStringA asciiParams = sAppParams;
-  if (!WriteFile(hTestFile, asciiParams, asciiParams.GetLength(), nullptr, 0)) {
+  if (!WriteFile(hTestFile, asciiParams, asciiParams.GetLength(), NULL, 0)) {
     CloseHandle(hTestFile);
     Fail(L"WriteFile errorno=%d", GetLastError());
     return false;
   }
   FlushFileBuffers(hTestFile);
   CloseHandle(hTestFile);
 
   // Launch firefox
@@ -264,29 +264,29 @@ static bool Launch()
     return false;
   }
 
   Log(L"Waiting on child process...");
 
   MSG msg;
   DWORD waitResult = WAIT_TIMEOUT;
   while ((waitResult = WaitForSingleObject(child, 10)) != WAIT_OBJECT_0) {
-    if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) {
+    if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
       TranslateMessage(&msg);
       DispatchMessage(&msg);
     }
   }
 
   Log(L"Exiting.");
   return true;
 }
 
 int wmain(int argc, WCHAR* argv[])
 {
-  CoInitialize(nullptr);
+  CoInitialize(NULL);
 
   int idx;
   bool firefoxParam = false;
   for (idx = 1; idx < argc; idx++) {
     CString param = argv[idx];
     param.Trim();
 
     // Pickup the firefox path param and store it, we'll need this