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

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

Issue 469373002: Bindings generation emits (more) correct null checking (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Adding in fixes to binding generation Created 6 years, 4 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return; 52 return;
53 } 53 }
54 54
55 DartUtilities::setDartStringReturnValue(args, style->color()); 55 DartUtilities::setDartStringReturnValue(args, style->color());
56 } 56 }
57 57
58 static PassRefPtr<CanvasStyle> toCanvasStyle(Dart_Handle value) 58 static PassRefPtr<CanvasStyle> toCanvasStyle(Dart_Handle value)
59 { 59 {
60 Dart_Handle exception = 0; 60 Dart_Handle exception = 0;
61 if (DartDOMWrapper::subtypeOf(value, DartCanvasGradient::dartClassId)) 61 if (DartDOMWrapper::subtypeOf(value, DartCanvasGradient::dartClassId))
62 return CanvasStyle::createFromGradient(DartCanvasGradient::toNative(valu e, exception)); 62 return CanvasStyle::createFromGradient(DartCanvasGradient::toNativeWithN ullCheck(value, exception));
63 63
64 if (DartDOMWrapper::subtypeOf(value, DartCanvasPattern::dartClassId)) 64 if (DartDOMWrapper::subtypeOf(value, DartCanvasPattern::dartClassId))
65 return CanvasStyle::createFromPattern(DartCanvasPattern::toNative(value, exception)); 65 return CanvasStyle::createFromPattern(DartCanvasPattern::toNativeWithNul lCheck(value, exception));
66 66
67 return nullptr; 67 return nullptr;
68 } 68 }
69 69
70 void strokeStyleGetter(Dart_NativeArguments args ) 70 void strokeStyleGetter(Dart_NativeArguments args )
71 { 71 {
72 { 72 {
73 CanvasRenderingContext2D* receiver = DartDOMWrapper::receiver<CanvasRend eringContext2D>(args); 73 CanvasRenderingContext2D* receiver = DartDOMWrapper::receiver<CanvasRend eringContext2D>(args);
74 74
75 canvasStyleReturnToDartValue(args, receiver->strokeStyle()); 75 canvasStyleReturnToDartValue(args, receiver->strokeStyle());
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 fail: 135 fail:
136 Dart_ThrowException(exception); 136 Dart_ThrowException(exception);
137 ASSERT_NOT_REACHED(); 137 ASSERT_NOT_REACHED();
138 } 138 }
139 139
140 } // namespace DartCanvasRenderingContext2DInternal 140 } // namespace DartCanvasRenderingContext2DInternal
141 141
142 } // namespace WebCore 142 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/dart/DartUtilities.cpp ('k') | Source/bindings/dart/custom/DartFormDataCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698