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

Side by Side Diff: ipc/mojo/ipc_channel_mojo.cc

Issue 1127153003: ipc: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/mojo/async_handle_waiter_unittest.cc ('k') | ipc/mojo/ipc_channel_mojo_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/mojo/ipc_channel_mojo.h" 5 #include "ipc/mojo/ipc_channel_mojo.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 Listener* listener) 286 Listener* listener)
287 : mode_(mode), 287 : mode_(mode),
288 listener_(listener), 288 listener_(listener),
289 peer_pid_(base::kNullProcessId), 289 peer_pid_(base::kNullProcessId),
290 io_runner_(io_runner), 290 io_runner_(io_runner),
291 channel_info_(nullptr, ChannelInfoDeleter(nullptr)), 291 channel_info_(nullptr, ChannelInfoDeleter(nullptr)),
292 weak_factory_(this) { 292 weak_factory_(this) {
293 // Create MojoBootstrap after all members are set as it touches 293 // Create MojoBootstrap after all members are set as it touches
294 // ChannelMojo from a different thread. 294 // ChannelMojo from a different thread.
295 bootstrap_ = MojoBootstrap::Create(handle, mode, this); 295 bootstrap_ = MojoBootstrap::Create(handle, mode, this);
296 if (io_runner == base::MessageLoop::current()->message_loop_proxy()) { 296 if (io_runner == base::MessageLoop::current()->task_runner()) {
297 InitOnIOThread(delegate); 297 InitOnIOThread(delegate);
298 } else { 298 } else {
299 io_runner->PostTask(FROM_HERE, 299 io_runner->PostTask(FROM_HERE,
300 base::Bind(&ChannelMojo::InitOnIOThread, 300 base::Bind(&ChannelMojo::InitOnIOThread,
301 base::Unretained(this), delegate)); 301 base::Unretained(this), delegate));
302 } 302 }
303 } 303 }
304 304
305 ChannelMojo::~ChannelMojo() { 305 ChannelMojo::~ChannelMojo() {
306 Close(); 306 Close();
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 if (!ok) { 552 if (!ok) {
553 LOG(ERROR) << "Failed to add new Mojo handle."; 553 LOG(ERROR) << "Failed to add new Mojo handle.";
554 return MOJO_RESULT_UNKNOWN; 554 return MOJO_RESULT_UNKNOWN;
555 } 555 }
556 } 556 }
557 557
558 return MOJO_RESULT_OK; 558 return MOJO_RESULT_OK;
559 } 559 }
560 560
561 } // namespace IPC 561 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/mojo/async_handle_waiter_unittest.cc ('k') | ipc/mojo/ipc_channel_mojo_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698