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

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

Issue 694923002: Update mojo sdk to rev 91d94d6993c9b0c4135a95687a7d541ce90629b (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « mojo/public/cpp/environment/environment.h ('k') | mojo/public/js/bindings/connection.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <assert.h> 7 #include <assert.h>
8 8
9 #include "mojo/public/c/environment/logger.h" 9 #include "mojo/public/c/environment/logger.h"
10 #include "mojo/public/cpp/environment/lib/default_async_waiter.h" 10 #include "mojo/public/cpp/environment/lib/default_async_waiter.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 assert(g_default_async_waiter); // Fails if not "inside" |Environment|. 54 assert(g_default_async_waiter); // Fails if not "inside" |Environment|.
55 return g_default_async_waiter; 55 return g_default_async_waiter;
56 } 56 }
57 57
58 // static 58 // static
59 const MojoLogger* Environment::GetDefaultLogger() { 59 const MojoLogger* Environment::GetDefaultLogger() {
60 assert(g_default_logger); // Fails if not "inside" |Environment|. 60 assert(g_default_logger); // Fails if not "inside" |Environment|.
61 return g_default_logger; 61 return g_default_logger;
62 } 62 }
63 63
64 // static
65 void Environment::InstantiateDefaultRunLoop() {
66 assert(!RunLoop::current());
67 // Not leaked: accessible from |RunLoop::current()|.
68 RunLoop* run_loop = new RunLoop();
69 MOJO_ALLOW_UNUSED_LOCAL(run_loop);
70 assert(run_loop == RunLoop::current());
71 }
72
73 // static
74 void Environment::DestroyDefaultRunLoop() {
75 assert(RunLoop::current());
76 delete RunLoop::current();
77 assert(!RunLoop::current());
78 }
79
64 } // namespace mojo 80 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/environment/environment.h ('k') | mojo/public/js/bindings/connection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698