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_CHILD_MOJO_MOJO_APPLICATION_H_ | 5 #ifndef CONTENT_CHILD_MOJO_MOJO_APPLICATION_H_ |
6 #define CONTENT_CHILD_MOJO_MOJO_APPLICATION_H_ | 6 #define CONTENT_CHILD_MOJO_MOJO_APPLICATION_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" |
9 #include "content/common/mojo/channel_init.h" | 10 #include "content/common/mojo/channel_init.h" |
10 #include "content/common/mojo/service_registry_impl.h" | 11 #include "content/common/mojo/service_registry_impl.h" |
11 #include "ipc/ipc_platform_file.h" | 12 #include "ipc/ipc_platform_file.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 class SequencedTaskRunner; | 15 class SequencedTaskRunner; |
15 } | 16 } |
16 | 17 |
17 namespace IPC { | 18 namespace IPC { |
18 class Message; | 19 class Message; |
(...skipping 11 matching lines...) Expand all Loading... |
30 scoped_refptr<base::SequencedTaskRunner> io_task_runner); | 31 scoped_refptr<base::SequencedTaskRunner> io_task_runner); |
31 virtual ~MojoApplication(); | 32 virtual ~MojoApplication(); |
32 | 33 |
33 bool OnMessageReceived(const IPC::Message& msg); | 34 bool OnMessageReceived(const IPC::Message& msg); |
34 | 35 |
35 ServiceRegistry* service_registry() { return &service_registry_; } | 36 ServiceRegistry* service_registry() { return &service_registry_; } |
36 | 37 |
37 private: | 38 private: |
38 void OnActivate(const IPC::PlatformFileForTransit& file); | 39 void OnActivate(const IPC::PlatformFileForTransit& file); |
39 | 40 |
| 41 void OnMessagePipeCreated(mojo::ScopedMessagePipeHandle pipe); |
| 42 |
40 scoped_refptr<base::SequencedTaskRunner> io_task_runner_; | 43 scoped_refptr<base::SequencedTaskRunner> io_task_runner_; |
41 | |
42 ChannelInit channel_init_; | 44 ChannelInit channel_init_; |
43 | |
44 ServiceRegistryImpl service_registry_; | 45 ServiceRegistryImpl service_registry_; |
| 46 base::WeakPtrFactory<MojoApplication> weak_factory_; |
45 | 47 |
46 DISALLOW_COPY_AND_ASSIGN(MojoApplication); | 48 DISALLOW_COPY_AND_ASSIGN(MojoApplication); |
47 }; | 49 }; |
48 | 50 |
49 } // namespace content | 51 } // namespace content |
50 | 52 |
51 #endif // CONTENT_CHILD_MOJO_MOJO_APPLICATION_H_ | 53 #endif // CONTENT_CHILD_MOJO_MOJO_APPLICATION_H_ |
OLD | NEW |