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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 void BackgroundShell::Init(scoped_ptr<InitParams> init_params) { | 174 void BackgroundShell::Init(scoped_ptr<InitParams> init_params) { |
175 DCHECK(!thread_); | 175 DCHECK(!thread_); |
176 thread_.reset(new MojoThread(std::move(init_params))); | 176 thread_.reset(new MojoThread(std::move(init_params))); |
177 thread_->Start(); | 177 thread_->Start(); |
178 } | 178 } |
179 | 179 |
180 mojom::ShellClientRequest BackgroundShell::CreateShellClientRequest( | 180 mojom::ShellClientRequest BackgroundShell::CreateShellClientRequest( |
181 const GURL& url) { | 181 const GURL& url) { |
182 scoped_ptr<ConnectParams> params(new ConnectParams); | 182 scoped_ptr<ConnectParams> params(new ConnectParams); |
183 params->set_target( | 183 params->set_target(Identity(url, std::string(), mojom::Connector::kUserRoot)); |
184 Identity(url, std::string(), mojom::Connector::kUserRoot, | |
185 GetPermissiveCapabilityFilter())); | |
186 mojom::ShellClientRequest request; | 184 mojom::ShellClientRequest request; |
187 base::WaitableEvent signal(true, false); | 185 base::WaitableEvent signal(true, false); |
188 thread_->message_loop()->task_runner()->PostTask( | 186 thread_->message_loop()->task_runner()->PostTask( |
189 FROM_HERE, base::Bind(&MojoThread::CreateShellClientRequest, | 187 FROM_HERE, base::Bind(&MojoThread::CreateShellClientRequest, |
190 base::Unretained(thread_.get()), &signal, | 188 base::Unretained(thread_.get()), &signal, |
191 base::Passed(¶ms), &request)); | 189 base::Passed(¶ms), &request)); |
192 signal.Wait(); | 190 signal.Wait(); |
193 return request; | 191 return request; |
194 } | 192 } |
195 | 193 |
196 } // namespace shell | 194 } // namespace shell |
197 } // namespace mojo | 195 } // namespace mojo |
OLD | NEW |