Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: mojo/public/cpp/environment/environment.h

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_PUBLIC_CPP_ENVIRONMENT_ENVIRONMENT_H_
6 #define MOJO_PUBLIC_CPP_ENVIRONMENT_ENVIRONMENT_H_
7
8 #include "mojo/public/cpp/system/macros.h"
9
10 struct MojoAsyncWaiter;
11 struct MojoLogger;
12
13 namespace mojo {
14
15 // This class just acts as a "namespace": it only has static methods (whose
16 // implementation may be varied). Note that some implementations may require
17 // their own explicit initialization/shut down functions to be called.
18 class Environment {
19 public:
20 static const MojoAsyncWaiter* GetDefaultAsyncWaiter();
21 // Setting the default async waiter to null will use the original default
22 // implementation.
23 static void SetDefaultAsyncWaiter(const MojoAsyncWaiter* async_waiter);
24
25 static const MojoLogger* GetDefaultLogger();
26 // Setting the logger to null will use the will use the original default
27 // implementation.
28 static void SetDefaultLogger(const MojoLogger* logger);
29
30 // These instantiate and destroy an environment-specific run loop for the
31 // current thread, allowing |GetDefaultAsyncWaiter()| to be used. (The run
32 // loop itself should be accessible via thread-local storage, using methods
33 // specific to the run loop implementation.) Creating and destroying nested
34 // run loops is not supported.
35 static void InstantiateDefaultRunLoop();
36 static void DestroyDefaultRunLoop();
37
38 private:
39 Environment() = delete;
40 ~Environment() = delete;
41 };
42
43 } // namespace mojo
44
45 #endif // MOJO_PUBLIC_CPP_ENVIRONMENT_ENVIRONMENT_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/environment/async_waiter.h ('k') | mojo/public/cpp/environment/lib/async_waiter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698