Skip to content

Commit

Permalink
MojoLPM: Change camel casing to match protobuf everywhere.
Browse files Browse the repository at this point in the history
Bug: 1459947
Change-Id: Ie7e5a548ab09ee3a449630cf9c08345cf8450839
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4661101
Commit-Queue: Mark Brand <markbrand@google.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1165938}
  • Loading branch information
c01db33f authored and Chromium LUCI CQ committed Jul 5, 2023
1 parent d5e37cb commit af0878e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ bool HandleRemoteAction(const {{proto_type}}::RemoteAction& input) {

switch (input.method_case()) {
{%- for method in interface.methods %}
case {{proto_type}}::RemoteAction::k{{("m_" ~ method.name)|under_to_camel(digits_split=True)}}: {
case {{proto_type}}::RemoteAction::k{{("m_" ~ method.name)|under_to_camel}}: {
result = HandleRemoteCall(input.id(), input.{{("m" ~ method.name)|camel_to_under}}());
} break;
{%- endfor %}
Expand All @@ -276,7 +276,7 @@ bool HandleAssociatedRemoteAction(const {{proto_type}}::AssociatedRemoteAction&

switch (input.method_case()) {
{%- for method in interface.methods %}
case {{proto_type}}::AssociatedRemoteAction::k{{("m_" ~ method.name)|under_to_camel(digits_split=True)}}: {
case {{proto_type}}::AssociatedRemoteAction::k{{("m_" ~ method.name)|under_to_camel}}: {
result = HandleAssociatedRemoteCall(input.id(), input.{{("m" ~ method.name)|camel_to_under}}());
} break;
{%- endfor %}
Expand All @@ -297,7 +297,7 @@ bool HandleReceiverAction(
bool result = true;
switch (input.response_case()) {
{%- for method in interface.methods %}
case {{proto_type}}::ReceiverAction::k{{("m_" ~ method.name ~ "_response")|under_to_camel(digits_split=True)}}: {
case {{proto_type}}::ReceiverAction::k{{("m_" ~ method.name ~ "_response")|under_to_camel}}: {
result = HandleResponse(input.id(), input.{{("m" ~ method.name ~ "_response")|camel_to_under}}());
} break;
{%- endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""Generates C++ source files from a mojom.Module."""
import os
import sys
from functools import partial
from generators.mojom_cpp_generator import _NameFormatter as CppNameFormatter
from generators.mojom_cpp_generator import Generator as CppGenerator
from generators.mojom_cpp_generator import IsNativeOnlyKind, NamespaceToArray
Expand Down Expand Up @@ -269,7 +270,7 @@ def GetFilters(self):
"is_typemapped_kind": self._IsTypemappedKind,
"is_union_kind": mojom.IsUnionKind,
"to_unnullable_kind": self._ToUnnullableKind,
"under_to_camel": self._UnderToCamel,
"under_to_camel": partial(self._UnderToCamel, digits_split=True)
}
return cpp_filters

Expand Down

0 comments on commit af0878e

Please sign in to comment.