| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_APPLICATION_HOST_H_ | 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ |
| 6 #define CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ | 6 #define CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
| 10 #include "content/common/mojo/service_registry_impl.h" | 10 #include "content/common/mojo/service_registry_impl.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // available so that child-provided services can be invoked. | 28 // available so that child-provided services can be invoked. |
| 29 class MojoApplicationHost { | 29 class MojoApplicationHost { |
| 30 public: | 30 public: |
| 31 MojoApplicationHost(); | 31 MojoApplicationHost(); |
| 32 virtual ~MojoApplicationHost(); | 32 virtual ~MojoApplicationHost(); |
| 33 | 33 |
| 34 // Two-phase initialization: | 34 // Two-phase initialization: |
| 35 // 1- Init makes service_registry() available synchronously. | 35 // 1- Init makes service_registry() available synchronously. |
| 36 // 2- Activate establishes the actual connection to the peer process. | 36 // 2- Activate establishes the actual connection to the peer process. |
| 37 bool Init(); | 37 bool Init(); |
| 38 bool Activate(IPC::Sender* sender, base::ProcessHandle process_handle); | 38 void Activate(IPC::Sender* sender, base::ProcessHandle process_handle); |
| 39 | 39 |
| 40 void WillDestroySoon(); | 40 void WillDestroySoon(); |
| 41 | 41 |
| 42 bool did_activate() const { return did_activate_; } | |
| 43 | |
| 44 ServiceRegistry* service_registry() { return &service_registry_; } | 42 ServiceRegistry* service_registry() { return &service_registry_; } |
| 45 | 43 |
| 46 private: | 44 private: |
| 47 mojo::embedder::ChannelInit channel_init_; | 45 mojo::embedder::ChannelInit channel_init_; |
| 48 mojo::embedder::ScopedPlatformHandle client_handle_; | 46 mojo::embedder::ScopedPlatformHandle client_handle_; |
| 49 | 47 |
| 50 bool did_activate_; | 48 bool did_activate_; |
| 51 | 49 |
| 52 ServiceRegistryImpl service_registry_; | 50 ServiceRegistryImpl service_registry_; |
| 53 | 51 |
| 54 #if defined(OS_ANDROID) | 52 #if defined(OS_ANDROID) |
| 55 scoped_ptr<ServiceRegistryAndroid> service_registry_android_; | 53 scoped_ptr<ServiceRegistryAndroid> service_registry_android_; |
| 56 #endif | 54 #endif |
| 57 | 55 |
| 58 DISALLOW_COPY_AND_ASSIGN(MojoApplicationHost); | 56 DISALLOW_COPY_AND_ASSIGN(MojoApplicationHost); |
| 59 }; | 57 }; |
| 60 | 58 |
| 61 } // namespace content | 59 } // namespace content |
| 62 | 60 |
| 63 #endif // CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ | 61 #endif // CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ |
| OLD | NEW |