diff options
author | morrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-13 06:07:14 +0000 |
---|---|---|
committer | morrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-13 06:07:14 +0000 |
commit | d1549b8de5f07af6de2e1e58d3e6ce8ec6754f60 (patch) | |
tree | 78246b8aa9134c47dda365f11e822e6c2e6d69cf | |
parent | 12a63dac960d6714b9d6d863117ac4d734f283d4 (diff) | |
download | chromium_src-d1549b8de5f07af6de2e1e58d3e6ce8ec6754f60.zip chromium_src-d1549b8de5f07af6de2e1e58d3e6ce8ec6754f60.tar.gz chromium_src-d1549b8de5f07af6de2e1e58d3e6ce8ec6754f60.tar.bz2 |
Decouple IPC::MessageFilter from IPC::Channel
This change gets rid of Channel dependency from MessageFilter
so that it depends only on IPC::Sender.
TEST=none
BUG=377980
R=jam@chromium.org, darin@chromium.org
Review URL: https://codereview.chromium.org/324143002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276939 0039d316-1c4b-4281-b951-d872f2087c98
51 files changed, 192 insertions, 197 deletions
diff --git a/chrome/renderer/media/cast_ipc_dispatcher.cc b/chrome/renderer/media/cast_ipc_dispatcher.cc index 5be1075..d1c7f9e 100644 --- a/chrome/renderer/media/cast_ipc_dispatcher.cc +++ b/chrome/renderer/media/cast_ipc_dispatcher.cc @@ -12,7 +12,7 @@ CastIPCDispatcher* CastIPCDispatcher::global_instance_ = NULL; CastIPCDispatcher::CastIPCDispatcher( const scoped_refptr<base::MessageLoopProxy>& io_message_loop) - : channel_(NULL), + : sender_(NULL), io_message_loop_(io_message_loop) { DCHECK(io_message_loop_); DCHECK(!global_instance_); @@ -29,8 +29,8 @@ CastIPCDispatcher* CastIPCDispatcher::Get() { void CastIPCDispatcher::Send(IPC::Message* message) { DCHECK(io_message_loop_->BelongsToCurrentThread()); - if (channel_) { - channel_->Send(message); + if (sender_) { + sender_->Send(message); } else { delete message; } @@ -56,18 +56,18 @@ bool CastIPCDispatcher::OnMessageReceived(const IPC::Message& message) { return handled; } -void CastIPCDispatcher::OnFilterAdded(IPC::Channel* channel) { +void CastIPCDispatcher::OnFilterAdded(IPC::Sender* sender) { DCHECK(io_message_loop_->BelongsToCurrentThread()); DCHECK(!global_instance_); global_instance_ = this; - channel_ = channel; + sender_ = sender; } void CastIPCDispatcher::OnFilterRemoved() { DCHECK(io_message_loop_->BelongsToCurrentThread()); DCHECK_EQ(this, global_instance_); global_instance_ = NULL; - channel_ = NULL; + sender_ = NULL; } void CastIPCDispatcher::OnChannelClosing() { diff --git a/chrome/renderer/media/cast_ipc_dispatcher.h b/chrome/renderer/media/cast_ipc_dispatcher.h index 320b797..82af570 100644 --- a/chrome/renderer/media/cast_ipc_dispatcher.h +++ b/chrome/renderer/media/cast_ipc_dispatcher.h @@ -29,7 +29,7 @@ class CastIPCDispatcher : public IPC::MessageFilter { // IPC::MessageFilter implementation virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual void OnChannelClosing() OVERRIDE; @@ -52,8 +52,8 @@ class CastIPCDispatcher : public IPC::MessageFilter { static CastIPCDispatcher* global_instance_; - // IPC channel for Send(); must only be accesed on |io_message_loop_|. - IPC::Channel* channel_; + // For IPC Send(); must only be accesed on |io_message_loop_|. + IPC::Sender* sender_; // Message loop on which IPC calls are driven. const scoped_refptr<base::MessageLoopProxy> io_message_loop_; diff --git a/chrome/renderer/media/webrtc_logging_message_filter.cc b/chrome/renderer/media/webrtc_logging_message_filter.cc index 83ad4d6..8177aea 100644 --- a/chrome/renderer/media/webrtc_logging_message_filter.cc +++ b/chrome/renderer/media/webrtc_logging_message_filter.cc @@ -14,7 +14,7 @@ WebRtcLoggingMessageFilter::WebRtcLoggingMessageFilter( const scoped_refptr<base::MessageLoopProxy>& io_message_loop) : io_message_loop_(io_message_loop), log_message_delegate_(NULL), - channel_(NULL) { + sender_(NULL) { // May be null in a browsertest using MockRenderThread. if (io_message_loop_) { io_message_loop_->PostTask( @@ -39,20 +39,20 @@ bool WebRtcLoggingMessageFilter::OnMessageReceived( return handled; } -void WebRtcLoggingMessageFilter::OnFilterAdded(IPC::Channel* channel) { +void WebRtcLoggingMessageFilter::OnFilterAdded(IPC::Sender* sender) { DCHECK(!io_message_loop_ || io_message_loop_->BelongsToCurrentThread()); - channel_ = channel; + sender_ = sender; } void WebRtcLoggingMessageFilter::OnFilterRemoved() { DCHECK(!io_message_loop_ || io_message_loop_->BelongsToCurrentThread()); - channel_ = NULL; + sender_ = NULL; log_message_delegate_->OnFilterRemoved(); } void WebRtcLoggingMessageFilter::OnChannelClosing() { DCHECK(!io_message_loop_ || io_message_loop_->BelongsToCurrentThread()); - channel_ = NULL; + sender_ = NULL; log_message_delegate_->OnFilterRemoved(); } @@ -85,10 +85,10 @@ void WebRtcLoggingMessageFilter::OnStopLogging() { void WebRtcLoggingMessageFilter::Send(IPC::Message* message) { DCHECK(!io_message_loop_ || io_message_loop_->BelongsToCurrentThread()); - if (!channel_) { - DLOG(ERROR) << "IPC channel not available."; + if (!sender_) { + DLOG(ERROR) << "IPC sender not available."; delete message; } else { - channel_->Send(message); + sender_->Send(message); } } diff --git a/chrome/renderer/media/webrtc_logging_message_filter.h b/chrome/renderer/media/webrtc_logging_message_filter.h index 7d869f5..f608c21 100644 --- a/chrome/renderer/media/webrtc_logging_message_filter.h +++ b/chrome/renderer/media/webrtc_logging_message_filter.h @@ -48,7 +48,7 @@ class WebRtcLoggingMessageFilter : public IPC::MessageFilter { private: // IPC::MessageFilter implementation. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual void OnChannelClosing() OVERRIDE; @@ -58,7 +58,7 @@ class WebRtcLoggingMessageFilter : public IPC::MessageFilter { void OnStopLogging(); void Send(IPC::Message* message); - IPC::Channel* channel_; + IPC::Sender* sender_; DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingMessageFilter); }; diff --git a/components/nacl/renderer/pnacl_translation_resource_host.cc b/components/nacl/renderer/pnacl_translation_resource_host.cc index 087c804..5ac1e8a 100644 --- a/components/nacl/renderer/pnacl_translation_resource_host.cc +++ b/components/nacl/renderer/pnacl_translation_resource_host.cc @@ -21,26 +21,26 @@ PnaclTranslationResourceHost::CacheRequestInfo::~CacheRequestInfo() {} PnaclTranslationResourceHost::PnaclTranslationResourceHost( const scoped_refptr<base::MessageLoopProxy>& io_message_loop) - : io_message_loop_(io_message_loop), channel_(NULL) {} + : io_message_loop_(io_message_loop), sender_(NULL) {} PnaclTranslationResourceHost::~PnaclTranslationResourceHost() { DCHECK(io_message_loop_->BelongsToCurrentThread()); CleanupCacheRequests(); } -void PnaclTranslationResourceHost::OnFilterAdded(IPC::Channel* channel) { +void PnaclTranslationResourceHost::OnFilterAdded(IPC::Sender* sender) { DCHECK(io_message_loop_->BelongsToCurrentThread()); - channel_ = channel; + sender_ = sender; } void PnaclTranslationResourceHost::OnFilterRemoved() { DCHECK(io_message_loop_->BelongsToCurrentThread()); - channel_ = NULL; + sender_ = NULL; } void PnaclTranslationResourceHost::OnChannelClosing() { DCHECK(io_message_loop_->BelongsToCurrentThread()); - channel_ = NULL; + sender_ = NULL; } bool PnaclTranslationResourceHost::OnMessageReceived( @@ -84,8 +84,8 @@ void PnaclTranslationResourceHost::SendRequestNexeFd( PP_FileHandle* file_handle, scoped_refptr<TrackedCallback> callback) { DCHECK(io_message_loop_->BelongsToCurrentThread()); - if (!channel_ || !channel_->Send(new NaClHostMsg_NexeTempFileRequest( - render_view_id, instance, cache_info))) { + if (!sender_ || !sender_->Send(new NaClHostMsg_NexeTempFileRequest( + render_view_id, instance, cache_info))) { PpapiGlobals::Get()->GetMainThreadMessageLoop() ->PostTask(FROM_HERE, base::Bind(&TrackedCallback::Run, @@ -115,13 +115,13 @@ void PnaclTranslationResourceHost::SendReportTranslationFinished( PP_Instance instance, PP_Bool success) { DCHECK(io_message_loop_->BelongsToCurrentThread()); - // If the channel is closed or we have been detached, we are probably shutting + // If the sender is closed or we have been detached, we are probably shutting // down, so just don't send anything. - if (!channel_) + if (!sender_) return; DCHECK(pending_cache_requests_.count(instance) == 0); - channel_->Send(new NaClHostMsg_ReportTranslationFinished(instance, - PP_ToBool(success))); + sender_->Send(new NaClHostMsg_ReportTranslationFinished(instance, + PP_ToBool(success))); } void PnaclTranslationResourceHost::OnNexeTempFileReply( diff --git a/components/nacl/renderer/pnacl_translation_resource_host.h b/components/nacl/renderer/pnacl_translation_resource_host.h index 7b41362..5a92f8e 100644 --- a/components/nacl/renderer/pnacl_translation_resource_host.h +++ b/components/nacl/renderer/pnacl_translation_resource_host.h @@ -56,7 +56,7 @@ class PnaclTranslationResourceHost : public IPC::MessageFilter { typedef std::map<PP_Instance, CacheRequestInfo> CacheRequestInfoMap; // IPC::MessageFilter implementation. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual void OnChannelClosing() OVERRIDE; @@ -76,7 +76,7 @@ class PnaclTranslationResourceHost : public IPC::MessageFilter { scoped_refptr<base::MessageLoopProxy> io_message_loop_; // Should be accessed on the io thread. - IPC::Channel* channel_; + IPC::Sender* sender_; CacheRequestInfoMap pending_cache_requests_; DISALLOW_COPY_AND_ASSIGN(PnaclTranslationResourceHost); }; diff --git a/components/tracing/child_trace_message_filter.cc b/components/tracing/child_trace_message_filter.cc index 46cdf33..3df0f70 100644 --- a/components/tracing/child_trace_message_filter.cc +++ b/components/tracing/child_trace_message_filter.cc @@ -15,16 +15,16 @@ namespace tracing { ChildTraceMessageFilter::ChildTraceMessageFilter( base::MessageLoopProxy* ipc_message_loop) - : channel_(NULL), + : sender_(NULL), ipc_message_loop_(ipc_message_loop) {} -void ChildTraceMessageFilter::OnFilterAdded(IPC::Channel* channel) { - channel_ = channel; - channel_->Send(new TracingHostMsg_ChildSupportsTracing()); +void ChildTraceMessageFilter::OnFilterAdded(IPC::Sender* sender) { + sender_ = sender; + sender_->Send(new TracingHostMsg_ChildSupportsTracing()); } void ChildTraceMessageFilter::OnFilterRemoved() { - channel_ = NULL; + sender_ = NULL; } bool ChildTraceMessageFilter::OnMessageReceived(const IPC::Message& message) { @@ -105,7 +105,7 @@ void ChildTraceMessageFilter::OnCaptureMonitoringSnapshot() { void ChildTraceMessageFilter::OnGetTraceBufferPercentFull() { float bpf = TraceLog::GetInstance()->GetBufferPercentFull(); - channel_->Send(new TracingHostMsg_TraceBufferPercentFullReply(bpf)); + sender_->Send(new TracingHostMsg_TraceBufferPercentFullReply(bpf)); } void ChildTraceMessageFilter::OnSetWatchEvent(const std::string& category_name, @@ -125,7 +125,7 @@ void ChildTraceMessageFilter::OnWatchEventMatched() { base::Bind(&ChildTraceMessageFilter::OnWatchEventMatched, this)); return; } - channel_->Send(new TracingHostMsg_WatchEventMatched); + sender_->Send(new TracingHostMsg_WatchEventMatched); } void ChildTraceMessageFilter::OnTraceDataCollected( @@ -138,13 +138,13 @@ void ChildTraceMessageFilter::OnTraceDataCollected( return; } if (events_str_ptr->data().size()) { - channel_->Send(new TracingHostMsg_TraceDataCollected( + sender_->Send(new TracingHostMsg_TraceDataCollected( events_str_ptr->data())); } if (!has_more_events) { std::vector<std::string> category_groups; TraceLog::GetInstance()->GetKnownCategoryGroups(&category_groups); - channel_->Send(new TracingHostMsg_EndTracingAck(category_groups)); + sender_->Send(new TracingHostMsg_EndTracingAck(category_groups)); } } @@ -160,11 +160,11 @@ void ChildTraceMessageFilter::OnMonitoringTraceDataCollected( has_more_events)); return; } - channel_->Send(new TracingHostMsg_MonitoringTraceDataCollected( + sender_->Send(new TracingHostMsg_MonitoringTraceDataCollected( events_str_ptr->data())); if (!has_more_events) - channel_->Send(new TracingHostMsg_CaptureMonitoringSnapshotAck()); + sender_->Send(new TracingHostMsg_CaptureMonitoringSnapshotAck()); } } // namespace tracing diff --git a/components/tracing/child_trace_message_filter.h b/components/tracing/child_trace_message_filter.h index cc52418..5bd993e 100644 --- a/components/tracing/child_trace_message_filter.h +++ b/components/tracing/child_trace_message_filter.h @@ -21,7 +21,7 @@ class ChildTraceMessageFilter : public IPC::MessageFilter { explicit ChildTraceMessageFilter(base::MessageLoopProxy* ipc_message_loop); // IPC::MessageFilter implementation. - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; @@ -54,7 +54,7 @@ class ChildTraceMessageFilter : public IPC::MessageFilter { const scoped_refptr<base::RefCountedString>& events_str_ptr, bool has_more_events); - IPC::Channel* channel_; + IPC::Sender* sender_; base::MessageLoopProxy* ipc_message_loop_; DISALLOW_COPY_AND_ASSIGN(ChildTraceMessageFilter); diff --git a/content/browser/dom_storage/dom_storage_message_filter.cc b/content/browser/dom_storage/dom_storage_message_filter.cc index 1ed4dd8..91d72d3 100644 --- a/content/browser/dom_storage/dom_storage_message_filter.cc +++ b/content/browser/dom_storage/dom_storage_message_filter.cc @@ -47,7 +47,7 @@ void DOMStorageMessageFilter::UninitializeInSequence() { host_.reset(); } -void DOMStorageMessageFilter::OnFilterAdded(IPC::Channel* channel) { +void DOMStorageMessageFilter::OnFilterAdded(IPC::Sender* sender) { context_->task_runner()->PostShutdownBlockingTask( FROM_HERE, DOMStorageTaskRunner::PRIMARY_SEQUENCE, diff --git a/content/browser/dom_storage/dom_storage_message_filter.h b/content/browser/dom_storage/dom_storage_message_filter.h index dc63c1c..346a8ff 100644 --- a/content/browser/dom_storage/dom_storage_message_filter.h +++ b/content/browser/dom_storage/dom_storage_message_filter.h @@ -40,7 +40,7 @@ class DOMStorageMessageFilter void UninitializeInSequence(); // BrowserMessageFilter implementation - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual base::TaskRunner* OverrideTaskRunnerForMessage( const IPC::Message& message) OVERRIDE; diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc index baa8a74..e5d4f78 100644 --- a/content/browser/renderer_host/media/audio_input_renderer_host.cc +++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc @@ -70,7 +70,7 @@ AudioInputRendererHost::~AudioInputRendererHost() { } void AudioInputRendererHost::OnChannelClosing() { - // Since the IPC channel is gone, close all requested audio streams. + // Since the IPC sender is gone, close all requested audio streams. DeleteEntries(); } diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc index 9334d94..7b07fd9 100644 --- a/content/browser/renderer_host/media/audio_renderer_host.cc +++ b/content/browser/renderer_host/media/audio_renderer_host.cc @@ -155,7 +155,7 @@ void AudioRendererHost::GetOutputControllers( } void AudioRendererHost::OnChannelClosing() { - // Since the IPC channel is gone, close all requested audio streams. + // Since the IPC sender is gone, close all requested audio streams. while (!audio_entries_.empty()) { // Note: OnCloseStream() removes the entries from audio_entries_. OnCloseStream(audio_entries_.begin()->first); diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host.cc b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc index 36f6794..6b382cd 100644 --- a/content/browser/renderer_host/media/media_stream_dispatcher_host.cc +++ b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc @@ -117,7 +117,7 @@ bool MediaStreamDispatcherHost::OnMessageReceived(const IPC::Message& message) { void MediaStreamDispatcherHost::OnChannelClosing() { DVLOG(1) << "MediaStreamDispatcherHost::OnChannelClosing"; - // Since the IPC channel is gone, close all requesting/requested streams. + // Since the IPC sender is gone, close all requesting/requested streams. media_stream_manager_->CancelAllRequests(render_process_id_); } diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc index be571bf..a7fdf9d 100644 --- a/content/browser/renderer_host/media/video_capture_host.cc +++ b/content/browser/renderer_host/media/video_capture_host.cc @@ -21,7 +21,7 @@ VideoCaptureHost::VideoCaptureHost(MediaStreamManager* media_stream_manager) VideoCaptureHost::~VideoCaptureHost() {} void VideoCaptureHost::OnChannelClosing() { - // Since the IPC channel is gone, close all requested VideoCaptureDevices. + // Since the IPC sender is gone, close all requested VideoCaptureDevices. for (EntryMap::iterator it = entries_.begin(); it != entries_.end(); ) { const base::WeakPtr<VideoCaptureController>& controller = it->second; if (controller) { diff --git a/content/browser/renderer_host/media/video_capture_host_unittest.cc b/content/browser/renderer_host/media/video_capture_host_unittest.cc index bc5ed577..6088081 100644 --- a/content/browser/renderer_host/media/video_capture_host_unittest.cc +++ b/content/browser/renderer_host/media/video_capture_host_unittest.cc @@ -309,7 +309,7 @@ class VideoCaptureHostTest : public testing::Test { CloseSession(); - // Simulate closing the IPC channel. + // Simulate closing the IPC sender. host_->OnChannelClosing(); // Release the reference to the mock object. The object will be destructed diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc index 002e513..bb8c1fb 100644 --- a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc +++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc @@ -105,7 +105,7 @@ P2PSocketDispatcherHost::P2PSocketDispatcherHost( } void P2PSocketDispatcherHost::OnChannelClosing() { - // Since the IPC channel is gone, close pending connections. + // Since the IPC sender is gone, close pending connections. STLDeleteContainerPairSecondPointers(sockets_.begin(), sockets_.end()); sockets_.clear(); diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc index 0a93b44..8cacc34 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host.cc +++ b/content/browser/service_worker/service_worker_dispatcher_host.cc @@ -70,8 +70,8 @@ void ServiceWorkerDispatcherHost::Init( render_process_id_, this); } -void ServiceWorkerDispatcherHost::OnFilterAdded(IPC::Channel* channel) { - BrowserMessageFilter::OnFilterAdded(channel); +void ServiceWorkerDispatcherHost::OnFilterAdded(IPC::Sender* sender) { + BrowserMessageFilter::OnFilterAdded(sender); channel_ready_ = true; std::vector<IPC::Message*> messages; pending_messages_.release(&messages); diff --git a/content/browser/service_worker/service_worker_dispatcher_host.h b/content/browser/service_worker/service_worker_dispatcher_host.h index 5288bae..b269311 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host.h +++ b/content/browser/service_worker/service_worker_dispatcher_host.h @@ -32,13 +32,13 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { void Init(ServiceWorkerContextWrapper* context_wrapper); // BrowserMessageFilter implementation - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnDestruct() const OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; // IPC::Sender implementation - // Send() queues the message until the underlying channel is ready. This + // Send() queues the message until the underlying sender is ready. This // class assumes that Send() can only fail after that when the renderer // process has terminated, at which point the whole instance will eventually // be destroyed. @@ -117,7 +117,7 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; - bool channel_ready_; // True after BrowserMessageFilter::channel_ != NULL. + bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. ScopedVector<IPC::Message> pending_messages_; DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); diff --git a/content/child/child_histogram_message_filter.cc b/content/child/child_histogram_message_filter.cc index cab7bea..3cf36ce 100644 --- a/content/child/child_histogram_message_filter.cc +++ b/content/child/child_histogram_message_filter.cc @@ -12,20 +12,20 @@ #include "content/child/child_process.h" #include "content/child/child_thread.h" #include "content/common/child_process_messages.h" -#include "ipc/ipc_channel.h" +#include "ipc/ipc_sender.h" namespace content { ChildHistogramMessageFilter::ChildHistogramMessageFilter() - : channel_(NULL), + : sender_(NULL), io_message_loop_(ChildProcess::current()->io_message_loop_proxy()) { } ChildHistogramMessageFilter::~ChildHistogramMessageFilter() { } -void ChildHistogramMessageFilter::OnFilterAdded(IPC::Channel* channel) { - channel_ = channel; +void ChildHistogramMessageFilter::OnFilterAdded(IPC::Sender* sender) { + sender_ = sender; } void ChildHistogramMessageFilter::OnFilterRemoved() { @@ -60,7 +60,7 @@ void ChildHistogramMessageFilter::UploadAllHistograms(int sequence_number) { std::vector<std::string> deltas; histogram_delta_serialization_->PrepareAndSerializeDeltas(&deltas); - channel_->Send( + sender_->Send( new ChildProcessHostMsg_ChildHistogramData(sequence_number, deltas)); static int count = 0; diff --git a/content/child/child_histogram_message_filter.h b/content/child/child_histogram_message_filter.h index 14aa740..34498c7 100644 --- a/content/child/child_histogram_message_filter.h +++ b/content/child/child_histogram_message_filter.h @@ -24,7 +24,7 @@ class ChildHistogramMessageFilter : public IPC::MessageFilter { ChildHistogramMessageFilter(); // IPC::MessageFilter implementation. - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; @@ -42,7 +42,7 @@ class ChildHistogramMessageFilter : public IPC::MessageFilter { // Send only a delta to what we have already sent. void UploadAllHistograms(int sequence_number); - IPC::Channel* channel_; + IPC::Sender* sender_; scoped_refptr<base::MessageLoopProxy> io_message_loop_; diff --git a/content/child/child_thread.cc b/content/child/child_thread.cc index 5e77c404..55cef8f 100644 --- a/content/child/child_thread.cc +++ b/content/child/child_thread.cc @@ -120,7 +120,7 @@ class SuicideOnChannelErrorFilter : public IPC::MessageFilter { // forever and leave behind a renderer process which eats 100% CPU forever. // // This is because the terminate signals (ViewMsg_ShouldClose and the error - // from the IPC channel) are routed to the main message loop but never + // from the IPC sender) are routed to the main message loop but never // processed (because that message loop is stuck in V8). // // One could make the browser SIGKILL the renderers, but that leaves open a @@ -128,7 +128,7 @@ class SuicideOnChannelErrorFilter : public IPC::MessageFilter { // the browser because "it's stuck") will leave behind a process eating all // the CPU. // - // So, we install a filter on the channel so that we can process this event + // So, we install a filter on the sender so that we can process this event // here and kill the process. // TODO(earthdok): Re-enable on CrOS http://crbug.com/360622 #if (defined(ADDRESS_SANITIZER) || defined(LEAK_SANITIZER) || \ diff --git a/content/common/font_cache_dispatcher_win.cc b/content/common/font_cache_dispatcher_win.cc index 3043079..2181a08 100644 --- a/content/common/font_cache_dispatcher_win.cc +++ b/content/common/font_cache_dispatcher_win.cc @@ -10,7 +10,6 @@ #include "base/logging.h" #include "base/strings/string16.h" #include "content/common/child_process_messages.h" -#include "ipc/ipc_channel.h" namespace content { namespace { @@ -136,14 +135,14 @@ class FontCache { } FontCacheDispatcher::FontCacheDispatcher() - : channel_(NULL) { + : sender_(NULL) { } FontCacheDispatcher::~FontCacheDispatcher() { } -void FontCacheDispatcher::OnFilterAdded(IPC::Channel* channel) { - channel_ = channel; +void FontCacheDispatcher::OnFilterAdded(IPC::Sender* sender) { + sender_ = sender; } bool FontCacheDispatcher::OnMessageReceived(const IPC::Message& message) { @@ -158,12 +157,12 @@ bool FontCacheDispatcher::OnMessageReceived(const IPC::Message& message) { } void FontCacheDispatcher::OnChannelClosing() { - channel_ = NULL; + sender_ = NULL; } bool FontCacheDispatcher::Send(IPC::Message* message) { - if (channel_) - return channel_->Send(message); + if (sender_) + return sender_->Send(message); delete message; return false; diff --git a/content/common/font_cache_dispatcher_win.h b/content/common/font_cache_dispatcher_win.h index c1f4ebf..913f857 100644 --- a/content/common/font_cache_dispatcher_win.h +++ b/content/common/font_cache_dispatcher_win.h @@ -12,10 +12,6 @@ #include "ipc/ipc_sender.h" #include "ipc/message_filter.h" -namespace IPC { -class Channel; -} - namespace content { // Dispatches messages used for font caching on Windows. This is needed because @@ -31,7 +27,7 @@ class FontCacheDispatcher : public IPC::MessageFilter, public IPC::Sender { private: // IPC::MessageFilter implementation: - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; virtual void OnChannelClosing() OVERRIDE; @@ -39,7 +35,7 @@ class FontCacheDispatcher : public IPC::MessageFilter, public IPC::Sender { void OnPreCacheFont(const LOGFONT& font); void OnReleaseCachedFonts(); - IPC::Channel* channel_; + IPC::Sender* sender_; DISALLOW_COPY_AND_ASSIGN(FontCacheDispatcher); }; diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc index 6262ed5..727bb89 100644 --- a/content/common/gpu/gpu_channel.cc +++ b/content/common/gpu/gpu_channel.cc @@ -77,24 +77,24 @@ class GpuChannelMessageFilter : public IPC::MessageFilter { scoped_refptr<base::MessageLoopProxy> message_loop) : preemption_state_(IDLE), gpu_channel_(gpu_channel), - channel_(NULL), + sender_(NULL), sync_point_manager_(sync_point_manager), message_loop_(message_loop), messages_forwarded_to_channel_(0), a_stub_is_descheduled_(false) {} - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE { - DCHECK(!channel_); - channel_ = channel; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE { + DCHECK(!sender_); + sender_ = sender; } virtual void OnFilterRemoved() OVERRIDE { - DCHECK(channel_); - channel_ = NULL; + DCHECK(sender_); + sender_ = NULL; } virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { - DCHECK(channel_); + DCHECK(sender_); bool handled = false; if (message.type() == GpuCommandBufferMsg_RetireSyncPoint::ID) { @@ -148,7 +148,7 @@ class GpuChannelMessageFilter : public IPC::MessageFilter { } bool Send(IPC::Message* message) { - return channel_->Send(message); + return sender_->Send(message); } protected: @@ -359,7 +359,7 @@ class GpuChannelMessageFilter : public IPC::MessageFilter { // NOTE: this weak pointer is never dereferenced on the IO thread, it's only // passed through - therefore the WeakPtr assumptions are respected. base::WeakPtr<GpuChannel> gpu_channel_; - IPC::Channel* channel_; + IPC::Sender* sender_; scoped_refptr<SyncPointManager> sync_point_manager_; scoped_refptr<base::MessageLoopProxy> message_loop_; scoped_refptr<gpu::PreemptionFlag> preempting_flag_; diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc index 4ac7073..0d315da 100644 --- a/content/common/gpu/media/gpu_video_decode_accelerator.cc +++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc @@ -76,12 +76,12 @@ class GpuVideoDecodeAccelerator::MessageFilter : public IPC::MessageFilter { MessageFilter(GpuVideoDecodeAccelerator* owner, int32 host_route_id) : owner_(owner), host_route_id_(host_route_id) {} - virtual void OnChannelError() OVERRIDE { channel_ = NULL; } + virtual void OnChannelError() OVERRIDE { sender_ = NULL; } - virtual void OnChannelClosing() OVERRIDE { channel_ = NULL; } + virtual void OnChannelClosing() OVERRIDE { sender_ = NULL; } - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE { - channel_ = channel; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE { + sender_ = sender; } virtual void OnFilterRemoved() OVERRIDE { @@ -103,11 +103,11 @@ class GpuVideoDecodeAccelerator::MessageFilter : public IPC::MessageFilter { bool SendOnIOThread(IPC::Message* message) { DCHECK(!message->is_sync()); - if (!channel_) { + if (!sender_) { delete message; return false; } - return channel_->Send(message); + return sender_->Send(message); } protected: @@ -116,8 +116,8 @@ class GpuVideoDecodeAccelerator::MessageFilter : public IPC::MessageFilter { private: GpuVideoDecodeAccelerator* owner_; int32 host_route_id_; - // The channel to which this filter was added. - IPC::Channel* channel_; + // The sender to which this filter was added. + IPC::Sender* sender_; }; GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator( diff --git a/content/plugin/plugin_channel.cc b/content/plugin/plugin_channel.cc index 9a566d5..0f96044 100644 --- a/content/plugin/plugin_channel.cc +++ b/content/plugin/plugin_channel.cc @@ -43,7 +43,7 @@ const int kPluginReleaseTimeMinutes = 5; // happen in a single process browser and avoid deadlock. class PluginChannel::MessageFilter : public IPC::MessageFilter { public: - MessageFilter() : channel_(NULL) { } + MessageFilter() : sender_(NULL) { } base::WaitableEvent* GetModalDialogEvent(int render_view_id) { base::AutoLock auto_lock(modal_dialog_event_map_lock_); @@ -75,12 +75,12 @@ class PluginChannel::MessageFilter : public IPC::MessageFilter { bool Send(IPC::Message* message) { // Need this function for the IPC_MESSAGE_HANDLER_DELAY_REPLY macro. - return channel_->Send(message); + return sender_->Send(message); } // IPC::MessageFilter: - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE { - channel_ = channel; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE { + sender_ = sender; } virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { @@ -138,7 +138,7 @@ class PluginChannel::MessageFilter : public IPC::MessageFilter { ModalDialogEventMap modal_dialog_event_map_; base::Lock modal_dialog_event_map_lock_; - IPC::Channel* channel_; + IPC::Sender* sender_; }; PluginChannel* PluginChannel::GetPluginChannel( diff --git a/content/public/browser/browser_message_filter.cc b/content/public/browser/browser_message_filter.cc index 377cfb7..6b34322 100644 --- a/content/public/browser/browser_message_filter.cc +++ b/content/public/browser/browser_message_filter.cc @@ -30,9 +30,9 @@ class BrowserMessageFilter::Internal : public IPC::MessageFilter { virtual ~Internal() {} // IPC::MessageFilter implementation: - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE { - filter_->channel_ = channel; - filter_->OnFilterAdded(channel); + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE { + filter_->sender_ = sender; + filter_->OnFilterAdded(sender); } virtual void OnFilterRemoved() OVERRIDE { @@ -40,7 +40,7 @@ class BrowserMessageFilter::Internal : public IPC::MessageFilter { } virtual void OnChannelClosing() OVERRIDE { - filter_->channel_ = NULL; + filter_->sender_ = NULL; filter_->OnChannelClosing(); } @@ -101,7 +101,7 @@ class BrowserMessageFilter::Internal : public IPC::MessageFilter { BrowserMessageFilter::BrowserMessageFilter(uint32 message_class_to_filter) : internal_(NULL), - channel_(NULL), + sender_(NULL), #if defined(OS_WIN) peer_handle_(base::kNullProcessHandle), #endif @@ -112,7 +112,7 @@ BrowserMessageFilter::BrowserMessageFilter( const uint32* message_classes_to_filter, size_t num_message_classes_to_filter) : internal_(NULL), - channel_(NULL), + sender_(NULL), #if defined(OS_WIN) peer_handle_(base::kNullProcessHandle), #endif @@ -161,8 +161,8 @@ bool BrowserMessageFilter::Send(IPC::Message* message) { return true; } - if (channel_) - return channel_->Send(message); + if (sender_) + return sender_->Send(message); delete message; return false; diff --git a/content/public/browser/browser_message_filter.h b/content/public/browser/browser_message_filter.h index f1334b9..81f06a9 100644 --- a/content/public/browser/browser_message_filter.h +++ b/content/public/browser/browser_message_filter.h @@ -39,7 +39,7 @@ class CONTENT_EXPORT BrowserMessageFilter // These match the corresponding IPC::MessageFilter methods and are always // called on the IO thread. - virtual void OnFilterAdded(IPC::Channel* channel) {} + virtual void OnFilterAdded(IPC::Sender* sender) {} virtual void OnFilterRemoved() {} virtual void OnChannelClosing() {} virtual void OnChannelConnected(int32 peer_pid) {} @@ -123,7 +123,7 @@ class CONTENT_EXPORT BrowserMessageFilter // child class does in its OnDestruct method. Internal* internal_; - IPC::Channel* channel_; + IPC::Sender* sender_; base::ProcessId peer_pid_; std::vector<uint32> message_classes_to_filter_; diff --git a/content/renderer/input/input_event_filter.cc b/content/renderer/input/input_event_filter.cc index 06d07a9..fa31658 100644 --- a/content/renderer/input/input_event_filter.cc +++ b/content/renderer/input/input_event_filter.cc @@ -16,8 +16,8 @@ #include "content/common/input_messages.h" #include "content/common/view_messages.h" #include "content/public/common/content_switches.h" -#include "ipc/ipc_channel.h" #include "ipc/ipc_listener.h" +#include "ipc/ipc_sender.h" #include "ui/gfx/vector2d_f.h" using blink::WebInputEvent; @@ -89,9 +89,9 @@ void InputEventFilter::DidStopFlinging(int routing_id) { scoped_ptr<IPC::Message>(new ViewHostMsg_DidStopFlinging(routing_id))); } -void InputEventFilter::OnFilterAdded(IPC::Channel* channel) { +void InputEventFilter::OnFilterAdded(IPC::Sender* sender) { io_loop_ = base::MessageLoopProxy::current(); - sender_ = channel; + sender_ = sender; } void InputEventFilter::OnFilterRemoved() { diff --git a/content/renderer/input/input_event_filter.h b/content/renderer/input/input_event_filter.h index 1088cf9..a80b9f8 100644 --- a/content/renderer/input/input_event_filter.h +++ b/content/renderer/input/input_event_filter.h @@ -60,7 +60,7 @@ class CONTENT_EXPORT InputEventFilter : public InputHandlerManagerClient, virtual void DidStopFlinging(int routing_id) OVERRIDE; // IPC::MessageFilter methods: - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual void OnChannelClosing() OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; diff --git a/content/renderer/media/audio_input_message_filter.cc b/content/renderer/media/audio_input_message_filter.cc index 11928ea..412196c 100644 --- a/content/renderer/media/audio_input_message_filter.cc +++ b/content/renderer/media/audio_input_message_filter.cc @@ -9,8 +9,8 @@ #include "base/strings/stringprintf.h" #include "content/common/media/audio_messages.h" #include "content/renderer/media/webrtc_logging.h" -#include "ipc/ipc_channel.h" #include "ipc/ipc_logging.h" +#include "ipc/ipc_sender.h" namespace content { @@ -45,7 +45,7 @@ AudioInputMessageFilter* AudioInputMessageFilter::g_filter = NULL; AudioInputMessageFilter::AudioInputMessageFilter( const scoped_refptr<base::MessageLoopProxy>& io_message_loop) - : channel_(NULL), + : sender_(NULL), io_message_loop_(io_message_loop) { DCHECK(!g_filter); g_filter = this; @@ -63,10 +63,10 @@ AudioInputMessageFilter* AudioInputMessageFilter::Get() { void AudioInputMessageFilter::Send(IPC::Message* message) { DCHECK(io_message_loop_->BelongsToCurrentThread()); - if (!channel_) { + if (!sender_) { delete message; } else { - channel_->Send(message); + sender_->Send(message); } } @@ -84,11 +84,11 @@ bool AudioInputMessageFilter::OnMessageReceived(const IPC::Message& message) { return handled; } -void AudioInputMessageFilter::OnFilterAdded(IPC::Channel* channel) { +void AudioInputMessageFilter::OnFilterAdded(IPC::Sender* sender) { DCHECK(io_message_loop_->BelongsToCurrentThread()); - // Captures the channel for IPC. - channel_ = channel; + // Captures the sender for IPC. + sender_ = sender; } void AudioInputMessageFilter::OnFilterRemoved() { @@ -101,7 +101,7 @@ void AudioInputMessageFilter::OnFilterRemoved() { void AudioInputMessageFilter::OnChannelClosing() { DCHECK(io_message_loop_->BelongsToCurrentThread()); - channel_ = NULL; + sender_ = NULL; DLOG_IF(WARNING, !delegates_.IsEmpty()) << "Not all audio devices have been closed."; diff --git a/content/renderer/media/audio_input_message_filter.h b/content/renderer/media/audio_input_message_filter.h index 82b4dd0..1107463 100644 --- a/content/renderer/media/audio_input_message_filter.h +++ b/content/renderer/media/audio_input_message_filter.h @@ -54,7 +54,7 @@ class CONTENT_EXPORT AudioInputMessageFilter : public IPC::MessageFilter { // IPC::MessageFilter override. Called on |io_message_loop_|. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual void OnChannelClosing() OVERRIDE; @@ -80,8 +80,8 @@ class CONTENT_EXPORT AudioInputMessageFilter : public IPC::MessageFilter { // A map of stream ids to delegates. IDMap<media::AudioInputIPCDelegate> delegates_; - // IPC channel for Send(), must only be accesed on |io_message_loop_|. - IPC::Channel* channel_; + // IPC sender for Send(), must only be accesed on |io_message_loop_|. + IPC::Sender* sender_; // Message loop on which IPC calls are driven. const scoped_refptr<base::MessageLoopProxy> io_message_loop_; diff --git a/content/renderer/media/audio_message_filter.cc b/content/renderer/media/audio_message_filter.cc index 42187be..fde42fb 100644 --- a/content/renderer/media/audio_message_filter.cc +++ b/content/renderer/media/audio_message_filter.cc @@ -46,7 +46,7 @@ AudioMessageFilter* AudioMessageFilter::g_filter = NULL; AudioMessageFilter::AudioMessageFilter( const scoped_refptr<base::MessageLoopProxy>& io_message_loop) - : channel_(NULL), + : sender_(NULL), audio_hardware_config_(NULL), io_message_loop_(io_message_loop) { DCHECK(!g_filter); @@ -118,10 +118,10 @@ void AudioMessageFilter::AudioOutputIPCImpl::SetVolume(double volume) { void AudioMessageFilter::Send(IPC::Message* message) { DCHECK(io_message_loop_->BelongsToCurrentThread()); - if (!channel_) { + if (!sender_) { delete message; } else { - channel_->Send(message); + sender_->Send(message); } } @@ -137,9 +137,9 @@ bool AudioMessageFilter::OnMessageReceived(const IPC::Message& message) { return handled; } -void AudioMessageFilter::OnFilterAdded(IPC::Channel* channel) { +void AudioMessageFilter::OnFilterAdded(IPC::Sender* sender) { DCHECK(io_message_loop_->BelongsToCurrentThread()); - channel_ = channel; + sender_ = sender; } void AudioMessageFilter::OnFilterRemoved() { @@ -152,7 +152,7 @@ void AudioMessageFilter::OnFilterRemoved() { void AudioMessageFilter::OnChannelClosing() { DCHECK(io_message_loop_->BelongsToCurrentThread()); - channel_ = NULL; + sender_ = NULL; DLOG_IF(WARNING, !delegates_.IsEmpty()) << "Not all audio devices have been closed."; diff --git a/content/renderer/media/audio_message_filter.h b/content/renderer/media/audio_message_filter.h index 71bf012..ed4d5b2 100644 --- a/content/renderer/media/audio_message_filter.h +++ b/content/renderer/media/audio_message_filter.h @@ -65,12 +65,12 @@ class CONTENT_EXPORT AudioMessageFilter : public IPC::MessageFilter { // stream_id and the source render_view_id. class AudioOutputIPCImpl; - // Sends an IPC message using |channel_|. + // Sends an IPC message using |sender_|. void Send(IPC::Message* message); // IPC::MessageFilter override. Called on |io_message_loop|. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual void OnChannelClosing() OVERRIDE; @@ -92,8 +92,8 @@ class CONTENT_EXPORT AudioMessageFilter : public IPC::MessageFilter { void OnOutputDeviceChanged(int stream_id, int new_buffer_size, int new_sample_rate); - // IPC channel for Send(); must only be accesed on |io_message_loop_|. - IPC::Channel* channel_; + // IPC sender for Send(); must only be accesed on |io_message_loop_|. + IPC::Sender* sender_; // A map of stream ids to delegates; must only be accessed on // |io_message_loop_|. diff --git a/content/renderer/media/midi_message_filter.cc b/content/renderer/media/midi_message_filter.cc index cf950f7..e6a7f80 100644 --- a/content/renderer/media/midi_message_filter.cc +++ b/content/renderer/media/midi_message_filter.cc @@ -24,7 +24,7 @@ namespace content { MidiMessageFilter::MidiMessageFilter( const scoped_refptr<base::MessageLoopProxy>& io_message_loop) - : channel_(NULL), + : sender_(NULL), io_message_loop_(io_message_loop), main_message_loop_(base::MessageLoopProxy::current()), next_available_id_(0), @@ -35,10 +35,10 @@ MidiMessageFilter::~MidiMessageFilter() {} void MidiMessageFilter::Send(IPC::Message* message) { DCHECK(io_message_loop_->BelongsToCurrentThread()); - if (!channel_) { + if (!sender_) { delete message; } else { - channel_->Send(message); + sender_->Send(message); } } @@ -54,9 +54,9 @@ bool MidiMessageFilter::OnMessageReceived(const IPC::Message& message) { return handled; } -void MidiMessageFilter::OnFilterAdded(IPC::Channel* channel) { +void MidiMessageFilter::OnFilterAdded(IPC::Sender* sender) { DCHECK(io_message_loop_->BelongsToCurrentThread()); - channel_ = channel; + sender_ = sender; } void MidiMessageFilter::OnFilterRemoved() { @@ -69,7 +69,7 @@ void MidiMessageFilter::OnFilterRemoved() { void MidiMessageFilter::OnChannelClosing() { DCHECK(io_message_loop_->BelongsToCurrentThread()); - channel_ = NULL; + sender_ = NULL; } void MidiMessageFilter::StartSession(blink::WebMIDIAccessorClient* client) { diff --git a/content/renderer/media/midi_message_filter.h b/content/renderer/media/midi_message_filter.h index 017585c..e8de64d 100644 --- a/content/renderer/media/midi_message_filter.h +++ b/content/renderer/media/midi_message_filter.h @@ -50,12 +50,12 @@ class CONTENT_EXPORT MidiMessageFilter : public IPC::MessageFilter { virtual ~MidiMessageFilter(); private: - // Sends an IPC message using |channel_|. + // Sends an IPC message using |sender_|. void Send(IPC::Message* message); // IPC::MessageFilter override. Called on |io_message_loop|. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual void OnChannelClosing() OVERRIDE; @@ -94,8 +94,8 @@ class CONTENT_EXPORT MidiMessageFilter : public IPC::MessageFilter { blink::WebMIDIAccessorClient* GetClientFromId(int client_id); - // IPC channel for Send(); must only be accessed on |io_message_loop_|. - IPC::Channel* channel_; + // IPC sender for Send(); must only be accessed on |io_message_loop_|. + IPC::Sender* sender_; // Message loop on which IPC calls are driven. const scoped_refptr<base::MessageLoopProxy> io_message_loop_; diff --git a/content/renderer/media/video_capture_message_filter.cc b/content/renderer/media/video_capture_message_filter.cc index f58347b..5034526 100644 --- a/content/renderer/media/video_capture_message_filter.cc +++ b/content/renderer/media/video_capture_message_filter.cc @@ -6,13 +6,13 @@ #include "content/common/media/video_capture_messages.h" #include "content/common/view_messages.h" -#include "ipc/ipc_channel.h" +#include "ipc/ipc_sender.h" namespace content { VideoCaptureMessageFilter::VideoCaptureMessageFilter() : last_device_id_(0), - channel_(NULL) { + sender_(NULL) { } void VideoCaptureMessageFilter::AddDelegate(Delegate* delegate) { @@ -21,7 +21,7 @@ void VideoCaptureMessageFilter::AddDelegate(Delegate* delegate) { while (delegates_.find(last_device_id_) != delegates_.end()) last_device_id_++; - if (channel_) { + if (sender_) { delegates_[last_device_id_] = delegate; delegate->OnDelegateAdded(last_device_id_); } else { @@ -47,12 +47,12 @@ void VideoCaptureMessageFilter::RemoveDelegate(Delegate* delegate) { } bool VideoCaptureMessageFilter::Send(IPC::Message* message) { - if (!channel_) { + if (!sender_) { delete message; return false; } - return channel_->Send(message); + return sender_->Send(message); } bool VideoCaptureMessageFilter::OnMessageReceived(const IPC::Message& message) { @@ -73,9 +73,9 @@ bool VideoCaptureMessageFilter::OnMessageReceived(const IPC::Message& message) { return handled; } -void VideoCaptureMessageFilter::OnFilterAdded(IPC::Channel* channel) { +void VideoCaptureMessageFilter::OnFilterAdded(IPC::Sender* sender) { DVLOG(1) << "VideoCaptureMessageFilter::OnFilterAdded()"; - channel_ = channel; + sender_ = sender; for (Delegates::iterator it = pending_delegates_.begin(); it != pending_delegates_.end(); it++) { @@ -86,11 +86,11 @@ void VideoCaptureMessageFilter::OnFilterAdded(IPC::Channel* channel) { } void VideoCaptureMessageFilter::OnFilterRemoved() { - channel_ = NULL; + sender_ = NULL; } void VideoCaptureMessageFilter::OnChannelClosing() { - channel_ = NULL; + sender_ = NULL; } VideoCaptureMessageFilter::~VideoCaptureMessageFilter() {} diff --git a/content/renderer/media/video_capture_message_filter.h b/content/renderer/media/video_capture_message_filter.h index e6e4194..b6faa03 100644 --- a/content/renderer/media/video_capture_message_filter.h +++ b/content/renderer/media/video_capture_message_filter.h @@ -80,7 +80,7 @@ class CONTENT_EXPORT VideoCaptureMessageFilter : public IPC::MessageFilter { // IPC::MessageFilter override. Called on IO thread. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual void OnChannelClosing() OVERRIDE; @@ -134,7 +134,7 @@ class CONTENT_EXPORT VideoCaptureMessageFilter : public IPC::MessageFilter { Delegates pending_delegates_; int32 last_device_id_; - IPC::Channel* channel_; + IPC::Sender* sender_; DISALLOW_COPY_AND_ASSIGN(VideoCaptureMessageFilter); }; diff --git a/content/renderer/p2p/socket_dispatcher.cc b/content/renderer/p2p/socket_dispatcher.cc index d6b0119..fd8aaf9 100644 --- a/content/renderer/p2p/socket_dispatcher.cc +++ b/content/renderer/p2p/socket_dispatcher.cc @@ -13,7 +13,7 @@ #include "content/renderer/p2p/network_list_observer.h" #include "content/renderer/p2p/socket_client_impl.h" #include "content/renderer/render_view_impl.h" -#include "ipc/ipc_channel.h" +#include "ipc/ipc_sender.h" namespace content { @@ -23,7 +23,7 @@ P2PSocketDispatcher::P2PSocketDispatcher( network_notifications_started_(false), network_list_observers_( new ObserverListThreadSafe<NetworkListObserver>()), - channel_(NULL) { + sender_(NULL) { } P2PSocketDispatcher::~P2PSocketDispatcher() { @@ -48,13 +48,13 @@ void P2PSocketDispatcher::RemoveNetworkListObserver( void P2PSocketDispatcher::Send(IPC::Message* message) { DCHECK(message_loop_->BelongsToCurrentThread()); - if (!channel_) { - DLOG(WARNING) << "P2PSocketDispatcher::Send() - Channel closed."; + if (!sender_) { + DLOG(WARNING) << "P2PSocketDispatcher::Send() - Sender closed."; delete message; return; } - channel_->Send(message); + sender_->Send(message); } bool P2PSocketDispatcher::OnMessageReceived(const IPC::Message& message) { @@ -72,17 +72,17 @@ bool P2PSocketDispatcher::OnMessageReceived(const IPC::Message& message) { return handled; } -void P2PSocketDispatcher::OnFilterAdded(IPC::Channel* channel) { +void P2PSocketDispatcher::OnFilterAdded(IPC::Sender* sender) { DVLOG(1) << "P2PSocketDispatcher::OnFilterAdded()"; - channel_ = channel; + sender_ = sender; } void P2PSocketDispatcher::OnFilterRemoved() { - channel_ = NULL; + sender_ = NULL; } void P2PSocketDispatcher::OnChannelClosing() { - channel_ = NULL; + sender_ = NULL; } base::MessageLoopProxy* P2PSocketDispatcher::message_loop() { diff --git a/content/renderer/p2p/socket_dispatcher.h b/content/renderer/p2p/socket_dispatcher.h index 5bfd264..b0e9b29 100644 --- a/content/renderer/p2p/socket_dispatcher.h +++ b/content/renderer/p2p/socket_dispatcher.h @@ -74,7 +74,7 @@ class CONTENT_EXPORT P2PSocketDispatcher : public IPC::MessageFilter { // IPC::MessageFilter override. Called on IO thread. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual void OnChannelClosing() OVERRIDE; @@ -113,7 +113,7 @@ class CONTENT_EXPORT P2PSocketDispatcher : public IPC::MessageFilter { scoped_refptr<ObserverListThreadSafe<NetworkListObserver> > network_list_observers_; - IPC::Channel* channel_; + IPC::Sender* sender_; DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcher); }; diff --git a/content/renderer/pepper/pepper_hung_plugin_filter.cc b/content/renderer/pepper/pepper_hung_plugin_filter.cc index 57fc4a6..942dd6e 100644 --- a/content/renderer/pepper/pepper_hung_plugin_filter.cc +++ b/content/renderer/pepper/pepper_hung_plugin_filter.cc @@ -55,7 +55,7 @@ void PepperHungPluginFilter::EndBlockOnSyncMessage() { MayHaveBecomeUnhung(); } -void PepperHungPluginFilter::OnFilterAdded(IPC::Channel* channel) {} +void PepperHungPluginFilter::OnFilterAdded(IPC::Sender* sender) {} void PepperHungPluginFilter::OnFilterRemoved() { base::AutoLock lock(lock_); diff --git a/content/renderer/pepper/pepper_hung_plugin_filter.h b/content/renderer/pepper/pepper_hung_plugin_filter.h index ee83674..e7457fd 100644 --- a/content/renderer/pepper/pepper_hung_plugin_filter.h +++ b/content/renderer/pepper/pepper_hung_plugin_filter.h @@ -43,7 +43,7 @@ class PepperHungPluginFilter virtual void EndBlockOnSyncMessage() OVERRIDE; // MessageFilter implementation. - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual void OnChannelError() OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; diff --git a/ipc/ipc_channel_proxy_unittest.cc b/ipc/ipc_channel_proxy_unittest.cc index 20e42e3..81b65ec 100644 --- a/ipc/ipc_channel_proxy_unittest.cc +++ b/ipc/ipc_channel_proxy_unittest.cc @@ -143,8 +143,8 @@ class MessageCountFilter : public IPC::MessageFilter { last_filter_event_(NONE), message_filtering_enabled_(false) {} - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE { - EXPECT_TRUE(channel); + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE { + EXPECT_TRUE(sender); EXPECT_EQ(NONE, last_filter_event_); last_filter_event_ = FILTER_ADDED; } diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc index a145f6b..05126b9 100644 --- a/ipc/ipc_sync_channel_unittest.cc +++ b/ipc/ipc_sync_channel_unittest.cc @@ -934,8 +934,8 @@ class TestSyncMessageFilter : public SyncMessageFilter { message_loop_(message_loop) { } - virtual void OnFilterAdded(Channel* channel) OVERRIDE { - SyncMessageFilter::OnFilterAdded(channel); + virtual void OnFilterAdded(Sender* sender) OVERRIDE { + SyncMessageFilter::OnFilterAdded(sender); message_loop_->PostTask( FROM_HERE, base::Bind(&TestSyncMessageFilter::SendMessageOnHelperThread, this)); diff --git a/ipc/ipc_sync_message_filter.cc b/ipc/ipc_sync_message_filter.cc index 3833d2b..e2ea1bf 100644 --- a/ipc/ipc_sync_message_filter.cc +++ b/ipc/ipc_sync_message_filter.cc @@ -17,7 +17,7 @@ using base::MessageLoopProxy; namespace IPC { SyncMessageFilter::SyncMessageFilter(base::WaitableEvent* shutdown_event) - : channel_(NULL), + : sender_(NULL), listener_loop_(MessageLoopProxy::current()), shutdown_event_(shutdown_event) { } @@ -67,19 +67,19 @@ bool SyncMessageFilter::Send(Message* message) { return pending_message.send_result; } -void SyncMessageFilter::OnFilterAdded(Channel* channel) { - channel_ = channel; +void SyncMessageFilter::OnFilterAdded(Sender* sender) { + sender_ = sender; base::AutoLock auto_lock(lock_); io_loop_ = MessageLoopProxy::current(); } void SyncMessageFilter::OnChannelError() { - channel_ = NULL; + sender_ = NULL; SignalAllEvents(); } void SyncMessageFilter::OnChannelClosing() { - channel_ = NULL; + sender_ = NULL; SignalAllEvents(); } @@ -104,8 +104,8 @@ SyncMessageFilter::~SyncMessageFilter() { } void SyncMessageFilter::SendOnIOThread(Message* message) { - if (channel_) { - channel_->Send(message); + if (sender_) { + sender_->Send(message); return; } diff --git a/ipc/ipc_sync_message_filter.h b/ipc/ipc_sync_message_filter.h index 4e08a1a..933a95e 100644 --- a/ipc/ipc_sync_message_filter.h +++ b/ipc/ipc_sync_message_filter.h @@ -34,7 +34,7 @@ class IPC_EXPORT SyncMessageFilter : public MessageFilter, public Sender { virtual bool Send(Message* message) OVERRIDE; // MessageFilter implementation. - virtual void OnFilterAdded(Channel* channel) OVERRIDE; + virtual void OnFilterAdded(Sender* sender) OVERRIDE; virtual void OnChannelError() OVERRIDE; virtual void OnChannelClosing() OVERRIDE; virtual bool OnMessageReceived(const Message& message) OVERRIDE; @@ -48,7 +48,7 @@ class IPC_EXPORT SyncMessageFilter : public MessageFilter, public Sender { void SignalAllEvents(); // The channel to which this filter was added. - Channel* channel_; + Sender* sender_; // The process's main thread. scoped_refptr<base::MessageLoopProxy> listener_loop_; diff --git a/ipc/message_filter.cc b/ipc/message_filter.cc index 7218126..ffde0f0 100644 --- a/ipc/message_filter.cc +++ b/ipc/message_filter.cc @@ -11,7 +11,7 @@ namespace IPC { MessageFilter::MessageFilter() {} -void MessageFilter::OnFilterAdded(Channel* channel) {} +void MessageFilter::OnFilterAdded(Sender* sender) {} void MessageFilter::OnFilterRemoved() {} diff --git a/ipc/message_filter.h b/ipc/message_filter.h index 0371585..c9ba4e8 100644 --- a/ipc/message_filter.h +++ b/ipc/message_filter.h @@ -12,7 +12,7 @@ namespace IPC { -class Channel; +class Sender; class Message; // A class that receives messages on the thread where the IPC channel is @@ -25,7 +25,7 @@ class IPC_EXPORT MessageFilter // Called on the background thread to provide the filter with access to the // channel. Called when the IPC channel is initialized or when AddFilter // is called if the channel is already initialized. - virtual void OnFilterAdded(Channel* channel); + virtual void OnFilterAdded(Sender* sender); // Called on the background thread when the filter has been removed from // the ChannelProxy and when the Channel is closing. After a filter is diff --git a/ppapi/proxy/plugin_message_filter.cc b/ppapi/proxy/plugin_message_filter.cc index 5652a43..1846957 100644 --- a/ppapi/proxy/plugin_message_filter.cc +++ b/ppapi/proxy/plugin_message_filter.cc @@ -23,18 +23,18 @@ PluginMessageFilter::PluginMessageFilter( scoped_refptr<ResourceReplyThreadRegistrar> registrar) : seen_instance_ids_(seen_instance_ids), resource_reply_thread_registrar_(registrar), - channel_(NULL) { + sender_(NULL) { } PluginMessageFilter::~PluginMessageFilter() { } -void PluginMessageFilter::OnFilterAdded(IPC::Channel* channel) { - channel_ = channel; +void PluginMessageFilter::OnFilterAdded(IPC::Sender* sender) { + sender_ = sender; } void PluginMessageFilter::OnFilterRemoved() { - channel_ = NULL; + sender_ = NULL; } bool PluginMessageFilter::OnMessageReceived(const IPC::Message& message) { @@ -48,8 +48,8 @@ bool PluginMessageFilter::OnMessageReceived(const IPC::Message& message) { } bool PluginMessageFilter::Send(IPC::Message* msg) { - if (channel_) - return channel_->Send(msg); + if (sender_) + return sender_->Send(msg); delete msg; return false; } diff --git a/ppapi/proxy/plugin_message_filter.h b/ppapi/proxy/plugin_message_filter.h index 3b05089..4018ffcc 100644 --- a/ppapi/proxy/plugin_message_filter.h +++ b/ppapi/proxy/plugin_message_filter.h @@ -41,7 +41,7 @@ class PPAPI_PROXY_EXPORT PluginMessageFilter : public IPC::MessageFilter, virtual ~PluginMessageFilter(); // MessageFilter implementation. - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; virtual void OnFilterRemoved() OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; @@ -72,9 +72,9 @@ class PPAPI_PROXY_EXPORT PluginMessageFilter : public IPC::MessageFilter, scoped_refptr<ResourceReplyThreadRegistrar> resource_reply_thread_registrar_; - // The IPC channel to the renderer. May be NULL if we're not currently + // The IPC sender to the renderer. May be NULL if we're not currently // attached as a filter. - IPC::Channel* channel_; + IPC::Sender* sender_; }; } // namespace proxy diff --git a/win8/viewer/metro_viewer_process_host.cc b/win8/viewer/metro_viewer_process_host.cc index d3655d7..8a39885 100644 --- a/win8/viewer/metro_viewer_process_host.cc +++ b/win8/viewer/metro_viewer_process_host.cc @@ -42,7 +42,7 @@ MetroViewerProcessHost::InternalMessageFilter::InternalMessageFilter( } void MetroViewerProcessHost::InternalMessageFilter::OnChannelConnected( - int32 /* peer_pid */) { + int32 peer_pid) { owner_->NotifyChannelConnected(); } |