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

Issue 1532053002: use variadic macros/templates in IPC message implementation (Closed)

Created:
5 years ago by mdempsky
Modified:
4 years, 10 months ago
CC:
dcheng, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

use variadic macros/templates in IPC message implementation TBR=jam@chromium.org, mseaborn@chromium.org Committed: https://crrev.com/8a5190449d48e06efa581390426dfa3bb6750f4c Cr-Commit-Position: refs/heads/master@{#374316}

Patch Set 1 #

Patch Set 2 : fix linker errors #

Patch Set 3 : try to fix android build #

Patch Set 4 : fix content_browsertests build #

Patch Set 5 : sync to master #

Patch Set 6 : restore bogus carriage return to fix patch problems #

Patch Set 7 : fix windows build #

Patch Set 8 : add IPC_IS_DLLEXPORT unit tests #

Patch Set 9 : workaround MSVC C4003 false positives #

Patch Set 10 : tweaks #

Patch Set 11 : another msvc C4003 workaround attempt #

Patch Set 12 : hack to appease MSVC #

Patch Set 13 : sigh, actual workaround #

Patch Set 14 : msvc hack #

Patch Set 15 : fix ambiguous template #

Patch Set 16 : alternative SFINAE approach #

Patch Set 17 : hoist DispatchToMethod to workaround MSVC SFINAE bugs #

Patch Set 18 : better comments #

Patch Set 19 : gyp/gn nits #

Patch Set 20 : update ipc_fuzzer #

Patch Set 21 : random guess at fixing win_chromium_dbg_ng #

Patch Set 22 : try something different #

Patch Set 23 : simplify #

Total comments: 21

Patch Set 24 : more comments #

Patch Set 25 : sync to master #

Patch Set 26 : Simpler and smaller binaries #

Patch Set 27 : make CrOS G++ happy #

Patch Set 28 : Fix Chrome/NaCl build #

Patch Set 29 : try to make CrOS G++ and MSVC both happy #

Patch Set 30 : Fix sync message reading regression #

Patch Set 31 : Smaller unstripped binaries #

Patch Set 32 : Change ID back to enum to workaround linker errors #

Patch Set 33 : workaround MSVC issue 786583 #

Patch Set 34 : fix ipc_fuzzer build again #

Total comments: 25

Patch Set 35 : vmpstr #

Total comments: 2

Patch Set 36 : nit + rebase #

Patch Set 37 : nits #

Total comments: 5

Patch Set 38 : tsepez feedback #

Total comments: 3

Patch Set 39 : stricter legacy compat macros #

Total comments: 6

Patch Set 40 : move export_template.h to ipc #

Patch Set 41 : move for real #

Unified diffs Side-by-side diffs Delta from patch set Stats (+798 lines, -936 lines) Patch
M components/nacl/browser/nacl_file_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +3 lines, -3 lines 0 comments Download
M content/renderer/input/input_event_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +3 lines, -2 lines 0 comments Download
M content/renderer/render_thread_impl_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +5 lines, -0 lines 0 comments Download
M ipc/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 2 chunks +3 lines, -0 lines 0 comments Download
A ipc/export_template.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 1 chunk +163 lines, -0 lines 0 comments Download
M ipc/ipc.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 2 chunks +3 lines, -0 lines 0 comments Download
M ipc/ipc_message_macros.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 4 chunks +205 lines, -644 lines 0 comments Download
M ipc/ipc_message_null_macros.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -3 lines 0 comments Download
A ipc/ipc_message_templates.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 1 chunk +210 lines, -0 lines 0 comments Download
A ipc/ipc_message_templates_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +110 lines, -0 lines 0 comments Download
M ipc/ipc_message_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 3 chunks +0 lines, -107 lines 0 comments Download
D ipc/ipc_message_utils_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +0 lines, -51 lines 0 comments Download
M tools/ipc_fuzzer/fuzzer/fuzzer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 1 chunk +89 lines, -114 lines 0 comments Download
M tools/ipc_fuzzer/message_lib/message_names.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +1 line, -1 line 0 comments Download
M tools/ipc_fuzzer/message_tools/message_list.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 4 chunks +2 lines, -11 lines 0 comments Download

Messages

