Bug 1373888 - part1 : remove useless function. r=cpearce,smaug

These functions didn't be used by anyone, remove them.

MozReview-Commit-ID: BLj8GsVp1gR

--HG--
extra : rebase_source : 1b7eee86c62314401c2374a2979ba2a42fda2490
This commit is contained in:
Alastor Wu 2017-08-29 10:54:18 +08:00
Родитель 5a0bb50ea8
Коммит f570c3c5ec
5 изменённых файлов: 6 добавлений и 37 удалений

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

@ -4172,13 +4172,6 @@ HTMLMediaElement::WakeLockBoolWrapper::~WakeLockBoolWrapper()
}
}
void
HTMLMediaElement::WakeLockBoolWrapper::SetCanPlay(bool aCanPlay)
{
mCanPlay = aCanPlay;
UpdateWakeLock();
}
void
HTMLMediaElement::WakeLockBoolWrapper::UpdateWakeLock()
{
@ -4188,7 +4181,7 @@ HTMLMediaElement::WakeLockBoolWrapper::UpdateWakeLock()
return;
}
bool playing = (!mValue && mCanPlay);
bool playing = !mValue;
if (playing) {
if (mTimer) {

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

@ -818,12 +818,13 @@ protected:
class WakeLockBoolWrapper {
public:
explicit WakeLockBoolWrapper(bool val = false)
: mValue(val), mCanPlay(true), mOuter(nullptr) {}
: mValue(val)
, mOuter(nullptr)
{}
~WakeLockBoolWrapper();
void SetOuter(HTMLMediaElement* outer) { mOuter = outer; }
void SetCanPlay(bool aCanPlay);
MOZ_IMPLICIT operator bool() const { return mValue; }
@ -837,7 +838,6 @@ protected:
void UpdateWakeLock();
bool mValue;
bool mCanPlay;
HTMLMediaElement* mOuter;
nsCOMPtr<nsITimer> mTimer;
};

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

@ -47,7 +47,6 @@ NS_IMPL_ELEMENT_CLONE(HTMLVideoElement)
HTMLVideoElement::HTMLVideoElement(already_AddRefed<NodeInfo>& aNodeInfo)
: HTMLMediaElement(aNodeInfo)
, mUseScreenWakeLock(true)
, mIsOrientationLocked(false)
{
}
@ -230,19 +229,6 @@ bool HTMLVideoElement::MozHasAudio() const
return HasAudio();
}
bool HTMLVideoElement::MozUseScreenWakeLock() const
{
MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
return mUseScreenWakeLock;
}
void HTMLVideoElement::SetMozUseScreenWakeLock(bool aValue)
{
MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
mUseScreenWakeLock = aValue;
UpdateScreenWakeLock();
}
JSObject*
HTMLVideoElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
@ -334,7 +320,7 @@ HTMLVideoElement::UpdateScreenWakeLock()
{
bool hidden = OwnerDoc()->Hidden();
if (mScreenWakeLock && (mPaused || hidden || !mUseScreenWakeLock)) {
if (mScreenWakeLock && (mPaused || hidden)) {
ErrorResult rv;
mScreenWakeLock->Unlock(rv);
rv.SuppressException();
@ -342,8 +328,7 @@ HTMLVideoElement::UpdateScreenWakeLock()
return;
}
if (!mScreenWakeLock && !mPaused && !hidden &&
mUseScreenWakeLock && HasVideo()) {
if (!mScreenWakeLock && !mPaused && !hidden && HasVideo()) {
RefPtr<power::PowerManagerService> pmService =
power::PowerManagerService::GetInstance();
NS_ENSURE_TRUE_VOID(pmService);

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

@ -129,10 +129,6 @@ public:
bool MozHasAudio() const;
bool MozUseScreenWakeLock() const;
void SetMozUseScreenWakeLock(bool aValue);
void NotifyOwnerDocumentActivityChanged() override;
// Gives access to the decoder's frame statistics, if present.
@ -165,7 +161,6 @@ protected:
virtual void WakeLockRelease() override;
void UpdateScreenWakeLock();
bool mUseScreenWakeLock;
RefPtr<WakeLock> mScreenWakeLock;
bool mIsOrientationLocked;

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

@ -46,10 +46,6 @@ partial interface HTMLVideoElement {
// True if the video has an audio track available.
readonly attribute boolean mozHasAudio;
// True if the video should use a screen wake lock.
[Pref="dom.wakelock.enabled", Func="Navigator::HasWakeLockSupport"]
attribute boolean mozUseScreenWakeLock;
// Attributes for builtin video controls to lock screen orientation.
// True if video controls should lock orientation when fullscreen.
[Pref="media.videocontrols.lock-video-orientation", Func="IsChromeOrXBL"]