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

Side by Side Diff: third_party/WebKit/Source/core/dom/ElementVisibilityObserver.h

Issue 2470793002: Revert of Use intersection observer to control frame throttling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ElementVisibilityObserver_h 5 #ifndef ElementVisibilityObserver_h
6 #define ElementVisibilityObserver_h 6 #define ElementVisibilityObserver_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/dom/IntersectionObserver.h" 9 #include "core/dom/IntersectionObserver.h"
10 #include "platform/heap/Heap.h" 10 #include "platform/heap/Heap.h"
(...skipping 18 matching lines...) Expand all
29 29
30 public: 30 public:
31 using VisibilityCallback = Function<void(bool), WTF::SameThreadAffinity>; 31 using VisibilityCallback = Function<void(bool), WTF::SameThreadAffinity>;
32 32
33 ElementVisibilityObserver(Element*, std::unique_ptr<VisibilityCallback>); 33 ElementVisibilityObserver(Element*, std::unique_ptr<VisibilityCallback>);
34 virtual ~ElementVisibilityObserver(); 34 virtual ~ElementVisibilityObserver();
35 35
36 void start(); 36 void start();
37 void stop(); 37 void stop();
38 38
39 void deliverObservationsForTesting();
40
41 DECLARE_VIRTUAL_TRACE(); 39 DECLARE_VIRTUAL_TRACE();
42 40
43 private: 41 private:
44 class ElementVisibilityCallback; 42 class ElementVisibilityCallback;
45 43
46 void onVisibilityChanged( 44 void onVisibilityChanged(
47 const HeapVector<Member<IntersectionObserverEntry>>&); 45 const HeapVector<Member<IntersectionObserverEntry>>&);
48 46
49 Member<Element> m_element; 47 Member<Element> m_element;
50 Member<IntersectionObserver> m_intersectionObserver; 48 Member<IntersectionObserver> m_intersectionObserver;
51 std::unique_ptr<VisibilityCallback> m_callback; 49 std::unique_ptr<VisibilityCallback> m_callback;
52 }; 50 };
53 51
54 } // namespace blink 52 } // namespace blink
55 53
56 #endif // ElementVisibilityObserver_h 54 #endif // ElementVisibilityObserver_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698