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

Issue 20015: Make it easier to create new IPC channel types (i.e. renderer/plugin). Inste... (Closed)

Created:
11 years, 10 months ago by jam
Modified:
9 years, 7 months ago
Reviewers:
amit, Matt Perry, M-A Ruel
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Make it easier/less work/less error-prone to create new IPC channel types (i.e. renderer/plugin).Instead of having each message file include the internal one several times with different ifdefs, move that logic to ipc_message_macros.h. Also make the message class starting IDs come from an enum to ensure we don't use a value twice. I simplified the logging code a bit so we don't need X_messages.cc files.Clean up places that we were doing manual packing/unpacking. Most of this was in the automation code. I added a few new template functions to make it convenient to read the parameters from a message, and updated the code to use them.I also removed unnecessary includes of render/plugin_messages.h from headers to speed up compiling.I moved the traits of IPC structs beside the struct definition to make it more apparent what's going on, so we avoid people modifying the struct and forgetting to update the traits.Amit: please look at chrome/test/automation/tab_proxy.ccMarc-Antoine: chrome/browser/printing/*Matt: the rest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=9123

Patch Set 1 #

Total comments: 39

Patch Set 2 : '' #

Total comments: 3

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1530 lines, -1854 lines) Patch
M chrome/browser/automation/automation_provider.cc View 2 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/browser_accessibility.h View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/browser_accessibility.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/browser_accessibility_manager.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/browser_accessibility_manager.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/printing/print_view_manager.h View 1 2 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/printing/print_view_manager.cc View 1 2 3 chunks +0 lines, -21 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 1 2 3 chunks +5 lines, -18 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host_delegate.h View 1 2 3 chunks +10 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.h View 2 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view.h View 1 2 3 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_win.h View 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_win.cc View 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/test_render_view_host.h View 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/resource_message_filter.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/resource_message_filter.cc View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/ssl/ssl_uitest.cc View 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/tab_contents/interstitial_page.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/tab_contents/ipc_status_view.cc View 1 2 4 chunks +17 lines, -16 lines 0 comments Download
M chrome/browser/tab_contents/web_contents.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/common.scons View 1 2 2 chunks +0 lines, -3 lines 0 comments Download
M chrome/common/common.vcproj View 1 2 2 chunks +0 lines, -8 lines 0 comments Download
M chrome/common/ipc_fuzzing_tests.cc View 1 2 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/common/ipc_logging.h View 2 5 chunks +13 lines, -4 lines 0 comments Download
M chrome/common/ipc_logging.cc View 1 2 3 chunks +15 lines, -15 lines 0 comments Download
M chrome/common/ipc_message_macros.h View 1 2 9 chunks +34 lines, -20 lines 0 comments Download
M chrome/common/ipc_message_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/common/ipc_message_utils.h View 1 2 62 chunks +256 lines, -191 lines 0 comments Download
M chrome/common/ipc_message_utils.cc View 10 chunks +12 lines, -17 lines 0 comments Download
D chrome/common/ipc_sync_channel_unittest.h View 1 2 1 chunk +0 lines, -19 lines 0 comments Download
M chrome/common/ipc_sync_channel_unittest.cc View 1 2 1 chunk +2 lines, -5 lines 0 comments Download
M chrome/common/ipc_sync_message_unittest.h View 1 2 1 chunk +10 lines, -1 line 0 comments Download
M chrome/common/ipc_sync_message_unittest.cc View 1 2 1 chunk +2 lines, -6 lines 0 comments Download
M chrome/common/plugin_messages.h View 1 2 13 chunks +169 lines, -183 lines 0 comments Download
D chrome/common/plugin_messages.cc View 1 2 1 chunk +0 lines, -23 lines 0 comments Download
M chrome/common/plugin_messages_internal.h View 1 2 5 chunks +5 lines, -5 lines 0 comments Download
M chrome/common/render_messages.h View 1 2 44 chunks +627 lines, -669 lines 0 comments Download
D chrome/common/render_messages.cc View 1 2 1 chunk +0 lines, -22 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 4 chunks +7 lines, -7 lines 0 comments Download
M chrome/common/resource_dispatcher_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/common/security_filter_peer.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/temp_scaffolding_stubs.h View 5 chunks +6 lines, -3 lines 0 comments Download
M chrome/plugin/chrome_plugin_host.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/plugin/webplugin_delegate_stub.h View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M chrome/renderer/render_view.cc View 1 2 1 chunk +1 line, -6 lines 0 comments Download
M chrome/renderer/render_widget.h View 1 2 2 chunks +6 lines, -20 lines 0 comments Download
M chrome/renderer/render_widget.cc View 1 2 2 chunks +21 lines, -0 lines 0 comments Download
M chrome/renderer/webplugin_delegate_proxy.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/renderer/webplugin_delegate_proxy.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/automation/autocomplete_edit_proxy.h View 3 chunks +2 lines, -5 lines 0 comments Download
M chrome/test/automation/automation_messages.h View 1 2 2 chunks +3 lines, -20 lines 0 comments Download
M chrome/test/automation/automation_messages_internal.h View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/test/automation/automation_proxy.cc View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M chrome/test/automation/tab_proxy.cc View 1 2 39 chunks +240 lines, -489 lines 0 comments Download
M chrome/test/unit/unit_tests.scons View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/unit/unittests.vcproj View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M webkit/glue/glue_accessibility.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M webkit/glue/glue_accessibility.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
jam
11 years, 10 months ago (2009-02-03 09:34:00 UTC) #1
jam
http://codereview.chromium.org/20015/diff/1/11 File chrome/common/ipc_fuzzing_tests.cc (right): http://codereview.chromium.org/20015/diff/1/11#newcode99 Line 99: // We don't actually use the messages defined ...
11 years, 10 months ago (2009-02-03 09:34:32 UTC) #2
amit
nice work! http://codereview.chromium.org/20015/diff/1/5 File chrome/test/automation/tab_proxy.cc (right): http://codereview.chromium.org/20015/diff/1/5#newcode121 Line 121: return matches; should set active_ordinal before ...
11 years, 10 months ago (2009-02-03 18:53:06 UTC) #3
M-A Ruel
Looks good to me. Most of the comments are nits except the enum thing. I ...
11 years, 10 months ago (2009-02-03 19:35:06 UTC) #4
Matt Perry
nice cleanup! http://codereview.chromium.org/20015/diff/1/12 File chrome/common/ipc_message_macros.h (right): http://codereview.chromium.org/20015/diff/1/12#newcode98 Line 98: #error This file should only be ...
11 years, 10 months ago (2009-02-03 20:08:59 UTC) #5
jam
Thanks, updated per comments. I also cleaned up the ipc_logging stuff a bit more & ...
11 years, 10 months ago (2009-02-03 21:16:40 UTC) #6
Matt Perry
LG http://codereview.chromium.org/20015/diff/1/12 File chrome/common/ipc_message_macros.h (right): http://codereview.chromium.org/20015/diff/1/12#newcode134 Line 134: label##Start = label##MsgStart << 12, \ On ...
11 years, 10 months ago (2009-02-03 21:31:30 UTC) #7
amit
OK http://codereview.chromium.org/20015/diff/1/5 File chrome/test/automation/tab_proxy.cc (right): http://codereview.chromium.org/20015/diff/1/5#newcode259 Line 259: if (succeeded) { On 2009/02/03 21:16:40, John ...
11 years, 10 months ago (2009-02-03 21:44:01 UTC) #8
M-A Ruel
11 years, 10 months ago (2009-02-03 21:48:00 UTC) #9
Some small nits, no need to reupload for these.

About ViewHostMsg_ImeControl, maybe you should extract it in its own header?
That's what have been done for many enums so we don't need to use a int. As you
prefer.

http://codereview.chromium.org/20015/diff/1061/1090
File chrome/browser/tab_contents/ipc_status_view.cc (right):

http://codereview.chromium.org/20015/diff/1061/1090#newcode69
Line 69: logger->RegisterMessageLogger(PluginProcessHostStart,
PluginProcessHostMsgLog);
80 cols, please visit
http://dev.chromium.org/developers/how-tos/visualstudio-tricks :)

http://codereview.chromium.org/20015/diff/1061/1071
File chrome/common/ipc_fuzzing_tests.cc (right):

http://codereview.chromium.org/20015/diff/1061/1071#newcode99
Line 99: // We don't actually use the messages defined in this fiel, but we do
this
uh?

http://codereview.chromium.org/20015/diff/1061/1101
File chrome/common/ipc_logging.cc (right):

http://codereview.chromium.org/20015/diff/1061/1101#newcode269
Line 269: }
}  // namespace IPC

Powered by Google App Engine
This is Rietveld 408576698