Commit a20c4044 authored by Takuto Ikuta's avatar Takuto Ikuta Committed by Commit Bot

[mojo] forward declare non-variant enum before WTF enum hashing

Fix for
https://bugs.chromium.org/p/chromium/issues/detail?id=922875#c107

Bug: 922875
Change-Id: Ifddc1f7ebf14117ed734bfbab6fd16b13632979a
Reviewed-on: https://chromium-review.googlesource.com/c/1488395
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#635429}
parent b07f7c40
...@@ -58,20 +58,6 @@ namespace {{variant}} { ...@@ -58,20 +58,6 @@ namespace {{variant}} {
#include "{{export_header}}" #include "{{export_header}}"
{%- endif %} {%- endif %}
{#--- WTF enum hashing #}
{%- from "enum_macros.tmpl" import enum_hash_blink_forward%}
{%- if for_blink %}
{%- if all_enums %}
#include "third_party/blink/renderer/platform/wtf/hash_functions.h"
{%- endif %}
{%- for enum in all_enums %}
{%- if not enum|is_native_only_kind %}
{{enum_hash_blink_forward(enum)}}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- if variant %} {%- if variant %}
{%- for namespace in namespaces_as_array %} {%- for namespace in namespaces_as_array %}
namespace {{namespace}} { namespace {{namespace}} {
...@@ -91,6 +77,20 @@ using {{enum|get_name_for_kind(flatten_nested_kind=True)}} = mojo::NativeEnum; ...@@ -91,6 +77,20 @@ using {{enum|get_name_for_kind(flatten_nested_kind=True)}} = mojo::NativeEnum;
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
{#--- WTF enum hashing #}
{%- from "enum_macros.tmpl" import enum_hash_blink_forward%}
{%- if for_blink %}
{%- if all_enums %}
#include "third_party/blink/renderer/platform/wtf/hash_functions.h"
{%- endif %}
{%- for enum in all_enums %}
{%- if not enum|is_native_only_kind %}
{{enum_hash_blink_forward(enum)}}
{%- endif %}
{%- endfor %}
{%- endif %}
{{namespace_begin()}} {{namespace_begin()}}
{#- These are non-variant header only. #} {#- These are non-variant header only. #}
......
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