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

Unified Diff: Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp

Issue 29783004: Implement OscillatorNode.type= for Dartium. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp
diff --git a/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp b/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp
index 5a9f5004db3bb89481fccb72a5893a99aa26bc11..81a92846cbaeef599fa6ae32853a3052f8368be3 100644
--- a/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp
+++ b/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp
@@ -37,10 +37,27 @@ namespace WebCore {
namespace DartOscillatorNodeInternal {
-void typeSetter(Dart_NativeArguments)
+void typeSetter(Dart_NativeArguments args)
{
- // FIXME: proper implementation.
- DART_UNIMPLEMENTED();
+ Dart_Handle exception = 0;
+ {
+ OscillatorNode* receiver = DartDOMWrapper::receiver<OscillatorNode>(args);
+
+ String type = DartUtilities::dartToString(args, 1, exception);
+ if (exception)
+ goto fail;
+
+ if (type == "sine" || type == "square" || type == "sawtooth" || type == "triangle") {
+ receiver->setType(type);
+ return;
+ }
+
+ exception = Dart_NewStringFromCString("Illegal OscillatorNode type");
+ }
+
+fail:
+ Dart_ThrowException(exception);
+ ASSERT_NOT_REACHED();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698