| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHILD_CHILD_THREAD_IMPL_H_ | 5 #ifndef CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
| 6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 #if defined(OS_WIN) | 99 #if defined(OS_WIN) |
| 100 void PreCacheFont(const LOGFONT& log_font) override; | 100 void PreCacheFont(const LOGFONT& log_font) override; |
| 101 void ReleaseCachedFonts() override; | 101 void ReleaseCachedFonts() override; |
| 102 #endif | 102 #endif |
| 103 void RecordAction(const base::UserMetricsAction& action) override; | 103 void RecordAction(const base::UserMetricsAction& action) override; |
| 104 void RecordComputedAction(const std::string& action) override; | 104 void RecordComputedAction(const std::string& action) override; |
| 105 ServiceManagerConnection* GetServiceManagerConnection() override; | 105 ServiceManagerConnection* GetServiceManagerConnection() override; |
| 106 service_manager::InterfaceRegistry* GetInterfaceRegistry() override; | 106 service_manager::InterfaceRegistry* GetInterfaceRegistry() override; |
| 107 service_manager::InterfaceProvider* GetRemoteInterfaces() override; | 107 service_manager::InterfaceProvider* GetRemoteInterfaces() override; |
| 108 | 108 |
| 109 // Returns the service_manager::ServiceInfo for the child process & the |
| 110 // browser process, once available. |
| 111 const service_manager::ServiceInfo& GetChildServiceInfo() const; |
| 112 const service_manager::ServiceInfo& GetBrowserServiceInfo() const; |
| 113 bool IsConnectedToBrowser() const; |
| 114 |
| 109 IPC::SyncChannel* channel() { return channel_.get(); } | 115 IPC::SyncChannel* channel() { return channel_.get(); } |
| 110 | 116 |
| 111 IPC::MessageRouter* GetRouter(); | 117 IPC::MessageRouter* GetRouter(); |
| 112 | 118 |
| 113 mojom::RouteProvider* GetRemoteRouteProvider(); | 119 mojom::RouteProvider* GetRemoteRouteProvider(); |
| 114 | 120 |
| 115 // Allocates a block of shared memory of the given size. Returns NULL on | 121 // Allocates a block of shared memory of the given size. Returns NULL on |
| 116 // failure. | 122 // failure. |
| 117 // Note: On posix, this requires a sync IPC to the browser process, | 123 // Note: On posix, this requires a sync IPC to the browser process, |
| 118 // but on windows the child process directly allocates the block. | 124 // but on windows the child process directly allocates the block. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // mojom::RouteProvider: | 265 // mojom::RouteProvider: |
| 260 void GetRoute( | 266 void GetRoute( |
| 261 int32_t routing_id, | 267 int32_t routing_id, |
| 262 mojom::AssociatedInterfaceProviderAssociatedRequest request) override; | 268 mojom::AssociatedInterfaceProviderAssociatedRequest request) override; |
| 263 | 269 |
| 264 // mojom::AssociatedInterfaceProvider: | 270 // mojom::AssociatedInterfaceProvider: |
| 265 void GetAssociatedInterface( | 271 void GetAssociatedInterface( |
| 266 const std::string& name, | 272 const std::string& name, |
| 267 mojom::AssociatedInterfaceAssociatedRequest request) override; | 273 mojom::AssociatedInterfaceAssociatedRequest request) override; |
| 268 | 274 |
| 275 // Called when a connection is received from another service. When that other |
| 276 // service is the browser process, stores the remote's info. |
| 277 void OnServiceConnect(const service_manager::ServiceInfo& local_info, |
| 278 const service_manager::ServiceInfo& remote_info); |
| 279 |
| 269 std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; | 280 std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; |
| 270 std::unique_ptr<service_manager::InterfaceRegistry> interface_registry_; | 281 std::unique_ptr<service_manager::InterfaceRegistry> interface_registry_; |
| 271 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces_; | 282 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces_; |
| 272 std::unique_ptr<ServiceManagerConnection> service_manager_connection_; | 283 std::unique_ptr<ServiceManagerConnection> service_manager_connection_; |
| 273 std::unique_ptr<service_manager::Connection> browser_connection_; | 284 std::unique_ptr<service_manager::Connection> browser_connection_; |
| 274 | 285 |
| 286 bool connected_to_browser_ = false; |
| 287 service_manager::ServiceInfo child_info_; |
| 288 service_manager::ServiceInfo browser_info_; |
| 289 |
| 275 mojo::AssociatedBinding<mojom::RouteProvider> route_provider_binding_; | 290 mojo::AssociatedBinding<mojom::RouteProvider> route_provider_binding_; |
| 276 mojo::AssociatedBindingSet<mojom::AssociatedInterfaceProvider> | 291 mojo::AssociatedBindingSet<mojom::AssociatedInterfaceProvider> |
| 277 associated_interface_provider_bindings_; | 292 associated_interface_provider_bindings_; |
| 278 mojom::RouteProviderAssociatedPtr remote_route_provider_; | 293 mojom::RouteProviderAssociatedPtr remote_route_provider_; |
| 279 | 294 |
| 280 std::unique_ptr<IPC::SyncChannel> channel_; | 295 std::unique_ptr<IPC::SyncChannel> channel_; |
| 281 | 296 |
| 282 // Allows threads other than the main thread to send sync messages. | 297 // Allows threads other than the main thread to send sync messages. |
| 283 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 298 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
| 284 | 299 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 374 |
| 360 private: | 375 private: |
| 361 struct Options options_; | 376 struct Options options_; |
| 362 | 377 |
| 363 DISALLOW_COPY_AND_ASSIGN(Builder); | 378 DISALLOW_COPY_AND_ASSIGN(Builder); |
| 364 }; | 379 }; |
| 365 | 380 |
| 366 } // namespace content | 381 } // namespace content |
| 367 | 382 |
| 368 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 383 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
| OLD | NEW |