| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/mojo/mojo_shell_client_host.h" | 5 #include "content/browser/mojo/mojo_shell_client_host.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 mojo::shell::mojom::PIDReceiverPtr pid_receiver; | 118 mojo::shell::mojom::PIDReceiverPtr pid_receiver; |
| 119 mojo::InterfaceRequest<mojo::shell::mojom::PIDReceiver> request = | 119 mojo::InterfaceRequest<mojo::shell::mojom::PIDReceiver> request = |
| 120 GetProxy(&pid_receiver); | 120 GetProxy(&pid_receiver); |
| 121 new PIDSender(render_process_host, std::move(pid_receiver)); | 121 new PIDSender(render_process_host, std::move(pid_receiver)); |
| 122 | 122 |
| 123 mojo::shell::mojom::ShellClientFactoryPtr factory; | 123 mojo::shell::mojom::ShellClientFactoryPtr factory; |
| 124 factory.Bind(mojo::InterfacePtrInfo<mojo::shell::mojom::ShellClientFactory>( | 124 factory.Bind(mojo::InterfacePtrInfo<mojo::shell::mojom::ShellClientFactory>( |
| 125 std::move(request_pipe), 0u)); | 125 std::move(request_pipe), 0u)); |
| 126 | 126 |
| 127 shell->CreateInstance(std::move(factory), url, | 127 mojo::shell::mojom::IdentityPtr target(mojo::shell::mojom::Identity::New()); |
| 128 mojo::shell::mojom::kInheritUserID, | 128 target->name = url; |
| 129 target->user_id = mojo::shell::mojom::kInheritUserID; |
| 130 target->instance = ""; |
| 131 shell->CreateInstance(std::move(factory), std::move(target), |
| 129 CreateCapabilityFilterForRenderer(), | 132 CreateCapabilityFilterForRenderer(), |
| 130 std::move(request), base::Bind(&OnConnectionComplete)); | 133 std::move(request), base::Bind(&OnConnectionComplete)); |
| 131 | 134 |
| 132 // Store the URL on the RPH so client code can access it later via | 135 // Store the URL on the RPH so client code can access it later via |
| 133 // GetMojoApplicationInstanceURL(). | 136 // GetMojoApplicationInstanceURL(). |
| 134 SetMojoApplicationInstanceURL(render_process_host, url); | 137 SetMojoApplicationInstanceURL(render_process_host, url); |
| 135 | 138 |
| 136 return pipe_token; | 139 return pipe_token; |
| 137 } | 140 } |
| 138 | 141 |
| 139 std::string GetMojoApplicationInstanceURL( | 142 std::string GetMojoApplicationInstanceURL( |
| 140 RenderProcessHost* render_process_host) { | 143 RenderProcessHost* render_process_host) { |
| 141 InstanceURL* instance_url = static_cast<InstanceURL*>( | 144 InstanceURL* instance_url = static_cast<InstanceURL*>( |
| 142 render_process_host->GetUserData(kMojoShellInstanceURL)); | 145 render_process_host->GetUserData(kMojoShellInstanceURL)); |
| 143 return instance_url ? instance_url->get() : std::string(); | 146 return instance_url ? instance_url->get() : std::string(); |
| 144 } | 147 } |
| 145 | 148 |
| 146 } // namespace content | 149 } // namespace content |
| OLD | NEW |