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

Unified Diff: mojo/public/cpp/environment/environment.h

Issue 339403003: Mojo: Make GetDefault{AsyncWaiter,Logger} static methods of Environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/public/cpp/environment/environment.h
diff --git a/mojo/public/cpp/environment/environment.h b/mojo/public/cpp/environment/environment.h
index 3cc179a8959f4737f42fed7fd3f99592dc5f35a8..48f4c26eb724cf824e34ab89af3b351ceda590ad 100644
--- a/mojo/public/cpp/environment/environment.h
+++ b/mojo/public/cpp/environment/environment.h
@@ -5,19 +5,32 @@
#ifndef MOJO_PUBLIC_CPP_ENVIRONMENT_ENVIRONMENT_H_
#define MOJO_PUBLIC_CPP_ENVIRONMENT_ENVIRONMENT_H_
-#include "mojo/public/c/environment/logger.h"
#include "mojo/public/cpp/system/macros.h"
+struct MojoAsyncWaiter;
+struct MojoLogger;
+
namespace mojo {
-// This class must be instantiated before using any Mojo C++ APIs.
+// Other parts of the Mojo C++ APIs use the *static* methods of this class.
+//
+// The "standalone" implementation of this class requires that this class (in
+// the lib/ subdirectory) be instantiated (and remain so) while using the Mojo
+// C++ APIs. I.e., the static methods depend on things set up by the constructor
+// and torn down by the destructor.
+//
+// Other implementations may not have this requirement.
class Environment {
public:
Environment();
+ // This constructor allows the standard implementations to be overridden (set
+ // a parameter to null to get the standard implementation).
+ Environment(const MojoAsyncWaiter* default_async_waiter,
+ const MojoLogger* default_logger);
~Environment();
- // Note: Not thread-safe; the default logger must not be used concurrently.
- static void SetMinimumLogLevel(MojoLogLevel minimum_log_level);
+ static const MojoAsyncWaiter* GetDefaultAsyncWaiter();
+ static const MojoLogger* GetDefaultLogger();
private:
MOJO_DISALLOW_COPY_AND_ASSIGN(Environment);
« no previous file with comments | « mojo/public/cpp/environment/default_logger.h ('k') | mojo/public/cpp/environment/lib/default_async_waiter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698