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

Unified Diff: mojo/environment/environment.cc

Issue 1841863002: Update monet. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/environment/default_task_tracker_impl.cc ('k') | mojo/environment/mojo_environment_impl_export.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/environment/environment.cc
diff --git a/mojo/environment/environment.cc b/mojo/environment/environment.cc
index 7cc9b1cb05bc534f3852060f329c2c0c62523dc3..8867dd088342fc05e6af2788dd129edaefc5e306 100644
--- a/mojo/environment/environment.cc
+++ b/mojo/environment/environment.cc
@@ -2,12 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "third_party/mojo/src/mojo/public/cpp/environment/environment.h"
+#include "mojo/public/cpp/environment/environment.h"
-#include "mojo/environment/default_async_waiter_impl.h"
-#include "mojo/environment/default_logger_impl.h"
-#include "mojo/environment/default_run_loop_impl.h"
-#include "mojo/environment/default_task_tracker_impl.h"
+#include "base/message_loop/message_loop.h"
+#include "mojo/environment/default_async_waiter.h"
+#include "mojo/environment/default_logger.h"
namespace mojo {
@@ -27,29 +26,30 @@ Environment::~Environment() {
// static
const MojoAsyncWaiter* Environment::GetDefaultAsyncWaiter() {
- return internal::GetDefaultAsyncWaiterImpl();
+ return &internal::kDefaultAsyncWaiter;
}
// static
const MojoLogger* Environment::GetDefaultLogger() {
- return internal::GetDefaultLoggerImpl();
+ return &internal::kDefaultLogger;
}
// static
-const TaskTracker* Environment::GetDefaultTaskTracker() {
- return internal::GetDefaultTaskTracker();
-}
+void Environment::SetDefaultLogger(const MojoLogger* logger) {}
// static
void Environment::InstantiateDefaultRunLoop() {
- internal::InstantiateDefaultRunLoopImpl();
+ CHECK(!base::MessageLoop::current());
+ // Not leaked: accessible from |base::MessageLoop::current()|.
+ base::MessageLoop* message_loop = new base::MessageLoop();
+ CHECK_EQ(message_loop, base::MessageLoop::current());
}
// static
void Environment::DestroyDefaultRunLoop() {
- internal::DestroyDefaultRunLoopImpl();
+ CHECK(base::MessageLoop::current());
+ delete base::MessageLoop::current();
+ CHECK(!base::MessageLoop::current());
}
-
-
} // namespace mojo
« no previous file with comments | « mojo/environment/default_task_tracker_impl.cc ('k') | mojo/environment/mojo_environment_impl_export.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698