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