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

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

Issue 27140002: Use Dart_InstanceIsSubtypeOf to check if instance is a direct subtype of specified type. (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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 DartDOMData* domData = DartDOMData::current();
74 if (DartDOMWrapper::instanceOf<DartCanvasGradient>(domData, value)) 74 if (DartDOMWrapper::subtypeOf<DartCanvasGradient>(domData, value))
75 return CanvasStyle::createFromGradient(DartCanvasGradient::toNative(valu e, exception)); 75 return CanvasStyle::createFromGradient(DartCanvasGradient::toNative(valu e, exception));
76 76
77 if (DartDOMWrapper::instanceOf<DartCanvasPattern>(domData, value)) 77 if (DartDOMWrapper::subtypeOf<DartCanvasPattern>(domData, value))
78 return CanvasStyle::createFromPattern(DartCanvasPattern::toNative(value, exception)); 78 return CanvasStyle::createFromPattern(DartCanvasPattern::toNative(value, exception));
79 79
80 return 0; 80 return 0;
81 } 81 }
82 82
83 void strokeStyleGetter(Dart_NativeArguments args ) 83 void strokeStyleGetter(Dart_NativeArguments args )
84 { 84 {
85 { 85 {
86 CanvasRenderingContext2D* receiver = DartDOMWrapper::receiver<CanvasRend eringContext2D>(args); 86 CanvasRenderingContext2D* receiver = DartDOMWrapper::receiver<CanvasRend eringContext2D>(args);
87 87
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 fail: 148 fail:
149 Dart_ThrowException(exception); 149 Dart_ThrowException(exception);
150 ASSERT_NOT_REACHED(); 150 ASSERT_NOT_REACHED();
151 } 151 }
152 152
153 } // namespace DartCanvasRenderingContext2DInternal 153 } // namespace DartCanvasRenderingContext2DInternal
154 154
155 } // namespace WebCore 155 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698