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

Issue 2012693002: Generate a templated Clone method for all mojo structs. (Closed)

Created:
4 years, 7 months ago by Sam McNally
Modified:
4 years, 6 months ago
Reviewers:
yzshen1
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Generate a templated Clone method for all mojo structs. Previously, Clone methods were only generated for mojo structs where all fields were cloneable. However, for typemapped types, the bindings generator is not aware of whether the native type is copyable and so it treated all typemapped types as not cloneable. This changes the Clone method to be templated so it is only compiled if used so all mojo structs can contain a Clone method that will be usable only if all fields are cloneable. Committed: https://crrev.com/fb981f58c60cd22364da2f8f5b4171f45edbe1fb Cr-Commit-Position: refs/heads/master@{#396608}

Patch Set 1 : #

Total comments: 4

Patch Set 2 : #

Messages

Total messages: 28 (21 generated)
Sam McNally
4 years, 7 months ago (2016-05-26 04:06:26 UTC) #15
yzshen1
https://codereview.chromium.org/2012693002/diff/240001/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl File mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl (right): https://codereview.chromium.org/2012693002/diff/240001/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl#newcode21 mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl:21: {%- if field.kind|is_object_kind and not field.kind|is_string_kind and not field.kind|is_typemapped_kind%} ...
4 years, 7 months ago (2016-05-26 16:24:14 UTC) #16
Sam McNally
https://codereview.chromium.org/2012693002/diff/240001/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl File mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl (right): https://codereview.chromium.org/2012693002/diff/240001/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl#newcode21 mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl:21: {%- if field.kind|is_object_kind and not field.kind|is_string_kind and not field.kind|is_typemapped_kind%} ...
4 years, 6 months ago (2016-05-27 02:57:40 UTC) #21
yzshen1
LGTM Would be nice if we do the same for unions. But that could be ...
4 years, 6 months ago (2016-05-27 21:39:55 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2012693002/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2012693002/320001
4 years, 6 months ago (2016-05-27 23:33:14 UTC) #24
commit-bot: I haz the power
Committed patchset #2 (id:320001)
4 years, 6 months ago (2016-05-28 00:18:49 UTC) #26
commit-bot: I haz the power
4 years, 6 months ago (2016-05-28 00:20:33 UTC) #28
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/fb981f58c60cd22364da2f8f5b4171f45edbe1fb
Cr-Commit-Position: refs/heads/master@{#396608}

Powered by Google App Engine
This is Rietveld 408576698