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

Unified Diff: sky/engine/bindings-dart/core/dart/custom/DartEventTargetCustom.cpp

Issue 875013003: Import Dart bindings as of Blink r188698. This merely copies the files over and does not attach any… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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: sky/engine/bindings-dart/core/dart/custom/DartEventTargetCustom.cpp
diff --git a/LICENSE b/sky/engine/bindings-dart/core/dart/custom/DartEventTargetCustom.cpp
similarity index 57%
copy from LICENSE
copy to sky/engine/bindings-dart/core/dart/custom/DartEventTargetCustom.cpp
index 972bb2edb099e58b6a1939fa57f8e74391159c0c..ecff57f3e70c5dd81815f6e7cb9619a9a8744cab 100644
--- a/LICENSE
+++ b/sky/engine/bindings-dart/core/dart/custom/DartEventTargetCustom.cpp
@@ -1,4 +1,5 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2011, Google Inc.
+// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -25,3 +26,36 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "config.h"
+#include "bindings/core/dart/DartEventTarget.h"
+
+#include "bindings/core/dart/DartNode.h"
+#include "core/DartEventTargetHeaders.h"
+#include "core/EventTargetHeaders.h"
+#include "core/EventTargetInterfaces.h"
+#include "modules/DartEventTargetModulesHeaders.h"
+#include "modules/EventTargetModulesHeaders.h"
+#include "modules/EventTargetModulesInterfaces.h"
+
+namespace blink {
+
+#define TRY_TO_WRAP_WITH_INTERFACE(interfaceName) \
+ if (EventTargetNames::interfaceName == desiredInterface) \
+ return toDartNoInline(static_cast<interfaceName*>(target), 0);
+
+// A Dart object of type EventTarget is limited to a number of possible classes.
+Dart_Handle DartEventTarget::createWrapper(DartDOMData* domData, EventTarget* target)
+{
+ if (!target)
+ return Dart_Null();
+
+ AtomicString desiredInterface = target->interfaceName();
+ EVENT_TARGET_INTERFACES_FOR_EACH(TRY_TO_WRAP_WITH_INTERFACE)
+ EVENT_TARGET_MODULES_INTERFACES_FOR_EACH(TRY_TO_WRAP_WITH_INTERFACE)
+
+ ASSERT_NOT_REACHED();
+ return Dart_Null();
+}
+
+}

Powered by Google App Engine
This is Rietveld 408576698