Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (208328 => 208329)
--- trunk/Source/WebCore/CMakeLists.txt 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/CMakeLists.txt 2016-11-03 16:34:33 UTC (rev 208329)
@@ -2049,7 +2049,6 @@
page/PageOverlay.cpp
page/PageOverlayController.cpp
page/PageSerializer.cpp
- page/PageThrottler.cpp
page/PageVisibilityState.cpp
page/Performance.cpp
page/PerformanceEntry.cpp
Modified: trunk/Source/WebCore/ChangeLog (208328 => 208329)
--- trunk/Source/WebCore/ChangeLog 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/ChangeLog 2016-11-03 16:34:33 UTC (rev 208329)
@@ -1,3 +1,33 @@
+2016-11-01 Gavin Barraclough <barraclo...@apple.com>
+
+ Remove PageThrottler & all related code
+ https://bugs.webkit.org/show_bug.cgi?id=164302
+
+ Reviewed by Ryosuke Niwa.
+
+ All relevant information now available from the ActivityState.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::setMuted):
+ (WebCore::HTMLMediaElement::updateVolume):
+ (WebCore::HTMLMediaElement::updatePlayState):
+ (WebCore::HTMLMediaElement::updateAudioAssertionState): Deleted.
+ * html/HTMLMediaElement.h:
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::completed):
+ (WebCore::FrameLoader::started):
+ * loader/FrameLoader.h:
+ * page/ChromeClient.h:
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+ * page/Page.h:
+ (WebCore::Page::pageActivityStateChanged): Deleted.
+ (WebCore::Page::pageThrottler): Deleted.
+ * page/PageThrottler.cpp: Removed.
+ * page/PageThrottler.h: Removed.
+
2016-11-03 Dan Bernstein <m...@apple.com>
REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (208328 => 208329)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-11-03 16:34:33 UTC (rev 208329)
@@ -3957,8 +3957,6 @@
A715E653134BBBEC00D8E713 /* ProgressShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */; };
A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; };
A71878900B2D04AC00A16ECE /* DragControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */; };
- A7197F24175689C4007B9442 /* PageThrottler.h in Headers */ = {isa = PBXBuildFile; fileRef = A7197F23175689C4007B9442 /* PageThrottler.h */; settings = {ATTRIBUTES = (Private, ); }; };
- A7197F2617568AE5007B9442 /* PageThrottler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7197F2517568AE5007B9442 /* PageThrottler.cpp */; };
A723F77B1484CA4C008C6DBE /* PlatformExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A723F77A1484CA4C008C6DBE /* PlatformExportMacros.h */; settings = {ATTRIBUTES = (Private, ); }; };
A72763BF16689BFB002FCACB /* UserActionElementSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A72763BE16689BFB002FCACB /* UserActionElementSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
A73F95FE12C97BFE0031AAF9 /* RoundedRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73F95FC12C97BFE0031AAF9 /* RoundedRect.cpp */; };
@@ -11486,8 +11484,6 @@
A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgressShadowElement.h; sourceTree = "<group>"; };
A718760D0B2A120100A16ECE /* DragActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragActions.h; sourceTree = "<group>"; };
A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragControllerMac.mm; sourceTree = "<group>"; };
- A7197F23175689C4007B9442 /* PageThrottler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageThrottler.h; sourceTree = "<group>"; };
- A7197F2517568AE5007B9442 /* PageThrottler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageThrottler.cpp; sourceTree = "<group>"; };
A71A70C911AFB02000989D6D /* HTMLMeterElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLMeterElement.idl; sourceTree = "<group>"; };
A723F77A1484CA4C008C6DBE /* PlatformExportMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformExportMacros.h; sourceTree = "<group>"; };
A72763BE16689BFB002FCACB /* UserActionElementSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserActionElementSet.h; sourceTree = "<group>"; };
@@ -17743,8 +17739,6 @@
2D5C9CFE19C7B52E00B3C5C1 /* PageOverlayController.h */,
371E65CD13661EED00BEEDB0 /* PageSerializer.cpp */,
371E65CB13661EDC00BEEDB0 /* PageSerializer.h */,
- A7197F2517568AE5007B9442 /* PageThrottler.cpp */,
- A7197F23175689C4007B9442 /* PageThrottler.h */,
FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */,
FFD5B978135CC97800D5E92A /* PageVisibilityState.h */,
E526AF3E1727F8F200E41781 /* Performance.cpp */,
@@ -26638,7 +26632,6 @@
F3820895147D35F90010BC06 /* PageRuntimeAgent.h in Headers */,
A5F36D3B18F758720054C024 /* PageScriptDebugServer.h in Headers */,
371E65CC13661EDC00BEEDB0 /* PageSerializer.h in Headers */,
- A7197F24175689C4007B9442 /* PageThrottler.h in Headers */,
E1284AE110447D4500EAEB52 /* PageTransitionEvent.h in Headers */,
51E1ECC30C91C90400DC255B /* PageURLRecord.h in Headers */,
FFD5B97B135CC97800D5E92A /* PageVisibilityState.h in Headers */,
@@ -30363,7 +30356,6 @@
F3820894147D35F90010BC06 /* PageRuntimeAgent.cpp in Sources */,
A5F36D3A18F758720054C024 /* PageScriptDebugServer.cpp in Sources */,
371E65CE13661EED00BEEDB0 /* PageSerializer.cpp in Sources */,
- A7197F2617568AE5007B9442 /* PageThrottler.cpp in Sources */,
E1284AEA10447DEE00EAEB52 /* PageTransitionEvent.cpp in Sources */,
51E1ECC20C91C90400DC255B /* PageURLRecord.cpp in Sources */,
FFD5B97A135CC97800D5E92A /* PageVisibilityState.cpp in Sources */,
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (208328 => 208329)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -74,7 +74,6 @@
#include "NoEventDispatchAssertion.h"
#include "Page.h"
#include "PageGroup.h"
-#include "PageThrottler.h"
#include "PlatformMediaSessionManager.h"
#include "ProgressTracker.h"
#include "RenderLayerCompositor.h"
@@ -3276,7 +3275,6 @@
}
scheduleUpdatePlaybackControlsManager();
- updateAudioAssertionState();
}
void HTMLMediaElement::togglePlayState()
@@ -4791,8 +4789,6 @@
if (hasMediaControls())
mediaControls()->changedVolume();
#endif
-
- updateAudioAssertionState();
}
void HTMLMediaElement::updatePlayState(UpdateState updateState)
@@ -4812,7 +4808,6 @@
m_playbackProgressTimer.stop();
if (hasMediaControls())
mediaControls()->playbackStopped();
- updateAudioAssertionState();
return;
}
@@ -4878,8 +4873,6 @@
m_hasEverHadAudio |= hasAudio();
m_hasEverHadVideo |= hasVideo();
-
- updateAudioAssertionState();
}
void HTMLMediaElement::setPlaying(bool playing)
@@ -6947,42 +6940,6 @@
return muted() || (document().page() && document().page()->isAudioMuted());
}
-void HTMLMediaElement::updateAudioAssertionState()
-{
- auto* page = document().page();
- if (!page) {
- m_audioActivityToken = nullptr;
- return;
- }
-
-#define RELEASE_AUDIO_TOKEN(REASON) \
- RELEASE_LOG_IF(page->isAlwaysOnLoggingAllowed() && m_audioActivityToken, Media, "%p - HTMLMediaElement releases audio activity token, reason: " REASON, this); \
- m_audioActivityToken = nullptr
-
- if (!hasAudio()) {
- RELEASE_AUDIO_TOKEN("No audio");
- return;
- }
- if (!isPlaying()) {
- RELEASE_AUDIO_TOKEN("Not playing");
- return;
- }
- if (effectiveMuted()) {
- RELEASE_AUDIO_TOKEN("Audio is muted");
- return;
- }
- if (!volume()) {
- RELEASE_AUDIO_TOKEN("Volume is 0");
- return;
- }
- if (!m_audioActivityToken) {
- RELEASE_LOG_IF(page->isAlwaysOnLoggingAllowed(), Media, "%p - HTMLMediaElement takes audio activity token because there is audible audio", this);
- m_audioActivityToken = page->pageThrottler().mediaActivityToken();
- }
-
-#undef RELEASE_AUDIO_TOKEN
-}
-
bool HTMLMediaElement::doesHaveAttribute(const AtomicString& attribute, AtomicString* value) const
{
QualifiedName attributeName(nullAtom, attribute, nullAtom);
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (208328 => 208329)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -37,7 +37,6 @@
#include "MediaControllerInterface.h"
#include "MediaElementSession.h"
#include "MediaProducer.h"
-#include "PageThrottler.h"
#include "UserInterfaceLayoutDirection.h"
#if ENABLE(VIDEO_TRACK)
@@ -771,8 +770,6 @@
bool effectiveMuted() const;
- void updateAudioAssertionState();
-
void registerWithDocument(Document&);
void unregisterWithDocument(Document&);
@@ -1007,7 +1004,6 @@
#endif
std::unique_ptr<MediaElementSession> m_mediaSession;
- PageActivityAssertionToken m_audioActivityToken;
size_t m_reportedExtraMemoryCost { 0 };
#if ENABLE(MEDIA_CONTROLS_SCRIPT)
Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (208328 => 208329)
--- trunk/Source/WebCore/loader/FrameLoader.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -87,7 +87,6 @@
#include "MemoryCache.h"
#include "Page.h"
#include "PageCache.h"
-#include "PageThrottler.h"
#include "PageTransitionEvent.h"
#include "PlatformStrategies.h"
#include "PluginData.h"
@@ -1078,13 +1077,10 @@
if (m_frame.view())
m_frame.view()->maintainScrollPositionAtAnchor(nullptr);
- m_activityAssertion = nullptr;
}
void FrameLoader::started()
{
- if (m_frame.page())
- m_activityAssertion = m_frame.page()->pageThrottler().pageLoadActivityToken();
for (Frame* frame = &m_frame; frame; frame = frame->tree().parent())
frame->loader().m_isComplete = false;
}
Modified: trunk/Source/WebCore/loader/FrameLoader.h (208328 => 208329)
--- trunk/Source/WebCore/loader/FrameLoader.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/loader/FrameLoader.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -36,7 +36,6 @@
#include "FrameLoaderTypes.h"
#include "LayoutMilestones.h"
#include "MixedContentChecker.h"
-#include "PageThrottler.h"
#include "ResourceHandleTypes.h"
#include "ResourceLoadNotifier.h"
#include "ResourceLoaderOptions.h"
@@ -459,7 +458,6 @@
URL m_previousURL;
RefPtr<HistoryItem> m_requestedHistoryItem;
- PageActivityAssertionToken m_activityAssertion;
};
// This function is called by createWindow() in JSDOMWindowBase.cpp, for example, for
Modified: trunk/Source/WebCore/page/ChromeClient.h (208328 => 208329)
--- trunk/Source/WebCore/page/ChromeClient.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/page/ChromeClient.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -32,7 +32,6 @@
#include "HostWindow.h"
#include "LayerFlushThrottleState.h"
#include "MediaProducer.h"
-#include "PageThrottler.h"
#include "PopupMenu.h"
#include "PopupMenuClient.h"
#include "RenderEmbeddedObject.h"
Modified: trunk/Source/WebCore/page/Page.cpp (208328 => 208329)
--- trunk/Source/WebCore/page/Page.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/page/Page.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -67,7 +67,6 @@
#include "PageDebuggable.h"
#include "PageGroup.h"
#include "PageOverlayController.h"
-#include "PageThrottler.h"
#include "PlatformMediaSessionManager.h"
#include "PlugInClient.h"
#include "PluginData.h"
@@ -224,7 +223,6 @@
#endif
, m_alternativeTextClient(pageConfiguration.alternativeTextClient)
, m_scriptedAnimationsSuspended(false)
- , m_pageThrottler(*this)
, m_consoleClient(std::make_unique<PageConsoleClient>(*this))
#if ENABLE(REMOTE_INSPECTOR)
, m_inspectorDebuggable(std::make_unique<PageDebuggable>(*this))
Modified: trunk/Source/WebCore/page/Page.h (208328 => 208329)
--- trunk/Source/WebCore/page/Page.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/page/Page.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -26,7 +26,6 @@
#include "LayoutMilestones.h"
#include "LayoutRect.h"
#include "MediaProducer.h"
-#include "PageThrottler.h"
#include "PageVisibilityState.h"
#include "Pagination.h"
#include "PlatformScreen.h"
@@ -34,6 +33,7 @@
#include "ScrollTypes.h"
#include "SessionID.h"
#include "Supplementable.h"
+#include "Timer.h"
#include "UserInterfaceLayoutDirection.h"
#include "ViewportArguments.h"
#include "WheelEventTestTrigger.h"
@@ -104,7 +104,6 @@
class PageConsoleClient;
class PageDebuggable;
class PageGroup;
-class PageThrottler;
class PlugInClient;
class PluginData;
class PluginInfoProvider;
@@ -137,7 +136,6 @@
WTF_MAKE_NONCOPYABLE(Page);
WTF_MAKE_FAST_ALLOCATED;
friend class Settings;
- friend class PageThrottler;
public:
WEBCORE_EXPORT static void updateStyleForAllPagesAfterGlobalChangeInEnvironment();
@@ -336,7 +334,6 @@
// Notifications when the Page starts and stops being presented via a native window.
WEBCORE_EXPORT void setActivityState(ActivityState::Flags);
bool isVisibleAndActive() const;
- void pageActivityStateChanged() { }
WEBCORE_EXPORT void setIsVisible(bool);
WEBCORE_EXPORT void setIsPrerender();
bool isVisible() const { return m_activityState & ActivityState::IsVisible; }
@@ -437,8 +434,6 @@
void sawMediaEngine(const String& engineName);
void resetSeenMediaEngines();
- PageThrottler& pageThrottler() { return m_pageThrottler; }
-
PageConsoleClient& console() { return *m_consoleClient; }
#if ENABLE(REMOTE_INSPECTOR)
@@ -667,7 +662,6 @@
bool m_isEditable;
bool m_isPrerender;
ActivityState::Flags m_activityState;
- PageActivityState::Flags m_pageActivityState;
LayoutMilestones m_requestedLayoutMilestones;
@@ -685,7 +679,6 @@
AlternativeTextClient* m_alternativeTextClient;
bool m_scriptedAnimationsSuspended;
- PageThrottler m_pageThrottler;
const std::unique_ptr<PageConsoleClient> m_consoleClient;
#if ENABLE(REMOTE_INSPECTOR)
Deleted: trunk/Source/WebCore/page/PageThrottler.cpp (208328 => 208329)
--- trunk/Source/WebCore/page/PageThrottler.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/page/PageThrottler.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "PageThrottler.h"
-
-#include "Page.h"
-
-namespace WebCore {
-
-static const double PageLoadHysteresisSeconds = 10;
-
-PageThrottler::PageThrottler(Page& page)
- : m_page(page)
- , m_mediaActivityHysteresis([this](HysteresisState state) { setActivityFlag(PageActivityState::MediaActivity, state == HysteresisState::Started); })
- , m_pageLoadActivityHysteresis([this](HysteresisState state) { setActivityFlag(PageActivityState::PageLoadActivity, state == HysteresisState::Started); }, PageLoadHysteresisSeconds)
- , m_mediaActivityCounter([this](RefCounterEvent) { mediaActivityCounterChanged(); })
- , m_pageLoadActivityCounter([this](RefCounterEvent) { pageLoadActivityCounterChanged(); })
-{
-}
-
-PageActivityAssertionToken PageThrottler::mediaActivityToken()
-{
- return m_mediaActivityCounter.count();
-}
-
-PageActivityAssertionToken PageThrottler::pageLoadActivityToken()
-{
- return m_pageLoadActivityCounter.count();
-}
-
-void PageThrottler::mediaActivityCounterChanged()
-{
- if (m_mediaActivityCounter.value())
- m_mediaActivityHysteresis.start();
- else
- m_mediaActivityHysteresis.stop();
-}
-
-void PageThrottler::pageLoadActivityCounterChanged()
-{
- if (m_pageLoadActivityCounter.value())
- m_pageLoadActivityHysteresis.start();
- else
- m_pageLoadActivityHysteresis.stop();
-}
-
-void PageThrottler::setActivityFlag(PageActivityState::Flags flag, bool value)
-{
- PageActivityState::Flags activityState = m_activityState;
- if (value)
- activityState |= flag;
- else
- activityState &= ~flag;
-
- if (m_activityState == activityState)
- return;
- m_activityState = activityState;
-
- m_page.pageActivityStateChanged();
-}
-
-}
Deleted: trunk/Source/WebCore/page/PageThrottler.h (208328 => 208329)
--- trunk/Source/WebCore/page/PageThrottler.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebCore/page/PageThrottler.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "ActivityState.h"
-#include "Timer.h"
-#include "UserActivity.h"
-#include <wtf/RefCounter.h>
-
-namespace WebCore {
-
-class Page;
-
-enum PageActivityCounterType { };
-typedef RefCounter<PageActivityCounterType> PageActivityCounter;
-typedef PageActivityCounter::Token PageActivityAssertionToken;
-
-struct PageActivityState {
- enum {
- MediaActivity = 1 << 0,
- PageLoadActivity = 1 << 1,
- };
-
- typedef unsigned Flags;
-
- static const Flags NoFlags = 0;
- static const Flags AllFlags = MediaActivity | PageLoadActivity;
-};
-
-class PageThrottler {
- WTF_MAKE_FAST_ALLOCATED;
-public:
- PageThrottler(Page&);
-
- PageActivityState::Flags activityState() { return m_activityState; }
- void pluginDidEvaluateWhileAudioIsPlaying() { m_mediaActivityHysteresis.impulse(); }
- PageActivityAssertionToken mediaActivityToken();
- PageActivityAssertionToken pageLoadActivityToken();
-
-private:
- void mediaActivityCounterChanged();
- void pageLoadActivityCounterChanged();
- void setActivityFlag(PageActivityState::Flags, bool);
-
- Page& m_page;
- PageActivityState::Flags m_activityState { PageActivityState::NoFlags };
- HysteresisActivity m_mediaActivityHysteresis;
- HysteresisActivity m_pageLoadActivityHysteresis;
- PageActivityCounter m_mediaActivityCounter;
- PageActivityCounter m_pageLoadActivityCounter;
-};
-
-} // namespace WebCore
Modified: trunk/Source/WebKit2/ChangeLog (208328 => 208329)
--- trunk/Source/WebKit2/ChangeLog 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/ChangeLog 2016-11-03 16:34:33 UTC (rev 208329)
@@ -1,3 +1,44 @@
+2016-11-01 Gavin Barraclough <barraclo...@apple.com>
+
+ Remove PageThrottler & all related code
+ https://bugs.webkit.org/show_bug.cgi?id=164302
+
+ Reviewed by Ryosuke Niwa.
+
+ All relevant information now available from the ActivityState.
+
+ * PluginProcess/PluginProcess.cpp:
+ (WebKit::PluginProcess::PluginProcess):
+ (WebKit::PluginProcess::createWebProcessConnection):
+ (WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted.
+ (WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted.
+ * PluginProcess/PluginProcess.h:
+ (): Deleted.
+ * PluginProcess/WebProcessConnection.cpp:
+ (WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted.
+ (WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted.
+ * PluginProcess/WebProcessConnection.h:
+ * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
+ (WebKit::NPRuntimeObjectMap::evaluate):
+ * WebProcess/Plugins/Plugin.h:
+ (WebKit::Plugin::audioHardwareActivity): Deleted.
+ * WebProcess/Plugins/PluginProcessConnection.cpp:
+ (WebKit::PluginProcessConnection::PluginProcessConnection):
+ (WebKit::PluginProcessConnection::didReceiveMessage):
+ (WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted.
+ (WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted.
+ * WebProcess/Plugins/PluginProcessConnection.h:
+ (WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization):
+ (WebKit::PluginProcessConnection::audioHardwareActivity): Deleted.
+ * WebProcess/Plugins/PluginProcessConnection.messages.in:
+ * WebProcess/Plugins/PluginProxy.cpp:
+ (WebKit::PluginProxy::audioHardwareActivity): Deleted.
+ * WebProcess/Plugins/PluginProxy.h:
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::audioHardwareActivity): Deleted.
+ * WebProcess/Plugins/PluginView.h:
+ * WebProcess/WebPage/WebPage.cpp:
+
2016-11-03 Dan Bernstein <m...@apple.com>
REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
Modified: trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp (208328 => 208329)
--- trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -60,7 +60,6 @@
, m_connectionActivity("PluginProcess connection activity.")
{
NetscapePlugin::setSetExceptionFunction(WebProcessConnection::setGlobalException);
- m_audioHardwareListener = AudioHardwareListener::create(*this);
}
PluginProcess::~PluginProcess()
@@ -168,13 +167,6 @@
// Create a listening connection.
auto connection = WebProcessConnection::create(IPC::Connection::Identifier(listeningPort));
- if (m_audioHardwareListener) {
- if (m_audioHardwareListener->hardwareActivity() == WebCore::AudioHardwareActivityType::IsActive)
- connection->audioHardwareDidBecomeActive();
- else if (m_audioHardwareListener->hardwareActivity() == WebCore::AudioHardwareActivityType::IsInactive)
- connection->audioHardwareDidBecomeInactive();
- }
-
m_webProcessConnections.append(WTFMove(connection));
IPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND);
@@ -253,18 +245,6 @@
}
#endif
-void PluginProcess::audioHardwareDidBecomeActive()
-{
- for (auto& connection : m_webProcessConnections)
- connection->audioHardwareDidBecomeActive();
-}
-
-void PluginProcess::audioHardwareDidBecomeInactive()
-{
- for (auto& connection : m_webProcessConnections)
- connection->audioHardwareDidBecomeInactive();
-}
-
} // namespace WebKit
#endif // ENABLE(NETSCAPE_PLUGIN_API)
Modified: trunk/Source/WebKit2/PluginProcess/PluginProcess.h (208328 => 208329)
--- trunk/Source/WebKit2/PluginProcess/PluginProcess.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/PluginProcess/PluginProcess.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -30,7 +30,6 @@
#include "ChildProcess.h"
#include <WebCore/CountedUserActivity.h>
-#include <WebCore/AudioHardwareListener.h>
#include <wtf/Forward.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/text/WTFString.h>
@@ -45,7 +44,7 @@
class WebProcessConnection;
struct PluginProcessCreationParameters;
-class PluginProcess : public ChildProcess, private WebCore::AudioHardwareListener::Client
+class PluginProcess : public ChildProcess
{
WTF_MAKE_NONCOPYABLE(PluginProcess);
friend class NeverDestroyed<PluginProcess>;
@@ -101,11 +100,6 @@
void deleteWebsiteData(std::chrono::system_clock::time_point modifiedSince, uint64_t callbackID);
void deleteWebsiteDataForHostNames(const Vector<String>& hostNames, uint64_t callbackID);
- // AudioHardwareListenerClient
- void audioHardwareDidBecomeActive() override;
- void audioHardwareDidBecomeInactive() override;
- void audioOutputDeviceChanged() override { }
-
void platformInitializePluginProcess(PluginProcessCreationParameters&&);
void setMinimumLifetime(double);
@@ -135,8 +129,6 @@
#endif
CountedUserActivity m_connectionActivity;
-
- RefPtr<WebCore::AudioHardwareListener> m_audioHardwareListener;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/PluginProcess/WebProcessConnection.cpp (208328 => 208329)
--- trunk/Source/WebKit2/PluginProcess/WebProcessConnection.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/PluginProcess/WebProcessConnection.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -322,16 +322,6 @@
m_connection->sendSync(Messages::PluginProxy::DidCreatePlugin(wantsWheelEvents, remoteLayerClientID), Messages::PluginProxy::DidCreatePlugin::Reply(), creationParameters.pluginInstanceID);
}
-void WebProcessConnection::audioHardwareDidBecomeActive()
-{
- m_connection->send(Messages::PluginProcessConnection::AudioHardwareDidBecomeActive(), 0);
-}
-
-void WebProcessConnection::audioHardwareDidBecomeInactive()
-{
- m_connection->send(Messages::PluginProcessConnection::AudioHardwareDidBecomeInactive(), 0);
-}
-
} // namespace WebKit
#endif // ENABLE(NETSCAPE_PLUGIN_API)
Modified: trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h (208328 => 208329)
--- trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -54,9 +54,6 @@
static void setGlobalException(const String&);
- void audioHardwareDidBecomeActive();
- void audioHardwareDidBecomeInactive();
-
private:
WebProcessConnection(IPC::Connection::Identifier);
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp (208328 => 208329)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -42,7 +42,6 @@
#include <WebCore/DOMWrapperWorld.h>
#include <WebCore/Frame.h>
#include <WebCore/Page.h>
-#include <WebCore/PageThrottler.h>
#include <WebCore/ScriptController.h>
#include <wtf/NeverDestroyed.h>
@@ -189,15 +188,6 @@
if (!globalObject)
return false;
-#if PLATFORM(COCOA)
- if (m_pluginView && !m_pluginView->isBeingDestroyed()) {
- if (Page* page = m_pluginView->frame()->page()) {
- if (m_pluginView->audioHardwareActivity() != WebCore::AudioHardwareActivityType::IsInactive)
- page->pageThrottler().pluginDidEvaluateWhileAudioIsPlaying();
- }
- }
-#endif
-
ExecState* exec = globalObject->globalExec();
JSLockHolder lock(exec);
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h (208328 => 208329)
--- trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -26,7 +26,6 @@
#ifndef Plugin_h
#define Plugin_h
-#include <WebCore/AudioHardwareListener.h>
#include <WebCore/FindOptions.h>
#include <WebCore/GraphicsLayer.h>
#include <WebCore/URL.h>
@@ -293,8 +292,6 @@
virtual String getSelectionForWordAtPoint(const WebCore::FloatPoint&) const = 0;
virtual bool existingSelectionContainsPoint(const WebCore::FloatPoint&) const = 0;
- virtual WebCore::AudioHardwareActivityType audioHardwareActivity() const { return WebCore::AudioHardwareActivityType::Unknown; }
-
virtual void mutedStateChanged(bool) { }
virtual bool canCreateTransientPaintingSnapshot() const { return true; }
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp (208328 => 208329)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -46,7 +46,6 @@
: m_pluginProcessConnectionManager(pluginProcessConnectionManager)
, m_pluginProcessToken(pluginProcessToken)
, m_supportsAsynchronousPluginInitialization(supportsAsynchronousPluginInitialization)
- , m_audioHardwareActivity(WebCore::AudioHardwareActivityType::Unknown)
{
m_connection = IPC::Connection::createClientConnection(connectionIdentifier, *this);
@@ -91,11 +90,6 @@
void PluginProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
{
- if (!decoder.destinationID()) {
- didReceivePluginProcessConnectionMessage(connection, decoder);
- return;
- }
-
ASSERT(decoder.destinationID());
PluginProxy* pluginProxy = m_plugins.get(decoder.destinationID());
@@ -145,16 +139,6 @@
NPRuntimeObjectMap::setGlobalException(exceptionString);
}
-void PluginProcessConnection::audioHardwareDidBecomeActive()
-{
- m_audioHardwareActivity = WebCore::AudioHardwareActivityType::IsActive;
-}
-
-void PluginProcessConnection::audioHardwareDidBecomeInactive()
-{
- m_audioHardwareActivity = WebCore::AudioHardwareActivityType::IsInactive;
-}
-
} // namespace WebKit
#endif // ENABLE(NETSCAPE_PLUGIN_API)
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h (208328 => 208329)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -58,7 +58,6 @@
NPRemoteObjectMap* npRemoteObjectMap() const { return m_npRemoteObjectMap.get(); }
bool supportsAsynchronousPluginInitialization() const { return m_supportsAsynchronousPluginInitialization; }
- WebCore::AudioHardwareActivityType audioHardwareActivity() const { return m_audioHardwareActivity; }
private:
PluginProcessConnection(PluginProcessConnectionManager*, uint64_t pluginProcessToken, IPC::Connection::Identifier connectionIdentifier, bool supportsAsynchronousInitialization);
@@ -70,11 +69,8 @@
void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
// Message handlers.
- void didReceivePluginProcessConnectionMessage(IPC::Connection&, IPC::Decoder&);
void didReceiveSyncPluginProcessConnectionMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
void setException(const String&);
- void audioHardwareDidBecomeActive();
- void audioHardwareDidBecomeInactive();
PluginProcessConnectionManager* m_pluginProcessConnectionManager;
uint64_t m_pluginProcessToken;
@@ -88,7 +84,6 @@
RefPtr<NPRemoteObjectMap> m_npRemoteObjectMap;
bool m_supportsAsynchronousPluginInitialization;
- WebCore::AudioHardwareActivityType m_audioHardwareActivity;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.messages.in (208328 => 208329)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.messages.in 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.messages.in 2016-11-03 16:34:33 UTC (rev 208329)
@@ -25,10 +25,6 @@
messages -> PluginProcessConnection LegacyReceiver {
# Set a global _javascript_ exception.
SetException(String exceptionString) -> ()
-
- # Plugin process audio hardware state changed
- AudioHardwareDidBecomeActive()
- AudioHardwareDidBecomeInactive()
}
#endif
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp (208328 => 208329)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -740,13 +740,6 @@
return nullptr;
}
-#if PLATFORM(COCOA)
-WebCore::AudioHardwareActivityType PluginProxy::audioHardwareActivity() const
-{
- return m_connection->audioHardwareActivity();
-}
-#endif
-
} // namespace WebKit
#endif // ENABLE(NETSCAPE_PLUGIN_API)
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h (208328 => 208329)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -147,10 +147,6 @@
String getSelectionForWordAtPoint(const WebCore::FloatPoint&) const override { return String(); }
bool existingSelectionContainsPoint(const WebCore::FloatPoint&) const override { return false; }
-#if PLATFORM(COCOA)
- WebCore::AudioHardwareActivityType audioHardwareActivity() const override;
-#endif
-
float contentsScaleFactor();
bool needsBackingStore() const;
bool updateBackingStore();
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (208328 => 208329)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -59,7 +59,6 @@
#include <WebCore/NetscapePlugInStreamLoader.h>
#include <WebCore/NetworkingContext.h>
#include <WebCore/Page.h>
-#include <WebCore/PageThrottler.h>
#include <WebCore/PlatformMouseEvent.h>
#include <WebCore/ProtectionSpace.h>
#include <WebCore/ProxyServer.h>
@@ -546,19 +545,7 @@
m_plugin->windowFocusChanged(m_webPage->windowIsFocused());
}
-WebCore::AudioHardwareActivityType PluginView::audioHardwareActivity() const
-{
- if (!m_isInitialized || !m_plugin)
- return AudioHardwareActivityType::IsInactive;
-
#if PLATFORM(COCOA)
- return m_plugin->audioHardwareActivity();
-#else
- return AudioHardwareActivityType::Unknown;
-#endif
-}
-
-#if PLATFORM(COCOA)
void PluginView::setDeviceScaleFactor(float scaleFactor)
{
if (!m_isInitialized || !m_plugin)
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h (208328 => 208329)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h 2016-11-03 16:34:33 UTC (rev 208329)
@@ -116,7 +116,6 @@
bool performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
String getSelectionForWordAtPoint(const WebCore::FloatPoint&) const;
bool existingSelectionContainsPoint(const WebCore::FloatPoint&) const;
- WebCore::AudioHardwareActivityType audioHardwareActivity() const override;
private:
PluginView(PassRefPtr<WebCore::HTMLPlugInElement>, PassRefPtr<Plugin>, const Plugin::Parameters& parameters);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (208328 => 208329)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-11-03 16:19:48 UTC (rev 208328)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-11-03 16:34:33 UTC (rev 208329)
@@ -149,7 +149,6 @@
#include <WebCore/MouseEvent.h>
#include <WebCore/Page.h>
#include <WebCore/PageConfiguration.h>
-#include <WebCore/PageThrottler.h>
#include <WebCore/PlatformKeyboardEvent.h>
#include <WebCore/PluginDocument.h>
#include <WebCore/PointerLockController.h>