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

Side by Side Diff: Source/bindings/dart/custom/DartCanvasRenderingContext2DCustom.cpp

Issue 26789007: Add a native subtype of function that uses the native C++ class hierarchy to check if an element (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
OLDNEW
1 // Copyright 2011, Google Inc. 1 // Copyright 2011, 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 DartCanvasPattern::returnToDart(args, style->canvasPattern()); 63 DartCanvasPattern::returnToDart(args, style->canvasPattern());
64 return; 64 return;
65 } 65 }
66 66
67 DartUtilities::setDartStringReturnValue(args, style->color()); 67 DartUtilities::setDartStringReturnValue(args, style->color());
68 } 68 }
69 69
70 static PassRefPtr<CanvasStyle> toCanvasStyle(Dart_Handle value) 70 static PassRefPtr<CanvasStyle> toCanvasStyle(Dart_Handle value)
71 { 71 {
72 Dart_Handle exception = 0; 72 Dart_Handle exception = 0;
73 DartDOMData* domData = DartDOMData::current(); 73 if (DartDOMWrapper::subtypeOf(value, DartCanvasGradient::dartClassId))
74 if (DartDOMWrapper::instanceOf<DartCanvasGradient>(domData, value))
75 return CanvasStyle::createFromGradient(DartCanvasGradient::toNative(valu e, exception)); 74 return CanvasStyle::createFromGradient(DartCanvasGradient::toNative(valu e, exception));
76 75
77 if (DartDOMWrapper::instanceOf<DartCanvasPattern>(domData, value)) 76 if (DartDOMWrapper::subtypeOf(value, DartCanvasPattern::dartClassId))
78 return CanvasStyle::createFromPattern(DartCanvasPattern::toNative(value, exception)); 77 return CanvasStyle::createFromPattern(DartCanvasPattern::toNative(value, exception));
79 78
80 return 0; 79 return 0;
81 } 80 }
82 81
83 void strokeStyleGetter(Dart_NativeArguments args ) 82 void strokeStyleGetter(Dart_NativeArguments args )
84 { 83 {
85 { 84 {
86 CanvasRenderingContext2D* receiver = DartDOMWrapper::receiver<CanvasRend eringContext2D>(args); 85 CanvasRenderingContext2D* receiver = DartDOMWrapper::receiver<CanvasRend eringContext2D>(args);
87 86
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 145 }
147 146
148 fail: 147 fail:
149 Dart_ThrowException(exception); 148 Dart_ThrowException(exception);
150 ASSERT_NOT_REACHED(); 149 ASSERT_NOT_REACHED();
151 } 150 }
152 151
153 } // namespace DartCanvasRenderingContext2DInternal 152 } // namespace DartCanvasRenderingContext2DInternal
154 153
155 } // namespace WebCore 154 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/dart/custom/DartBlobCustom.cpp ('k') | Source/bindings/dart/custom/DartDOMStringListCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698