Define default values for primitive-type fields of ...NavigationParams.
This CL provides explicit default values for most of the primitive-type fields of CommonNavigationParams, BeginNavigationParams and CommitNavigationParams. The explicit initialization is mostly a readability aid, since otherwise the auto-generated default constructor will just call the default constructor of the fields: BeginNavigationParams::BeginNavigationParams() : initiator_routing_id(), headers(), load_flags() ... Still, being explicit in the mojom file helps: 1. It makes it clear that the default has been explicitly selected by a human, rather then provided by the compiler and/or other tools. 2. It doesn't require the reader to understand that omitting the initializer is safe and will zero-initialize POD values. 3. It does make a difference in cases when non-zero defaults are better - for example when initializing initiator_routing_id to MSG_ROUTING_NONE. (rather than falling back to zero-initializatio Note that default initial values cannot be provided for [Native] enums. Bug: 1107269 Change-Id: I9a1dfc9467d52ff9485cc124ab1859cf50b6b345 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2341892 Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Reviewed-by:Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#796013}
Showing
Please register or sign in to comment