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

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

Issue 1778443002: Use instance name to uniquify renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@40fix2
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 #ifndef CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_ 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_
6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_ 6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/process/process_handle.h" 10 #include "base/process/process_handle.h"
11 #include "mojo/shell/public/cpp/identity.h"
11 #include "mojo/shell/public/interfaces/shell.mojom.h" 12 #include "mojo/shell/public/interfaces/shell.mojom.h"
12 13
13 namespace content { 14 namespace content {
14 15
15 class RenderProcessHost; 16 class RenderProcessHost;
16 17
17 // Creates a communication channel between the external Mojo shell and the 18 // Creates a communication channel between the external Mojo shell and the
18 // child. The server handle of this channel is shared with the external shell 19 // child. The server handle of this channel is shared with the external shell
19 // via Mojo IPC. |child_process_id| and |instance_id| are used to uniquify the 20 // via Mojo IPC. |child_process_id| and |instance_id| are used to uniquify the
20 // child in the external shell's instance map. 21 // child in the external shell's instance map.
21 // 22 //
22 // This returns a token that may be passed to the child process and exchanged 23 // This returns a token that may be passed to the child process and exchanged
23 // for a pipe there. That pipe can in turn be passed to 24 // for a pipe there. That pipe can in turn be passed to
24 // MojoShellConnectionImpl::BindToMessagePipe() to initialize the child's 25 // MojoShellConnectionImpl::BindToMessagePipe() to initialize the child's
25 // shell connection. 26 // shell connection.
26 std::string RegisterChildWithExternalShell( 27 std::string RegisterChildWithExternalShell(
27 int child_process_id, 28 int child_process_id,
28 int instance_id, 29 int instance_id,
29 RenderProcessHost* render_process_host); 30 RenderProcessHost* render_process_host);
30 31
31 // Returns the URL associated with an instance corresponding to the renderer 32 // Returns the Identity associated with an instance corresponding to the
32 // process in the external shell. This URL can be passed to 33 // renderer process in shell. This Identity can be passed to Connect() to open a
33 // ConnectToApplication() to open a new connection to this renderer. 34 // new connection to this renderer.
34 std::string GetMojoApplicationInstanceURL( 35 mojo::Identity GetMojoIdentity(RenderProcessHost* render_process_host);
35 RenderProcessHost* render_process_host);
36 36
37 // Constructs a Capability Filter for the renderer's application instance in the 37 // Constructs a Capability Filter for the renderer's application instance in the
38 // external shell. This contains the restrictions imposed on what applications 38 // external shell. This contains the restrictions imposed on what applications
39 // and interfaces the renderer can see. The implementation lives in 39 // and interfaces the renderer can see. The implementation lives in
40 // renderer_capability_filter.cc so that it can be subject to specific security 40 // renderer_capability_filter.cc so that it can be subject to specific security
41 // review. 41 // review.
42 mojo::shell::mojom::CapabilityFilterPtr CreateCapabilityFilterForRenderer(); 42 mojo::shell::mojom::CapabilityFilterPtr CreateCapabilityFilterForRenderer();
43 43
44 } // namespace content 44 } // namespace content
45 45
46 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_ 46 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/mojo/mojo_shell_client_host.cc » ('j') | content/browser/mojo/mojo_shell_client_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698