Commit 0b845b01 authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

CodeGen: Make blink_type_info work for buffer source types

This is to unblock compilations, and not to work for all the cases
that use buffer source types.

And adds an assertion to show a clear message that an unknown type is
passed in the function. (Otherwise, we may hit a property access error
on None objects.)


Bug: 839389
Change-Id: I98e54356e7dafd98a93023afc220700913b5d6f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1965779
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#724511}
parent e05321ff
......@@ -81,6 +81,14 @@ def blink_type_info(idl_type):
if real_type.is_string:
return TypeInfo("String", ref_fmt="{}&", is_nullable=True)
if real_type.is_buffer_source_type:
return TypeInfo(
'DOM{}'.format(real_type.keyword_typename),
member_fmt="Member<{}>",
ref_fmt="{}*",
value_fmt="{}*",
is_nullable=True)
if real_type.is_symbol:
assert False, "Blink does not support/accept IDL symbol type."
......@@ -129,6 +137,8 @@ def blink_type_info(idl_type):
return TypeInfo(
"base::Optional<{}>".format(inner_type.value_t), ref_fmt="{}&")
assert False, "Unknown type: {}".format(idl_type.syntactic_form)
def native_value_tag(idl_type):
"""Returns the tag type of NativeValueTraits."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment