OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "mojo/shell/background/background_shell.h" | 5 #include "mojo/shell/background/background_shell.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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 void BackgroundShell::Init(NativeRunnerDelegate* native_runner_delegate) { | 169 void BackgroundShell::Init(NativeRunnerDelegate* native_runner_delegate) { |
170 DCHECK(!thread_); | 170 DCHECK(!thread_); |
171 thread_.reset(new MojoThread(native_runner_delegate)); | 171 thread_.reset(new MojoThread(native_runner_delegate)); |
172 thread_->Start(); | 172 thread_->Start(); |
173 } | 173 } |
174 | 174 |
175 mojom::ShellClientRequest BackgroundShell::CreateShellClientRequest( | 175 mojom::ShellClientRequest BackgroundShell::CreateShellClientRequest( |
176 const GURL& url) { | 176 const GURL& url) { |
177 scoped_ptr<ConnectParams> params(new ConnectParams); | 177 scoped_ptr<ConnectParams> params(new ConnectParams); |
178 params->set_target( | 178 params->set_target( |
179 Identity(url, std::string(), mojom::Shell::kUserRoot, | 179 Identity(url, std::string(), mojom::Connector::kUserRoot, |
180 GetPermissiveCapabilityFilter())); | 180 GetPermissiveCapabilityFilter())); |
181 mojom::ShellClientRequest request; | 181 mojom::ShellClientRequest request; |
182 base::WaitableEvent signal(true, false); | 182 base::WaitableEvent signal(true, false); |
183 thread_->message_loop()->task_runner()->PostTask( | 183 thread_->message_loop()->task_runner()->PostTask( |
184 FROM_HERE, base::Bind(&MojoThread::CreateShellClientRequest, | 184 FROM_HERE, base::Bind(&MojoThread::CreateShellClientRequest, |
185 base::Unretained(thread_.get()), &signal, | 185 base::Unretained(thread_.get()), &signal, |
186 base::Passed(¶ms), &request)); | 186 base::Passed(¶ms), &request)); |
187 signal.Wait(); | 187 signal.Wait(); |
188 return request; | 188 return request; |
189 } | 189 } |
190 | 190 |
191 } // namespace shell | 191 } // namespace shell |
192 } // namespace mojo | 192 } // namespace mojo |
OLD | NEW |