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 #ifndef CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ |
6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ | 6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 // some Mojo application. May be called from any thread. |requestor_name| is | 38 // some Mojo application. May be called from any thread. |requestor_name| is |
39 // given to the target application as the requestor's name upon connection. | 39 // given to the target application as the requestor's name upon connection. |
40 static void ConnectToApplication( | 40 static void ConnectToApplication( |
41 const std::string& user_id, | 41 const std::string& user_id, |
42 const std::string& name, | 42 const std::string& name, |
43 const std::string& requestor_name, | 43 const std::string& requestor_name, |
44 shell::mojom::InterfaceProviderRequest request, | 44 shell::mojom::InterfaceProviderRequest request, |
45 shell::mojom::InterfaceProviderPtr exposed_services, | 45 shell::mojom::InterfaceProviderPtr exposed_services, |
46 const shell::mojom::Connector::ConnectCallback& callback); | 46 const shell::mojom::Connector::ConnectCallback& callback); |
47 | 47 |
| 48 // Returns a shell::Connector that can be used on the IO thread. |
| 49 static shell::Connector* GetConnectorForIOThread(); |
| 50 |
48 private: | 51 private: |
49 class BuiltinManifestProvider; | 52 class BuiltinManifestProvider; |
50 class Proxy; | 53 class Proxy; |
51 friend class Proxy; | 54 friend class Proxy; |
52 | 55 |
53 void ConnectToApplicationOnOwnThread( | 56 void ConnectToApplicationOnOwnThread( |
54 const std::string& user_id, | 57 const std::string& user_id, |
55 const std::string& name, | 58 const std::string& name, |
56 const std::string& requestor_name, | 59 const std::string& requestor_name, |
57 shell::mojom::InterfaceProviderRequest request, | 60 shell::mojom::InterfaceProviderRequest request, |
58 shell::mojom::InterfaceProviderPtr exposed_services, | 61 shell::mojom::InterfaceProviderPtr exposed_services, |
59 const shell::mojom::Connector::ConnectCallback& callback); | 62 const shell::mojom::Connector::ConnectCallback& callback); |
60 | 63 |
61 static base::LazyInstance<std::unique_ptr<Proxy>> proxy_; | 64 static base::LazyInstance<std::unique_ptr<Proxy>> proxy_; |
62 | 65 |
63 std::unique_ptr<BuiltinManifestProvider> manifest_provider_; | 66 std::unique_ptr<BuiltinManifestProvider> manifest_provider_; |
64 std::unique_ptr<catalog::Catalog> catalog_; | 67 std::unique_ptr<catalog::Catalog> catalog_; |
65 std::unique_ptr<shell::Shell> shell_; | 68 std::unique_ptr<shell::Shell> shell_; |
66 | 69 |
67 DISALLOW_COPY_AND_ASSIGN(MojoShellContext); | 70 DISALLOW_COPY_AND_ASSIGN(MojoShellContext); |
68 }; | 71 }; |
69 | 72 |
70 } // namespace content | 73 } // namespace content |
71 | 74 |
72 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ | 75 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ |
OLD | NEW |