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

Unified Diff: mojo/environment/default_run_loop_impl.cc

Issue 695593002: Add Chromium environment application test support. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Cleanup. Created 6 years, 2 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
Index: mojo/environment/default_run_loop_impl.cc
diff --git a/mojo/environment/default_run_loop_impl.cc b/mojo/environment/default_run_loop_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..05086204101ef58856403f4fad0020b7398ee274
--- /dev/null
+++ b/mojo/environment/default_run_loop_impl.cc
@@ -0,0 +1,28 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/environment/default_run_loop_impl.h"
+
viettrungluu 2014/10/31 20:26:46 nit: #include "base/logging.h"
msw 2014/10/31 20:39:54 Done.
+#include "base/compiler_specific.h"
viettrungluu 2014/10/31 20:26:46 Not needed (see below).
msw 2014/10/31 20:39:54 Done.
+#include "base/message_loop/message_loop.h"
+
+namespace mojo {
+namespace internal {
+
+void InstantiateDefaultRunLoopImpl() {
+ CHECK(!base::MessageLoop::current());
+ // Not leaked: accessible from |base::MessageLoop::current()|.
+ base::MessageLoop* message_loop = new base::MessageLoop();
+ ALLOW_UNUSED_LOCAL(message_loop);
viettrungluu 2014/10/31 20:26:45 Not needed: not only is CHECK_EQ() always expanded
msw 2014/10/31 20:39:54 Done. I suspected that might be the case, but wasn
+ CHECK_EQ(message_loop, base::MessageLoop::current());
+}
+
+void DestroyDefaultRunLoopImpl() {
+ CHECK(base::MessageLoop::current());
+ delete base::MessageLoop::current();
+ CHECK(!base::MessageLoop::current());
+}
+
+} // namespace internal
+} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698