Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.h

Issue 2471153002: [scheduler] Use Finch to control background throttling. (Closed)
Patch Set: Address skyostil@'s comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 class WebPlugin; 93 class WebPlugin;
94 class WebRemoteFrame; 94 class WebRemoteFrame;
95 class WebSettingsImpl; 95 class WebSettingsImpl;
96 class WebViewScheduler; 96 class WebViewScheduler;
97 97
98 class WEB_EXPORT WebViewImpl final 98 class WEB_EXPORT WebViewImpl final
99 : WTF_NON_EXPORTED_BASE(public WebView), 99 : WTF_NON_EXPORTED_BASE(public WebView),
100 public RefCounted<WebViewImpl>, 100 public RefCounted<WebViewImpl>,
101 WTF_NON_EXPORTED_BASE(public WebGestureCurveTarget), 101 WTF_NON_EXPORTED_BASE(public WebGestureCurveTarget),
102 public PageWidgetEventHandler, 102 public PageWidgetEventHandler,
103 public WebScheduler::InterventionReporter { 103 public WebScheduler::InterventionReporter,
104 public WebViewScheduler::WebViewSchedulerSettings {
104 public: 105 public:
105 static WebViewImpl* create(WebViewClient*, WebPageVisibilityState); 106 static WebViewImpl* create(WebViewClient*, WebPageVisibilityState);
106 static HashSet<WebViewImpl*>& allInstances(); 107 static HashSet<WebViewImpl*>& allInstances();
107 108
108 // WebWidget methods: 109 // WebWidget methods:
109 void close() override; 110 void close() override;
110 WebSize size() override; 111 WebSize size() override;
111 void resize(const WebSize&) override; 112 void resize(const WebSize&) override;
112 void resizeVisualViewport(const WebSize&) override; 113 void resizeVisualViewport(const WebSize&) override;
113 void didEnterFullscreen() override; 114 void didEnterFullscreen() override;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 bool isFlinging() const override { return !!m_gestureAnimation.get(); } 273 bool isFlinging() const override { return !!m_gestureAnimation.get(); }
273 void setShowPaintRects(bool) override; 274 void setShowPaintRects(bool) override;
274 void setShowDebugBorders(bool); 275 void setShowDebugBorders(bool);
275 void setShowFPSCounter(bool) override; 276 void setShowFPSCounter(bool) override;
276 void setShowScrollBottleneckRects(bool) override; 277 void setShowScrollBottleneckRects(bool) override;
277 void acceptLanguagesChanged() override; 278 void acceptLanguagesChanged() override;
278 279
279 // WebScheduler::InterventionReporter implementation: 280 // WebScheduler::InterventionReporter implementation:
280 void ReportIntervention(const WebString& message) override; 281 void ReportIntervention(const WebString& message) override;
281 282
283 // WebViewScheduler::WebViewSchedulerSettings implementation:
284 float expensiveBackgroundThrottlingCPUBudget() override;
285 float expensiveBackgroundThrottlingInitialBudget() override;
286 float expensiveBackgroundThrottlingMaxBudget() override;
287 float expensiveBackgroundThrottlingMaxDelay() override;
288
282 void didUpdateFullscreenSize(); 289 void didUpdateFullscreenSize();
283 290
284 float defaultMinimumPageScaleFactor() const; 291 float defaultMinimumPageScaleFactor() const;
285 float defaultMaximumPageScaleFactor() const; 292 float defaultMaximumPageScaleFactor() const;
286 float minimumPageScaleFactor() const; 293 float minimumPageScaleFactor() const;
287 float maximumPageScaleFactor() const; 294 float maximumPageScaleFactor() const;
288 float clampPageScaleFactorToLimits(float) const; 295 float clampPageScaleFactorToLimits(float) const;
289 void resetScaleStateImmediately(); 296 void resetScaleStateImmediately();
290 297
291 HitTestResult coreHitTestResultAt(const WebPoint&); 298 HitTestResult coreHitTestResultAt(const WebPoint&);
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 749
743 // This is owned by the LayerTreeHostImpl, and should only be used on the 750 // This is owned by the LayerTreeHostImpl, and should only be used on the
744 // compositor thread. The LayerTreeHostImpl is indirectly owned by this 751 // compositor thread. The LayerTreeHostImpl is indirectly owned by this
745 // class so this pointer should be valid until this class is destructed. 752 // class so this pointer should be valid until this class is destructed.
746 CrossThreadPersistent<CompositorMutatorImpl> m_mutator; 753 CrossThreadPersistent<CompositorMutatorImpl> m_mutator;
747 754
748 Persistent<EventListener> m_popupMouseWheelEventListener; 755 Persistent<EventListener> m_popupMouseWheelEventListener;
749 756
750 WebPageImportanceSignals m_pageImportanceSignals; 757 WebPageImportanceSignals m_pageImportanceSignals;
751 758
752 const std::unique_ptr<WebViewScheduler> m_scheduler; 759 std::unique_ptr<WebViewScheduler> m_scheduler;
Sami 2016/11/07 16:33:42 Did you mean to change this?
altimin 2016/11/07 17:01:33 It was needed in the first version, not anymore.
753 760
754 double m_lastFrameTimeMonotonic; 761 double m_lastFrameTimeMonotonic;
755 762
756 // TODO(lfg): This is used in order to disable compositor visibility while 763 // TODO(lfg): This is used in order to disable compositor visibility while
757 // the page is still visible. This is needed until the WebView and WebWidget 764 // the page is still visible. This is needed until the WebView and WebWidget
758 // split is complete, since in out-of-process iframes the page can be 765 // split is complete, since in out-of-process iframes the page can be
759 // visible, but the WebView should not be used as a widget. 766 // visible, but the WebView should not be used as a widget.
760 bool m_overrideCompositorVisibility; 767 bool m_overrideCompositorVisibility;
761 768
762 Persistent<ResizeViewportAnchor> m_resizeViewportAnchor; 769 Persistent<ResizeViewportAnchor> m_resizeViewportAnchor;
763 }; 770 };
764 771
765 // We have no ways to check if the specified WebView is an instance of 772 // We have no ways to check if the specified WebView is an instance of
766 // WebViewImpl because WebViewImpl is the only implementation of WebView. 773 // WebViewImpl because WebViewImpl is the only implementation of WebView.
767 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); 774 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true);
768 775
769 } // namespace blink 776 } // namespace blink
770 777
771 #endif 778 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698