Merge inbound to mozilla-central a=merge

This commit is contained in:
arthur.iakab 2019-02-03 11:51:35 +02:00
Родитель f44b229914 5710e8d965
Коммит 60c4067b1c
4 изменённых файлов: 36 добавлений и 3 удалений

Просмотреть файл

@ -788,6 +788,9 @@ nsresult nsPresContext::Init(nsDeviceContext* aDeviceContext) {
if (!mRefreshDriver) {
mRefreshDriver = new nsRefreshDriver(this);
if (XRE_IsContentProcess()) {
mRefreshDriver->InitializeTimer();
}
}
}

Просмотреть файл

@ -424,6 +424,12 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
// Schedule a refresh so that any delayed events will run soon.
void RunDelayedEventsSoon();
void InitializeTimer()
{
MOZ_ASSERT(!mActiveTimer);
EnsureTimerStarted();
}
private:
typedef nsTObserverArray<nsARefreshObserver*> ObserverArray;
typedef nsTArray<RefPtr<VVPResizeEvent>> VisualViewportResizeEventArray;

Просмотреть файл

@ -636,8 +636,13 @@ static void ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *appDir,
// execv on Windows.
if (restart) {
exit(execv(updaterPath.get(), argv));
} else {
*outpid = PR_CreateProcess(updaterPath.get(), argv, nullptr, nullptr);
}
*outpid = fork();
if (*outpid == -1) {
delete[] argv;
return;
} else if (*outpid == 0) {
exit(execv(updaterPath.get(), argv));
}
delete[] argv;
#elif defined(XP_WIN)
@ -702,6 +707,25 @@ static bool ProcessHasTerminated(ProcessType pt) {
#elif defined(XP_MACOSX)
// We're waiting for the process to terminate in LaunchChildMac.
return true;
#elif defined(XP_UNIX)
int exitStatus;
pid_t exited = waitpid(pt, &exitStatus, WNOHANG);
if (exited == 0) {
// Process is still running.
sleep(1);
return false;
}
if (exited == -1) {
LOG(("Error while checking if the updater process is finished"));
// This shouldn't happen, but if it does, the updater process is lost to us,
// so the best we can do is pretend that it's exited.
return true;
}
// If we get here, the process has exited; make sure it exited normally.
if (WIFEXITED(exitStatus) && (WEXITSTATUS(exitStatus) != 0)) {
LOG(("Error while running the updater process, check update.log"));
}
return true;
#else
// No way to have a non-blocking implementation on these platforms,
// because we're using NSPR and it only provides a blocking wait.

Просмотреть файл

@ -19,7 +19,7 @@ class nsIFile;
#if defined(XP_WIN)
# include <windows.h>
typedef HANDLE ProcessType;
#elif defined(XP_MACOSX)
#elif defined(XP_UNIX)
typedef pid_t ProcessType;
#else
# include "prproces.h"