Skip to content

Commit

Permalink
ipc: Remove the ability to override the listener task runner
Browse files Browse the repository at this point in the history
Since base::ThreadTaskRunnerHandle::Get() is now configured to return
the correct value from the start, there's no need to override the IPC
listener task runner any longer.

BUG=465354

Review URL: https://codereview.chromium.org/1239273002

Cr-Commit-Position: refs/heads/master@{#339629}
  • Loading branch information
skyostil authored and Commit bot committed Jul 21, 2015
1 parent 33f8219 commit 3b159ee
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 39 deletions.
11 changes: 0 additions & 11 deletions content/child/child_thread_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,6 @@ ChildThreadImpl::Options::Builder::AddStartupFilter(
return *this;
}

ChildThreadImpl::Options::Builder&
ChildThreadImpl::Options::Builder::ListenerTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
options_.listener_task_runner = task_runner;
return *this;
}

ChildThreadImpl::Options ChildThreadImpl::Options::Builder::Build() {
return options_;
}
Expand Down Expand Up @@ -442,10 +435,6 @@ void ChildThreadImpl::Init(const Options& options) {
channel_->AddFilter(startup_filter);
}

// Set listener task runner before connect channel to avoid data race.
if (options.listener_task_runner) {
channel_->SetListenerTaskRunner(options.listener_task_runner);
}
ConnectChannel(options.use_mojo_channel);

int connection_timeout = kConnectionTimeoutS;
Expand Down
3 changes: 0 additions & 3 deletions content/child/child_thread_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ struct ChildThreadImpl::Options {
bool use_mojo_channel;
scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner;
std::vector<IPC::MessageFilter*> startup_filters;
scoped_refptr<base::SingleThreadTaskRunner> listener_task_runner;

private:
Options();
Expand All @@ -323,8 +322,6 @@ class ChildThreadImpl::Options::Builder {
Builder& UseMojoChannel(bool use_mojo_channel);
Builder& WithChannelName(const std::string& channel_name);
Builder& AddStartupFilter(IPC::MessageFilter* filter);
Builder& ListenerTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> task_runner);

Options Build();

Expand Down
2 changes: 0 additions & 2 deletions content/renderer/render_thread_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ RenderThreadImpl::RenderThreadImpl(
: ChildThreadImpl(Options::Builder()
.InBrowserProcess(params)
.UseMojoChannel(ShouldUseMojoChannel())
.ListenerTaskRunner(scheduler->DefaultTaskRunner())
.Build()),
renderer_scheduler_(scheduler.Pass()),
raster_worker_pool_(new RasterWorkerPool()) {
Expand All @@ -638,7 +637,6 @@ RenderThreadImpl::RenderThreadImpl(
scoped_ptr<scheduler::RendererScheduler> scheduler)
: ChildThreadImpl(Options::Builder()
.UseMojoChannel(ShouldUseMojoChannel())
.ListenerTaskRunner(scheduler->DefaultTaskRunner())
.Build()),
renderer_scheduler_(scheduler.Pass()),
main_message_loop_(main_message_loop.Pass()),
Expand Down
15 changes: 0 additions & 15 deletions ipc/ipc_channel_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ void ChannelProxy::Context::ClearIPCTaskRunner() {
ipc_task_runner_ = NULL;
}

void ChannelProxy::Context::SetListenerTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
DCHECK(ipc_task_runner_.get() != task_runner.get());
DCHECK(listener_task_runner_->BelongsToCurrentThread());
DCHECK(task_runner->BelongsToCurrentThread());
listener_task_runner_ = task_runner;
}

void ChannelProxy::Context::CreateChannel(scoped_ptr<ChannelFactory> factory) {
base::AutoLock l(channel_lifetime_lock_);
DCHECK(!channel_);
Expand Down Expand Up @@ -484,13 +476,6 @@ void ChannelProxy::RemoveFilter(MessageFilter* filter) {
make_scoped_refptr(filter)));
}

void ChannelProxy::SetListenerTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
DCHECK(CalledOnValidThread());

context()->SetListenerTaskRunner(task_runner);
}

void ChannelProxy::ClearIPCTaskRunner() {
DCHECK(CalledOnValidThread());

Expand Down
8 changes: 0 additions & 8 deletions ipc/ipc_channel_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
}
#endif

// Set the task runner on which dispatched messages are posted. Both the new
// task runner and the existing task runner must run on the same thread, and
// must belong to the calling thread.
void SetListenerTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> listener_task_runner);

// Called to clear the pointer to the IPC task runner when it's going away.
void ClearIPCTaskRunner();

Expand Down Expand Up @@ -180,8 +174,6 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
Context(Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_thread);
void ClearIPCTaskRunner();
void SetListenerTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> listener_task_runner);
base::SingleThreadTaskRunner* ipc_task_runner() const {
return ipc_task_runner_.get();
}
Expand Down

0 comments on commit 3b159ee

Please sign in to comment.