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

Side by Side Diff: mojo/environment/environment.cc

Issue 1447273002: Mojo Log service and a thread-safe client library. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix destructor race condition in log_client.cc; add some comments Created 5 years, 1 month 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
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 #include "mojo/public/cpp/environment/environment.h" 5 #include "mojo/public/cpp/environment/environment.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "mojo/environment/default_async_waiter.h" 8 #include "mojo/environment/default_async_waiter.h"
9 #include "mojo/environment/default_logger.h" 9 #include "mojo/environment/default_logger.h"
10 10
(...skipping 17 matching lines...) Expand all
28 const MojoAsyncWaiter* Environment::GetDefaultAsyncWaiter() { 28 const MojoAsyncWaiter* Environment::GetDefaultAsyncWaiter() {
29 return &internal::kDefaultAsyncWaiter; 29 return &internal::kDefaultAsyncWaiter;
30 } 30 }
31 31
32 // static 32 // static
33 const MojoLogger* Environment::GetDefaultLogger() { 33 const MojoLogger* Environment::GetDefaultLogger() {
34 return &internal::kDefaultLogger; 34 return &internal::kDefaultLogger;
35 } 35 }
36 36
37 // static 37 // static
38 void Environment::SetDefaultLogger(const MojoLogger* logger) {}
39
40 // static
38 void Environment::InstantiateDefaultRunLoop() { 41 void Environment::InstantiateDefaultRunLoop() {
39 CHECK(!base::MessageLoop::current()); 42 CHECK(!base::MessageLoop::current());
40 // Not leaked: accessible from |base::MessageLoop::current()|. 43 // Not leaked: accessible from |base::MessageLoop::current()|.
41 base::MessageLoop* message_loop = new base::MessageLoop(); 44 base::MessageLoop* message_loop = new base::MessageLoop();
42 CHECK_EQ(message_loop, base::MessageLoop::current()); 45 CHECK_EQ(message_loop, base::MessageLoop::current());
43 } 46 }
44 47
45 // static 48 // static
46 void Environment::DestroyDefaultRunLoop() { 49 void Environment::DestroyDefaultRunLoop() {
47 CHECK(base::MessageLoop::current()); 50 CHECK(base::MessageLoop::current());
48 delete base::MessageLoop::current(); 51 delete base::MessageLoop::current();
49 CHECK(!base::MessageLoop::current()); 52 CHECK(!base::MessageLoop::current());
50 } 53 }
51 54
52 } // namespace mojo 55 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698