Changeset 209102 in webkit
- Timestamp:
- Nov 29, 2016, 5:00:12 PM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r209088 r209102 1 2016-11-29 Gavin Barraclough <barraclough@apple.com> 2 3 Remove WebPage::SetPageSuppressed 4 https://bugs.webkit.org/show_bug.cgi?id=165158 5 6 Reviewed by Tim Horton. 7 8 This was scaffolding. We've now refactored to the point that the information driving throttling originates 9 from the UI process (so UI and web processes can have a consistent view of what should throttle), but we 10 don't need a separate message to handle this - necessary state to determine is provided in ActivityState. 11 12 * UIProcess/WebPageProxy.cpp: 13 (WebKit::WebPageProxy::updateThrottleState): 14 - used to send SetPageSuppressed; no longer does. 15 * UIProcess/WebPageProxy.h: 16 - removed m_pageSuppressed (was used to avoid duplicated messages). 17 * WebProcess/WebPage/WebPage.cpp: 18 (WebKit::WebPage::updateThrottleState): 19 - compute throttle state based on m_activityState. 20 (WebKit::WebPage::setActivityState): 21 - update throttle state whenever activity state changes. 22 (WebKit::WebPage::updatePreferences): 23 - update throttle state whenever preferences change (throttling can be disabled via preference). 24 (WebKit::WebPage::setPageSuppressed): Deleted. 25 - Removed WebPage::SetPageSuppressed. 26 * WebProcess/WebPage/WebPage.h: 27 - Removed WebPage::SetPageSuppressed. 28 - Added m_processSuppressionEnabled, to cache preference state. 29 * WebProcess/WebPage/WebPage.messages.in: 30 - Removed WebPage::SetPageSuppressed. 31 1 32 2016-11-29 Andy Estes <aestes@apple.com> 2 33 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r209082 r209102 1610 1610 m_preventProcessSuppressionCount = nullptr; 1611 1611 1612 // We should suppress if the page is not active, is visually idle, and supression is enabled.1613 bool isLoading = m_activityState & ActivityState::IsLoading;1614 bool isPlayingAudio = m_activityState & ActivityState::IsAudible;1615 bool pageShouldBeSuppressed = !isLoading && !isPlayingAudio && processSuppressionEnabled && (m_activityState & ActivityState::IsVisuallyIdle);1616 if (m_pageSuppressed != pageShouldBeSuppressed) {1617 m_pageSuppressed = pageShouldBeSuppressed;1618 m_process->send(Messages::WebPage::SetPageSuppressed(m_pageSuppressed), m_pageID);1619 }1620 1621 1612 if (m_activityState & ActivityState::IsVisuallyIdle) 1622 1613 m_pageIsUserObservableCount = nullptr; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r209082 r209102 1764 1764 DownloadID m_syncNavigationActionPolicyDownloadID; 1765 1765 bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false }; 1766 bool m_pageSuppressed { false };1767 1766 1768 1767 Deque<NativeWebKeyboardEvent> m_keyEventQueue; -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r209057 r209102 1089 1089 762B748D120BC75C00819339 /* WKPreferencesRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 762B7484120BBA2D00819339 /* WKPreferencesRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1090 1090 7A5E394A1D5BD8BE00B4B7CE /* com.macromedia.Flash Player ESR.plugin.sb in Resources */ = {isa = PBXBuildFile; fileRef = 7A5E39491D5BD8A700B4B7CE /* com.macromedia.Flash Player ESR.plugin.sb */; }; 1091 7A772C8D1DDD4A25000F34F1 /* com.apple.WebKit.plugin-common.sb in Resources */ = {isa = PBXBuildFile; fileRef = 7A1506721DD56298001F4B58 /* com.apple.WebKit.plugin-common.sb */; };1091 7A772C8D1DDD4A25000F34F1 /* com.apple.WebKit.plugin-common.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7A1506721DD56298001F4B58 /* com.apple.WebKit.plugin-common.sb */; }; 1092 1092 7A791EFA1C7CFCF100C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */; }; 1093 1093 7A791EFB1C7CFD0100C4C52B /* WebResourceLoadStatisticsStoreMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */; }; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r208985 r209102 325 325 , m_layerVolatilityTimer(*this, &WebPage::layerVolatilityTimerFired) 326 326 , m_activityState(parameters.activityState) 327 , m_processSuppressionEnabled(true) 327 328 , m_userActivity("Process suppression disabled for page.") 328 329 , m_userActivityHysteresis([this](HysteresisState) { updateUserActivity(); }) … … 439 440 if (!isVisible()) 440 441 m_page->setIsPrerender(); 441 setPageSuppressed(false);442 442 443 443 updateIsInWindow(true); … … 526 526 } 527 527 528 void WebPage::setPageSuppressed(bool pageSuppressed) 529 { 528 void WebPage::updateThrottleState() 529 { 530 // We should suppress if the page is not active, is visually idle, and supression is enabled. 531 bool isLoading = m_activityState & ActivityState::IsLoading; 532 bool isPlayingAudio = m_activityState & ActivityState::IsAudible; 533 bool pageSuppressed = !isLoading && !isPlayingAudio && m_processSuppressionEnabled && (m_activityState & ActivityState::IsVisuallyIdle); 534 530 535 // The UserActivity keeps the processes runnable. So if the page should be suppressed, stop the activity. 531 536 // If the page should not be supressed, start it. … … 2545 2550 m_activityState = activityState; 2546 2551 2552 if (!changed) 2553 return; 2554 updateThrottleState(); 2555 2547 2556 m_page->setActivityState(activityState); 2548 2557 for (auto* pluginView : m_pluginViews) … … 3196 3205 #endif 3197 3206 3207 bool processSuppressionEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey()); 3208 if (m_processSuppressionEnabled != processSuppressionEnabled) { 3209 m_processSuppressionEnabled = processSuppressionEnabled; 3210 updateThrottleState(); 3211 } 3212 3198 3213 platformPreferencesDidChange(store); 3199 3214 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r208985 r209102 930 930 bool shouldDispatchFakeMouseMoveEvents() const { return m_shouldDispatchFakeMouseMoveEvents; } 931 931 932 void setPageSuppressed(bool);933 934 932 void postMessage(const String& messageName, API::Object* messageBody); 935 933 void postSynchronousMessageForTesting(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData); … … 979 977 WebPage(uint64_t pageID, const WebPageCreationParameters&); 980 978 979 void updateThrottleState(); 981 980 void updateUserActivity(); 982 981 … … 1491 1490 WebCore::ActivityState::Flags m_activityState; 1492 1491 1492 bool m_processSuppressionEnabled; 1493 1493 UserActivity m_userActivity; 1494 1494 WebCore::HysteresisActivity m_userActivityHysteresis; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r208985 r209102 25 25 SetActivityState(unsigned activityState, bool wantsDidUpdateActivityState, Vector<uint64_t> callbackIDs) 26 26 SetLayerHostingMode(enum WebKit::LayerHostingMode layerHostingMode) 27 SetPageSuppressed(bool pageSuppressed)28 27 29 28 SetDrawsBackground(bool drawsBackground)
Note:
See TracChangeset
for help on using the changeset viewer.