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

Issue 24514003: Make BrowserMessageFilter not derive from IPC::ChannelProxy::MessageFilter. This allows us to hide … (Closed)

Created:
7 years, 2 months ago by jam
Modified:
5 years, 7 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, cbentzel+watch_chromium.org, gavinp+prer_chromium.org, tburkard+watch_chromium.org, tzik+watch_chromium.org, jam, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, dominich+watch_chromium.org, dsinclair+watch_chromium.org, darin-cc_chromium.org, chromium-apps-reviews_chromium.org, kinuko+watch, native-client-reviews_googlegroups.com, wjia+watch_chromium.org, jochen+watch_chromium.org, miu+watch_chromium.org
Visibility:
Public.

Description

Make BrowserMessageFilter not derive from IPC::ChannelProxy::MessageFilter. This allows us to hide the OnMessageReceived which shouldn't be overridden from child classes, and also avoid the pattern of requiring an overridden method to have to call to the base class. R=scherkus@chromium.org, scherkus Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=226251

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 15

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : sync and flip ownership again #

Total comments: 3

Patch Set 10 : clang #

Patch Set 11 : sync #

Patch Set 12 : sync #

Unified diffs Side-by-side diffs Delta from patch set Stats (+338 lines, -276 lines) Patch
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +13 lines, -16 lines 0 comments Download
M chrome/browser/media/chrome_webrtc_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/nacl_host/nacl_host_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/prerender/prerender_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M content/browser/appcache/appcache_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/browser_child_process_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/browser_child_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +7 lines, -3 lines 0 comments Download
M content/browser/dom_storage/dom_storage_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -4 lines 0 comments Download
M content/browser/fileapi/fileapi_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -2 lines 0 comments Download
M content/browser/fileapi/fileapi_message_filter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +8 lines, -15 lines 0 comments Download
M content/browser/histogram_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/histogram_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -4 lines 0 comments Download
M content/browser/indexed_db/indexed_db_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -4 lines 0 comments Download
M content/browser/loader/resource_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/plugin_process_host.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/plugin_process_host.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -5 lines 0 comments Download
M content/browser/ppapi_plugin_process_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M content/browser/profiler_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/renderer_host/DEPS View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/database_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/audio_input_renderer_host.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/audio_input_renderer_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/media/device_request_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/midi_host.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/midi_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -6 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +48 lines, -44 lines 0 comments Download
M content/browser/resolve_proxy_msg_helper_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +20 lines, -2 lines 0 comments Download
M content/browser/tracing/trace_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/tracing/trace_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -8 lines 0 comments Download
M content/browser/worker_host/worker_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/worker_host/worker_process_host.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -13 lines 0 comments Download
M content/public/browser/browser_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +44 lines, -11 lines 0 comments Download
M content/public/browser/browser_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +82 lines, -51 lines 0 comments Download
M content/public/browser/render_process_host.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +7 lines, -6 lines 0 comments Download
M content/public/test/mock_render_process_host.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/mock_render_process_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M content/shell/browser/shell_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M content/test/webrtc_audio_device_test.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -4 lines 0 comments Download
M content/test/webrtc_audio_device_test.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +70 lines, -14 lines 0 comments Download
M ipc/ipc_channel_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -16 lines 0 comments Download
M ipc/ipc_channel_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
jam
7 years, 2 months ago (2013-09-26 18:01:10 UTC) #1
scherkus (not reviewing)
I'm amazed at the amount of unnecessary superclass-calling code that was removed! few nits & ...
7 years, 2 months ago (2013-09-26 19:57:37 UTC) #2
scherkus (not reviewing)
https://codereview.chromium.org/24514003/diff/98001/ipc/ipc_channel_proxy.h File ipc/ipc_channel_proxy.h (right): https://codereview.chromium.org/24514003/diff/98001/ipc/ipc_channel_proxy.h#newcode61 ipc/ipc_channel_proxy.h:61: : public base::RefCountedThreadSafe<MessageFilter> { On 2013/09/26 19:57:37, scherkus wrote: ...
7 years, 2 months ago (2013-09-26 19:58:33 UTC) #3
jam
https://codereview.chromium.org/24514003/diff/98001/content/public/browser/browser_message_filter.cc File content/public/browser/browser_message_filter.cc (right): https://codereview.chromium.org/24514003/diff/98001/content/public/browser/browser_message_filter.cc#newcode28 content/public/browser/browser_message_filter.cc:28: filter_->internal_ = NULL; On 2013/09/26 19:57:37, scherkus wrote: > ...
7 years, 2 months ago (2013-09-26 20:22:38 UTC) #4
michaeln
https://codereview.chromium.org/24514003/diff/98001/content/browser/dom_storage/dom_storage_message_filter.cc File content/browser/dom_storage/dom_storage_message_filter.cc (left): https://codereview.chromium.org/24514003/diff/98001/content/browser/dom_storage/dom_storage_message_filter.cc#oldcode49 content/browser/dom_storage/dom_storage_message_filter.cc:49: DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); is this no longer executed on the IO ...
7 years, 2 months ago (2013-09-26 20:30:15 UTC) #5
jam
https://codereview.chromium.org/24514003/diff/98001/content/browser/dom_storage/dom_storage_message_filter.cc File content/browser/dom_storage/dom_storage_message_filter.cc (left): https://codereview.chromium.org/24514003/diff/98001/content/browser/dom_storage/dom_storage_message_filter.cc#oldcode49 content/browser/dom_storage/dom_storage_message_filter.cc:49: DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); On 2013/09/26 20:30:16, michaeln wrote: > is this ...
7 years, 2 months ago (2013-09-26 20:33:17 UTC) #6
michaeln
On 2013/09/26 20:33:17, jam wrote: > https://codereview.chromium.org/24514003/diff/98001/content/browser/dom_storage/dom_storage_message_filter.cc > File content/browser/dom_storage/dom_storage_message_filter.cc (left): > > https://codereview.chromium.org/24514003/diff/98001/content/browser/dom_storage/dom_storage_message_filter.cc#oldcode49 > ...
7 years, 2 months ago (2013-09-26 21:16:34 UTC) #7
scherkus (not reviewing)
lgtm
7 years, 2 months ago (2013-09-26 21:48:27 UTC) #8
scherkus (not reviewing)
On 2013/09/26 21:48:27, scherkus wrote: > lgtm (pending michaeln's concerns)
7 years, 2 months ago (2013-09-26 21:49:06 UTC) #9
scherkus (not reviewing)
wait ......... does this work as intended? For example: AddFilter(new OrientationMessageFilter()); OMF will have a ...
7 years, 2 months ago (2013-09-26 21:58:14 UTC) #10
jam
I ran into a number of issues switching the ownership, so I switched it to ...
7 years, 2 months ago (2013-09-27 20:57:23 UTC) #11
scherkus (not reviewing)
lgtm https://codereview.chromium.org/24514003/diff/192001/content/public/browser/browser_message_filter.cc File content/public/browser/browser_message_filter.cc (right): https://codereview.chromium.org/24514003/diff/192001/content/public/browser/browser_message_filter.cc#newcode192 content/public/browser/browser_message_filter.cc:192: // We create this on demand so that ...
7 years, 2 months ago (2013-09-27 21:18:42 UTC) #12
scherkus (not reviewing)
7 years, 2 months ago (2013-09-27 21:19:31 UTC) #13
you've got some compile failures too:

../../content/browser/resolve_proxy_msg_helper_unittest.cc:30:7: error:
[chromium-style] Classes that are ref-counted should have explicit destructors
that are declared protected or private.
class TestResolveProxyMsgHelper : public ResolveProxyMsgHelper {

Powered by Google App Engine
This is Rietveld 408576698