Skip to content
Permalink
Browse files
Make generic MainThreadSharedTimer implementation
https://bugs.webkit.org/show_bug.cgi?id=191327

Reviewed by Michael Catanzaro.

No new tests. No change in behavior.

Moves generic implementation for MainThreadSharedTimerGlib.cpp into
MainThreadSharedTimer.cpp.

* platform/MainThreadSharedTimer.cpp:
(WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
(WebCore::MainThreadSharedTimer::setFireInterval):
(WebCore::MainThreadSharedTimer::stop):
(WebCore::MainThreadSharedTimer::invalidate):
* platform/MainThreadSharedTimer.h:
* platform/SourcesGLib.txt:
* platform/glib/MainThreadSharedTimerGLib.cpp: Removed.


Canonical link: https://commits.webkit.org/206169@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
donny-dont committed Nov 7, 2018
1 parent 3f54266 commit 7c2757a2a98b56a1a65d86cc51f589216f486890
@@ -1,3 +1,24 @@
2018-11-07 Don Olmstead <don.olmstead@sony.com>

Make generic MainThreadSharedTimer implementation
https://bugs.webkit.org/show_bug.cgi?id=191327

Reviewed by Michael Catanzaro.

No new tests. No change in behavior.

Moves generic implementation for MainThreadSharedTimerGlib.cpp into
MainThreadSharedTimer.cpp.

* platform/MainThreadSharedTimer.cpp:
(WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
(WebCore::MainThreadSharedTimer::setFireInterval):
(WebCore::MainThreadSharedTimer::stop):
(WebCore::MainThreadSharedTimer::invalidate):
* platform/MainThreadSharedTimer.h:
* platform/SourcesGLib.txt:
* platform/glib/MainThreadSharedTimerGLib.cpp: Removed.

2018-11-07 Ali Juma <ajuma@chromium.org>

IntersectionObserverEntry doesn't keep JS wrappers of rects alive
@@ -1,5 +1,8 @@
/*
* Copyright (C) 2006-2016 Apple Inc. All rights reserved.
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
* Copyright (C) 2015 Igalia S.L.
* Copyright (C) 2018 Sony Interactive Entertainment.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,6 +31,10 @@

#include <wtf/NeverDestroyed.h>

#if USE(GLIB)
#include <wtf/glib/RunLoopSourcePriority.h>
#endif

namespace WebCore {

MainThreadSharedTimer& MainThreadSharedTimer::singleton()
@@ -36,8 +43,30 @@ MainThreadSharedTimer& MainThreadSharedTimer::singleton()
return instance;
}

#if !PLATFORM(GTK) && !PLATFORM(WPE)
#if USE(CF) || OS(WINDOWS)
MainThreadSharedTimer::MainThreadSharedTimer() = default;
#else
MainThreadSharedTimer::MainThreadSharedTimer()
: m_timer(RunLoop::main(), this, &MainThreadSharedTimer::fired)
{
#if USE(GLIB)
m_timer.setPriority(RunLoopSourcePriority::MainThreadDispatcherTimer);
m_timer.setName("[WebKit] MainThreadDispatcherTimer");
#endif
}

void MainThreadSharedTimer::setFireInterval(Seconds interval)
{
ASSERT(m_firedFunction);
m_timer.startOneShot(interval);
}

void MainThreadSharedTimer::stop()
{
m_timer.stop();
}

void MainThreadSharedTimer::invalidate()
{
}
#endif
@@ -29,7 +29,7 @@
#include "SharedTimer.h"
#include <wtf/Forward.h>

#if PLATFORM(GTK) || PLATFORM(WPE)
#if !USE(CF) && !OS(WINDOWS)
#include <wtf/RunLoop.h>
#endif

@@ -53,7 +53,7 @@ class MainThreadSharedTimer final : public SharedTimer {
MainThreadSharedTimer();

WTF::Function<void()> m_firedFunction;
#if PLATFORM(GTK) || PLATFORM(WPE)
#if !USE(CF) && !OS(WINDOWS)
RunLoop::Timer<MainThreadSharedTimer> m_timer;
#endif
};
@@ -29,7 +29,6 @@ platform/glib/FileSystemGlib.cpp
platform/glib/KeyedDecoderGlib.cpp
platform/glib/KeyedEncoderGlib.cpp
platform/glib/LowPowerModeNotifierGLib.cpp
platform/glib/MainThreadSharedTimerGLib.cpp
platform/glib/SSLKeyGeneratorGLib.cpp
platform/glib/SharedBufferGlib.cpp
platform/glib/UserAgentGLib.cpp

This file was deleted.

0 comments on commit 7c2757a

Please sign in to comment.