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

Issue 450053002: Throw exception on null pointers in raw toNative (Closed)

Created:
6 years, 4 months ago by Leaf
Modified:
6 years, 4 months ago
Reviewers:
vsm
CC:
reviews+dom_dartlang.org
Visibility:
Public.

Description

Throw exception on null pointers in raw toNative Currently, all of the different variants of toNative will convert a Dart_Null to a null pointer without throwing an error. This is incorrect: for non nullable types, many of the underlying blink implementations will crash if given a null pointer (see for example https://code.google.com/p/dart/issues/detail?id=19948). This CL is a first cut a correcting this. I've changed the template generator for the wrappers to produce code which throws an error if given Dart_Null in the non WithNullCheck cases. I think this code should actually be substantially refactored - the naming convention is quite confusing at the moment - but for the time being this addresses the immediate bug and makes things less likely to crash on bad inputs. Some custom code had to be updated to use toNativeWithNullCheck (corresponding to toNativeWithTypeCheck in the V8 case). BUG=http://dartbug.com/19948 R=vsm@google.com Committed: https://src.chromium.org/viewvc/blink/branches/dart/dartium?view=rev&revision=180097

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -42 lines) Patch
M Source/bindings/dart/custom/DartCanvasRenderingContext2DCustom.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/dart/custom/DartFormDataCustom.cpp View 2 chunks +1 line, -21 lines 0 comments Download
M Source/bindings/dart/custom/DartMessageEventCustom.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/dart/custom/DartNodeCustom.cpp View 4 chunks +6 lines, -6 lines 0 comments Download
M Source/bindings/dart/custom/DartWebGLRenderingContextCustom.cpp View 6 chunks +6 lines, -6 lines 0 comments Download
M Source/bindings/dart/scripts/templates/interface_h.template View 1 chunk +22 lines, -6 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Leaf
6 years, 4 months ago (2014-08-08 00:38:53 UTC) #1
vsm
lgtm Agreed on confusing names. Perhaps toNative should be toNativeThrowOnNull? Do you notice / expect ...
6 years, 4 months ago (2014-08-12 08:19:22 UTC) #2
Leaf
On 2014/08/12 08:19:22, vsm wrote: > lgtm > > Agreed on confusing names. Perhaps toNative ...
6 years, 4 months ago (2014-08-12 16:47:08 UTC) #3
Leaf
6 years, 4 months ago (2014-08-12 19:47:40 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 manually as 180097 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698