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 MOJO_EDK_EMBEDDER_EMBEDDER_H_ | 5 #ifndef MOJO_EDK_EMBEDDER_EMBEDDER_H_ |
6 #define MOJO_EDK_EMBEDDER_EMBEDDER_H_ | 6 #define MOJO_EDK_EMBEDDER_EMBEDDER_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/callback.h" | 11 #include "base/callback.h" |
11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/task_runner.h" | 13 #include "base/task_runner.h" |
14 #include "mojo/edk/embedder/channel_info_forward.h" | 14 #include "mojo/edk/embedder/channel_info_forward.h" |
15 #include "mojo/edk/embedder/process_type.h" | 15 #include "mojo/edk/embedder/process_type.h" |
16 #include "mojo/edk/embedder/scoped_platform_handle.h" | 16 #include "mojo/edk/embedder/scoped_platform_handle.h" |
17 #include "mojo/edk/embedder/slave_info.h" | 17 #include "mojo/edk/embedder/slave_info.h" |
18 #include "mojo/edk/system/system_impl_export.h" | 18 #include "mojo/edk/system/system_impl_export.h" |
19 #include "mojo/public/cpp/system/message_pipe.h" | 19 #include "mojo/public/cpp/system/message_pipe.h" |
20 | 20 |
21 namespace mojo { | 21 namespace mojo { |
22 namespace embedder { | 22 namespace embedder { |
23 | 23 |
24 struct Configuration; | 24 struct Configuration; |
25 class PlatformSupport; | 25 class PlatformSupport; |
26 class ProcessDelegate; | 26 class ProcessDelegate; |
27 | 27 |
28 // Basic configuration/initialization ------------------------------------------ | 28 // Basic configuration/initialization ------------------------------------------ |
29 | 29 |
30 // |Init()| sets up the basic Mojo system environment, making the |Mojo...()| | 30 // |Init()| sets up the basic Mojo system environment, making the |Mojo...()| |
31 // functions available and functional. This is never shut down (except in tests | 31 // functions available and functional. This is never shut down (except in tests |
32 // -- see test_embedder.h). | 32 // -- see test_embedder.h). |
33 | 33 |
34 // Returns the global configuration. In general, you should not need to change | 34 // Returns the global configuration. In general, you should not need to change |
35 // the configuration, but if you do you must do it before calling |Init()|. | 35 // the configuration, but if you do you must do it before calling |Init()|. |
36 MOJO_SYSTEM_IMPL_EXPORT Configuration* GetConfiguration(); | 36 MOJO_SYSTEM_IMPL_EXPORT Configuration* GetConfiguration(); |
37 | 37 |
38 // Must be called first, or just after setting configuration parameters, to | 38 // Must be called first, or just after setting configuration parameters, to |
39 // initialize the (global, singleton) system. | 39 // initialize the (global, singleton) system. |
40 MOJO_SYSTEM_IMPL_EXPORT void Init(scoped_ptr<PlatformSupport> platform_support); | 40 MOJO_SYSTEM_IMPL_EXPORT void Init( |
| 41 std::unique_ptr<PlatformSupport> platform_support); |
41 | 42 |
42 // Basic functions ------------------------------------------------------------- | 43 // Basic functions ------------------------------------------------------------- |
43 | 44 |
44 // The functions in this section are available once |Init()| has been called. | 45 // The functions in this section are available once |Init()| has been called. |
45 | 46 |
46 // Start waiting on the handle asynchronously. On success, |callback| will be | 47 // Start waiting on the handle asynchronously. On success, |callback| will be |
47 // called exactly once, when |handle| satisfies a signal in |signals| or it | 48 // called exactly once, when |handle| satisfies a signal in |signals| or it |
48 // becomes known that it will never do so. |callback| will be executed on an | 49 // becomes known that it will never do so. |callback| will be executed on an |
49 // arbitrary thread, so it must not call any Mojo system or embedder functions. | 50 // arbitrary thread, so it must not call any Mojo system or embedder functions. |
50 MOJO_SYSTEM_IMPL_EXPORT MojoResult | 51 MOJO_SYSTEM_IMPL_EXPORT MojoResult |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 234 |
234 // Inform the channel that it will soon be destroyed (doing so is optional). | 235 // Inform the channel that it will soon be destroyed (doing so is optional). |
235 // This may be called from any thread, but the caller must ensure that this is | 236 // This may be called from any thread, but the caller must ensure that this is |
236 // called before |DestroyChannel()|. | 237 // called before |DestroyChannel()|. |
237 MOJO_SYSTEM_IMPL_EXPORT void WillDestroyChannelSoon(ChannelInfo* channel_info); | 238 MOJO_SYSTEM_IMPL_EXPORT void WillDestroyChannelSoon(ChannelInfo* channel_info); |
238 | 239 |
239 } // namespace embedder | 240 } // namespace embedder |
240 } // namespace mojo | 241 } // namespace mojo |
241 | 242 |
242 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_H_ | 243 #endif // MOJO_EDK_EMBEDDER_EMBEDDER_H_ |
OLD | NEW |