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

Unified Diff: third_party/WebKit/Source/core/dom/IntersectionObserver.h

Issue 2051253002: Start autoplay muted videos with autoplay attribute when they are visible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reduce Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/IntersectionObserver.h
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserver.h b/third_party/WebKit/Source/core/dom/IntersectionObserver.h
index ecf68c3c88f1a9575bc22476d4c0671976b3b6c8..b2288285cf09775ae3db6768380dbd044446cd43 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.h
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.h
@@ -5,6 +5,7 @@
#ifndef IntersectionObserver_h
#define IntersectionObserver_h
+#include "bindings/core/v8/ExceptionStatePlaceholder.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/IntersectionObservation.h"
#include "core/dom/IntersectionObserverEntry.h"
@@ -15,6 +16,7 @@
namespace blink {
+class Document;
class Element;
class ExceptionState;
class LayoutObject;
@@ -25,16 +27,19 @@ class CORE_EXPORT IntersectionObserver final : public GarbageCollectedFinalized<
DEFINE_WRAPPERTYPEINFO();
public:
+ using EventCallback = Function<void(const HeapVector<Member<IntersectionObserverEntry>>&), WTF::SameThreadAffinity>;
+
static IntersectionObserver* create(const IntersectionObserverInit&, IntersectionObserverCallback&, ExceptionState&);
+ static IntersectionObserver* create(const Vector<Length>& rootMargin, const Vector<float>& thresholds, Document*, std::unique_ptr<EventCallback>);
static void resumeSuspendedObservers();
- // API methods
- void observe(Element*, ExceptionState&);
- void unobserve(Element*, ExceptionState&);
+ // API methods.
+ void observe(Element*, ExceptionState& = ASSERT_NO_EXCEPTION);
+ void unobserve(Element*, ExceptionState& = ASSERT_NO_EXCEPTION);
void disconnect(ExceptionState&);
HeapVector<Member<IntersectionObserverEntry>> takeRecords(ExceptionState&);
- // API attributes
+ // API attributes.
Element* root() const;
String rootMargin() const;
const Vector<float>& thresholds() const { return m_thresholds; }

Powered by Google App Engine
This is Rietveld 408576698