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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013, Google Inc. 1 // Copyright 2013, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 19 matching lines...) Expand all
30 #include "config.h" 30 #include "config.h"
31 31
32 #if ENABLE(WEB_AUDIO) 32 #if ENABLE(WEB_AUDIO)
33 33
34 #include "DartOscillatorNode.h" 34 #include "DartOscillatorNode.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 namespace DartOscillatorNodeInternal { 38 namespace DartOscillatorNodeInternal {
39 39
40 void typeSetter(Dart_NativeArguments) 40 void typeSetter(Dart_NativeArguments args)
41 { 41 {
42 // FIXME: proper implementation. 42 Dart_Handle exception = 0;
43 DART_UNIMPLEMENTED(); 43 {
44 OscillatorNode* receiver = DartDOMWrapper::receiver<OscillatorNode>(args );
45
46 String type = DartUtilities::dartToString(Dart_GetNativeArgument(args, 1 ), exception);
siva 2013/10/19 00:03:48 you could use DartUtilities::dartToString(args, 1,
rmacnak 2013/10/21 23:44:47 Done.
47 if (exception)
48 goto fail;
49
50 if (type == "sine" || type == "square" || type == "sawtooth" || type == "triangle") {
51 receiver->setType(type);
52 return;
53 }
54
55 exception = Dart_NewStringFromCString("Illegal OscillatorNode type");
56 }
57
58 fail:
59 Dart_ThrowException(exception);
60 ASSERT_NOT_REACHED();
44 } 61 }
45 62
46 } 63 }
47 64
48 } 65 }
49 66
50 #endif // ENABLE(WEB_AUDIO) 67 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« 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