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

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

Issue 553283002: IPC::ChannelMojo: Introduce IPC::MojoBootstrap for Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build error Created 6 years, 3 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/ipc_channel_mojo_host.h ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ipc/mojo/ipc_channel_mojo_host.h"
6
7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h"
9 #include "ipc/mojo/ipc_channel_mojo.h"
10
11 namespace IPC {
12
13 ChannelMojoHost::ChannelMojoHost(scoped_refptr<base::TaskRunner> task_runner)
14 : weak_factory_(this), task_runner_(task_runner), channel_(NULL) {
15 }
16
17 ChannelMojoHost::~ChannelMojoHost() {
18 }
19
20 void ChannelMojoHost::OnClientLaunched(base::ProcessHandle process) {
21 if (task_runner_ == base::MessageLoop::current()->message_loop_proxy()) {
22 InvokeOnClientLaunched(process);
23 } else {
24 task_runner_->PostTask(FROM_HERE,
25 base::Bind(&ChannelMojoHost::InvokeOnClientLaunched,
26 weak_factory_.GetWeakPtr(),
27 process));
28 }
29 }
30
31 void ChannelMojoHost::InvokeOnClientLaunched(base::ProcessHandle process) {
32 if (!channel_)
33 return;
34 channel_->OnClientLaunched(process);
35 }
36
37 void ChannelMojoHost::OnChannelCreated(ChannelMojo* channel) {
38 DCHECK(channel_ == NULL);
39 channel_ = channel;
40 }
41
42 void ChannelMojoHost::OnChannelDestroyed() {
43 DCHECK(channel_ != NULL);
44 channel_ = NULL;
45 }
46
47 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/mojo/ipc_channel_mojo_host.h ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698