Total messages: 80 (24 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532053002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532053002/20001
5 years ago (2015-12-17 08:55:12 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/498) linux_chromium_gn_chromeos_rel on ...
5 years ago (2015-12-17 09:12:08 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532053002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532053002/60001
5 years ago (2015-12-17 09:39:48 UTC) #6
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/109151) ios_rel_device_ninja on ...
5 years ago (2015-12-17 09:41:45 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532053002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532053002/80001
5 years ago (2015-12-17 09:49:05 UTC) #10
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/109156) mac_chromium_compile_dbg_ng on ...
5 years ago (2015-12-17 09:50:56 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532053002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532053002/100001
5 years ago (2015-12-17 09:56:39 UTC) #14
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/129911)
5 years ago (2015-12-17 10:04:54 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532053002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532053002/280001
5 years ago (2015-12-17 14:36:27 UTC) #18
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/146412)
5 years ago (2015-12-17 15:11:29 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532053002/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532053002/320001
5 years ago (2015-12-17 17:24:23 UTC) #22
danakj
So.. I tried to digest this but it's really hard. The templates can be parsed ...
5 years ago (2015-12-19 00:15:06 UTC) #25
vmpstr
https://codereview.chromium.org/1532053002/diff/440001/base/export_template.h File base/export_template.h (right): https://codereview.chromium.org/1532053002/diff/440001/base/export_template.h#newcode8 base/export_template.h:8: // Synopsis Does the approach of directly checking if ...
5 years ago (2015-12-19 00:26:47 UTC) #27
mdempsky
On 2015/12/19 00:26:47, vmpstr wrote: > Does the approach of directly checking if we're on ...
5 years ago (2015-12-19 01:45:54 UTC) #28
mdempsky
https://codereview.chromium.org/1532053002/diff/440001/base/export_template.h File base/export_template.h (right): https://codereview.chromium.org/1532053002/diff/440001/base/export_template.h#newcode40 base/export_template.h:40: // MSVC emits warning C4003 ("not enough actual parameters ...
5 years ago (2015-12-19 02:14:49 UTC) #29
mdempsky
(I meant to add: I of course plan to add comments to clarify all of ...
5 years ago (2015-12-19 02:17:05 UTC) #30
mdempsky
On 2015/12/19 01:45:54, mdempsky wrote: > One option would be to change all of the ...
5 years ago (2015-12-19 02:32:42 UTC) #31
dcheng
So I think it's obvious that the current IPC implementation is a crazy macro soup. ...
5 years ago (2015-12-21 18:32:37 UTC) #33
mdempsky
On 2015/12/21 18:32:37, dcheng wrote: > 1) What makes the template+macro implementation superior to the ...
5 years ago (2015-12-23 23:17:46 UTC) #34
vmpstr
On 2015/12/19 01:45:54, mdempsky wrote: > On 2015/12/19 00:26:47, vmpstr wrote: > > Does the ...
4 years, 12 months ago (2015-12-28 21:19:59 UTC) #35
mdempsky
Reverted some unnecessary changes, added a lot more comments, and renamed EXPORT_TEMPLATE_STYLE_MATCH__* to EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__* because ...
4 years, 11 months ago (2016-01-05 02:37:49 UTC) #36
mdempsky
PTAL PS30 I went ahead and applied a few of the followup simplifications that I ...
4 years, 11 months ago (2016-01-07 01:49:27 UTC) #37
mdempsky
On 2016/01/07 01:49:27, mdempsky wrote: > Also, PS30 now shrinks stripped chrome release binaries on ...
4 years, 11 months ago (2016-01-07 06:31:20 UTC) #38
mdempsky
Ping.
4 years, 11 months ago (2016-01-19 19:10:24 UTC) #39
mdempsky
Ping.
4 years, 10 months ago (2016-02-04 22:40:59 UTC) #40
vmpstr
This looks good to me (modulo comments). However, because of the density of the code, ...
4 years, 10 months ago (2016-02-04 23:43:27 UTC) #41
mdempsky
vmpstr: Thanks! https://codereview.chromium.org/1532053002/diff/660001/base/export_template.h File base/export_template.h (right): https://codereview.chromium.org/1532053002/diff/660001/base/export_template.h#newcode40 base/export_template.h:40: // MSVC emits warning C4003 ("not enough ...
4 years, 10 months ago (2016-02-05 00:32:32 UTC) #42
danakj
https://codereview.chromium.org/1532053002/diff/660001/ipc/ipc_message_templates.h File ipc/ipc_message_templates.h (right): https://codereview.chromium.org/1532053002/diff/660001/ipc/ipc_message_templates.h#newcode70 ipc/ipc_message_templates.h:70: // TODO(mdempsky): Reevaluate once MSVC 2015. On 2016/02/05 00:32:32, ...
4 years, 10 months ago (2016-02-05 00:41:04 UTC) #43
vmpstr
This lgtm. It would be nice if someone else reviewed as well though. https://codereview.chromium.org/1532053002/diff/660001/ipc/ipc_message_templates.h File ...
4 years, 10 months ago (2016-02-05 01:24:31 UTC) #44
mdempsky
https://codereview.chromium.org/1532053002/diff/660001/ipc/ipc_message_templates.h File ipc/ipc_message_templates.h (right): https://codereview.chromium.org/1532053002/diff/660001/ipc/ipc_message_templates.h#newcode70 ipc/ipc_message_templates.h:70: // TODO(mdempsky): Reevaluate once MSVC 2015. On 2016/02/05 01:24:31, ...
4 years, 10 months ago (2016-02-05 02:06:11 UTC) #45
mdempsky
+tsepez for ipc/OWNERS
4 years, 10 months ago (2016-02-05 18:42:24 UTC) #47
Tom Sepez
On 2016/02/05 18:42:24, mdempsky wrote: > +tsepez for ipc/OWNERS I like it, but I'm still ...
4 years, 10 months ago (2016-02-05 19:16:20 UTC) #49
Tom Sepez
Next question: Can we split off the template_export.h stuff into its own CL? There's got ...
4 years, 10 months ago (2016-02-05 19:23:08 UTC) #50
mdempsky
On 2016/02/05 19:23:08, Tom Sepez wrote: > Next question: Can we split off the template_export.h ...
4 years, 10 months ago (2016-02-05 19:36:21 UTC) #51
mdempsky
https://codereview.chromium.org/1532053002/diff/720001/base/export_template.h File base/export_template.h (right): https://codereview.chromium.org/1532053002/diff/720001/base/export_template.h#newcode15 base/export_template.h:15: // instantiation definition instead. On 2016/02/05 19:23:08, Tom Sepez ...
4 years, 10 months ago (2016-02-05 19:38:39 UTC) #52
Tom Sepez
https://codereview.chromium.org/1532053002/diff/720001/ipc/ipc_message_macros.h File ipc/ipc_message_macros.h (right): https://codereview.chromium.org/1532053002/diff/720001/ipc/ipc_message_macros.h#newcode445 ipc/ipc_message_macros.h:445: #define IPC_SYNC_MESSAGE_CONTROL0_0 IPC_SYNC_MESSAGE_CONTROL0_x What does the compiler error message ...
4 years, 10 months ago (2016-02-05 19:44:24 UTC) #53
mdempsky
https://codereview.chromium.org/1532053002/diff/720001/ipc/ipc_message_macros.h File ipc/ipc_message_macros.h (right): https://codereview.chromium.org/1532053002/diff/720001/ipc/ipc_message_macros.h#newcode445 ipc/ipc_message_macros.h:445: #define IPC_SYNC_MESSAGE_CONTROL0_0 IPC_SYNC_MESSAGE_CONTROL0_x On 2016/02/05 19:44:24, Tom Sepez wrote: ...
4 years, 10 months ago (2016-02-05 19:49:54 UTC) #54
Tom Sepez
https://codereview.chromium.org/1532053002/diff/740001/ipc/ipc_message_macros.h File ipc/ipc_message_macros.h (right): https://codereview.chromium.org/1532053002/diff/740001/ipc/ipc_message_macros.h#newcode258 ipc/ipc_message_macros.h:258: using msg_name = IPC::MessageT<msg_name##_Meta>; \ I would have guessed ...
4 years, 10 months ago (2016-02-05 19:58:49 UTC) #55
mdempsky
https://codereview.chromium.org/1532053002/diff/720001/ipc/ipc_message_macros.h File ipc/ipc_message_macros.h (right): https://codereview.chromium.org/1532053002/diff/720001/ipc/ipc_message_macros.h#newcode445 ipc/ipc_message_macros.h:445: #define IPC_SYNC_MESSAGE_CONTROL0_0 IPC_SYNC_MESSAGE_CONTROL0_x (Done in PS39, BTW.) https://codereview.chromium.org/1532053002/diff/740001/ipc/ipc_message_macros.h File ...
4 years, 10 months ago (2016-02-05 20:03:39 UTC) #56
Tom Sepez
https://codereview.chromium.org/1532053002/diff/740001/ipc/ipc_message_macros.h File ipc/ipc_message_macros.h (right): https://codereview.chromium.org/1532053002/diff/740001/ipc/ipc_message_macros.h#newcode258 ipc/ipc_message_macros.h:258: using msg_name = IPC::MessageT<msg_name##_Meta>; \ On 2016/02/05 20:03:39, mdempsky ...
4 years, 10 months ago (2016-02-05 20:08:38 UTC) #57
Tom Sepez
Its elegant. What does it do to the binary size? LGTM otherwise.
4 years, 10 months ago (2016-02-05 20:22:32 UTC) #58
mdempsky
On 2016/02/05 20:22:32, Tom Sepez wrote: > Its elegant. What does it do to the ...
4 years, 10 months ago (2016-02-05 20:25:58 UTC) #59
Tom Sepez
https://codereview.chromium.org/1532053002/diff/760001/ipc/ipc_message_macros.h File ipc/ipc_message_macros.h (right): https://codereview.chromium.org/1532053002/diff/760001/ipc/ipc_message_macros.h#newcode403 ipc/ipc_message_macros.h:403: // TODO(mdempsky): Replace uses with generic names. note: Now ...
4 years, 10 months ago (2016-02-05 20:26:52 UTC) #60
mdempsky
https://codereview.chromium.org/1532053002/diff/760001/ipc/ipc_message_macros.h File ipc/ipc_message_macros.h (right): https://codereview.chromium.org/1532053002/diff/760001/ipc/ipc_message_macros.h#newcode403 ipc/ipc_message_macros.h:403: // TODO(mdempsky): Replace uses with generic names. On 2016/02/05 ...
4 years, 10 months ago (2016-02-05 20:31:59 UTC) #61
mdempsky
danakj/dcheng: Interested whether you have any outstanding concerns. If not, I'll split out export_template.h into ...
4 years, 10 months ago (2016-02-05 20:34:10 UTC) #62
dcheng
My other main question is why does export_template.h need to be in //base? https://codereview.chromium.org/1532053002/diff/760001/components/nacl/browser/nacl_file_host.cc File ...
4 years, 10 months ago (2016-02-05 21:31:41 UTC) #63
mdempsky
On 2016/02/05 21:31:41, dcheng wrote: > My other main question is why does export_template.h need ...
4 years, 10 months ago (2016-02-05 22:36:06 UTC) #64
jam
On 2016/02/05 19:16:20, Tom Sepez wrote: > On 2016/02/05 18:42:24, mdempsky wrote: > > +tsepez ...
4 years, 10 months ago (2016-02-05 22:43:50 UTC) #65
mdempsky
+thestig for base/OWNERS thestig: It seems the only remaining point of contention for this CL ...
4 years, 10 months ago (2016-02-08 21:49:05 UTC) #67
Lei Zhang
On 2016/02/08 21:49:05, mdempsky wrote: > +thestig for base/OWNERS > > thestig: It seems the ...
4 years, 10 months ago (2016-02-09 01:57:46 UTC) #68
mdempsky
On 2016/02/09 01:57:46, Lei Zhang wrote: > How about we stick this in ipc/ for ...
4 years, 10 months ago (2016-02-09 02:06:53 UTC) #69
mdempsky
TBR: mseaborn for components/nacl (see https://codereview.chromium.org/1532053002/diff/660001/components/nacl/browser/nacl_file_host.cc for rationale on WriteFileInfoReply change) jam for content/renderer
4 years, 10 months ago (2016-02-09 03:05:53 UTC) #72
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532053002/800001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532053002/800001
4 years, 10 months ago (2016-02-09 03:08:43 UTC) #75
commit-bot: I haz the power
Committed patchset #41 (id:800001)
4 years, 10 months ago (2016-02-09 05:41:56 UTC) #77
commit-bot: I haz the power
Patchset 41 (id:??) landed as https://crrev.com/8a5190449d48e06efa581390426dfa3bb6750f4c Cr-Commit-Position: refs/heads/master@{#374316}
4 years, 10 months ago (2016-02-09 05:42:53 UTC) #79
Mark Seaborn
4 years, 10 months ago (2016-02-09 18:16:56 UTC) #80
Message was sent while issue was closed.
On 2016/02/09 03:05:53, mdempsky wrote:
> TBR:
> 
> mseaborn for components/nacl (see
>
https://codereview.chromium.org/1532053002/diff/660001/components/nacl/browse...
> for rationale on WriteFileInfoReply change)

LGTM for components/nacl/.

Powered by Google App Engine
This is Rietveld 408576698