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

Unified Diff: sky/engine/core/events/EventTarget.cpp

Issue 922893002: Merge the Sky Engine changes from the SkyDart branch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « sky/engine/core/events/EventTarget.h ('k') | sky/engine/core/events/EventTarget.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/events/EventTarget.cpp
diff --git a/sky/engine/core/events/EventTarget.cpp b/sky/engine/core/events/EventTarget.cpp
index 9803ecb9d08e92b36e45779b06c4906028a06864..af9c20a6ba95cb8972a16608c2134b05dad766da 100644
--- a/sky/engine/core/events/EventTarget.cpp
+++ b/sky/engine/core/events/EventTarget.cpp
@@ -33,7 +33,7 @@
#include "sky/engine/core/events/EventTarget.h"
#include "gen/sky/platform/RuntimeEnabledFeatures.h"
-#include "sky/engine/bindings/core/v8/ExceptionState.h"
+#include "sky/engine/bindings2/exception_state.h"
#include "sky/engine/core/dom/Document.h"
#include "sky/engine/core/dom/ExceptionCode.h"
#include "sky/engine/core/dom/ExecutionContext.h"
@@ -41,6 +41,7 @@
#include "sky/engine/core/events/Event.h"
#include "sky/engine/core/frame/LocalDOMWindow.h"
#include "sky/engine/platform/EventDispatchForbiddenScope.h"
+#include "sky/engine/tonic/dart_gc_visitor.h"
#include "sky/engine/wtf/StdLibExtras.h"
#include "sky/engine/wtf/Vector.h"
@@ -64,6 +65,16 @@ EventTarget::~EventTarget()
{
}
+void EventTarget::AcceptDartGCVisitor(DartGCVisitor& visitor) const
+{
+ if (!visitor.have_found_set())
+ visitor.AddToSetForRoot(this, dart_wrapper());
+ EventListenerIterator iterator(this);
+ while (EventListener* listener = iterator.nextListener())
+ listener->AcceptDartGCVisitor(visitor);
+ DartWrappable::AcceptDartGCVisitor(visitor);
+}
+
Node* EventTarget::toNode()
{
return 0;
@@ -124,15 +135,15 @@ bool EventTarget::removeEventListener(const AtomicString& eventType, PassRefPtr<
bool EventTarget::dispatchEvent(PassRefPtr<Event> event, ExceptionState& exceptionState)
{
if (!event) {
- exceptionState.throwDOMException(InvalidStateError, "The event provided is null.");
+ exceptionState.ThrowDOMException(InvalidStateError, "The event provided is null.");
return false;
}
if (event->type().isEmpty()) {
- exceptionState.throwDOMException(InvalidStateError, "The event provided is uninitialized.");
+ exceptionState.ThrowDOMException(InvalidStateError, "The event provided is uninitialized.");
return false;
}
if (event->isBeingDispatched()) {
- exceptionState.throwDOMException(InvalidStateError, "The event is already being dispatched.");
+ exceptionState.ThrowDOMException(InvalidStateError, "The event is already being dispatched.");
return false;
}
« no previous file with comments | « sky/engine/core/events/EventTarget.h ('k') | sky/engine/core/events/EventTarget.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698