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

Side by Side Diff: mojo/public/cpp/environment/lib/environment.cc

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 #include "mojo/public/cpp/environment/environment.h"
6
7 #include <assert.h>
8 #include <mojo/environment/logger.h>
9
10 #include "mojo/public/cpp/environment/lib/default_async_waiter.h"
11 #include "mojo/public/cpp/environment/lib/default_logger.h"
12 #include "mojo/public/cpp/utility/run_loop.h"
13
14 namespace mojo {
15
16 const MojoAsyncWaiter* g_default_async_waiter = &internal::kDefaultAsyncWaiter;
17 const MojoLogger* g_default_logger = &internal::kDefaultLogger;
18
19 // static
20 const MojoAsyncWaiter* Environment::GetDefaultAsyncWaiter() {
21 return g_default_async_waiter;
22 }
23
24 // static
25 void Environment::SetDefaultAsyncWaiter(const MojoAsyncWaiter* async_waiter) {
26 g_default_async_waiter =
27 async_waiter ? async_waiter : &internal::kDefaultAsyncWaiter;
28 }
29
30 // static
31 const MojoLogger* Environment::GetDefaultLogger() {
32 return g_default_logger;
33 }
34
35 // static
36 void Environment::SetDefaultLogger(const MojoLogger* logger) {
37 g_default_logger = logger ? logger : &internal::kDefaultLogger;
38 }
39
40 // static
41 void Environment::InstantiateDefaultRunLoop() {
42 assert(!RunLoop::current());
43 // Not leaked: accessible from |RunLoop::current()|.
44 RunLoop* run_loop = new RunLoop();
45 MOJO_ALLOW_UNUSED_LOCAL(run_loop);
46 assert(run_loop == RunLoop::current());
47 }
48
49 // static
50 void Environment::DestroyDefaultRunLoop() {
51 assert(RunLoop::current());
52 delete RunLoop::current();
53 assert(!RunLoop::current());
54 }
55
56 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/environment/lib/default_logger.cc ('k') | mojo/public/cpp/environment/lib/logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698