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

Side by Side Diff: content/browser/mojo/mojo_shell_client_host.cc

Issue 1769163002: Add a instance groups to Connect(), and introduce an Identity struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_mojo_shell.cc ('k') | content/browser/mojo/mojo_shell_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698