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

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

Issue 1997473005: Remove requirement that mojo::Environment be instantiated. (Closed) Base URL: https://github.com/domokit/mojo.git@work797_no_utility_tls
Patch Set: rebased Created 4 years, 7 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 85d17992c0a865f6f4f5e2b0a5a34ecef5c4e931..d3ab352bf29ed47061fdb6efd61d639e05756281 100644
--- a/mojo/public/cpp/environment/environment.h
+++ b/mojo/public/cpp/environment/environment.h
@@ -12,23 +12,11 @@ struct MojoLogger;
namespace mojo {
-// 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.
+// This class just acts as a "namespace": it only has static methods (whose
+// implementation may be varied). Note that some implementations may require
+// their own explicit initialization/shut down functions to be called.
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,
vardhan 2016/05/20 18:38:06 if the default async waiter or default logger do n
viettrungluu 2016/05/20 21:09:46 Either that, or some implementations may require e
- const MojoLogger* default_logger);
- ~Environment();
-
static const MojoAsyncWaiter* GetDefaultAsyncWaiter();
vardhan 2016/05/20 18:38:06 should we have a SetDefaultAsyncWaitier() as well?
viettrungluu 2016/05/20 21:09:46 Done.
static const MojoLogger* GetDefaultLogger();
@@ -44,7 +32,8 @@ class Environment {
static void DestroyDefaultRunLoop();
private:
- MOJO_DISALLOW_COPY_AND_ASSIGN(Environment);
+ Environment() = delete;
+ ~Environment() = delete;
};
} // namespace mojo
« no previous file with comments | « mojo/public/cpp/bindings/tests/validation_unittest.cc ('k') | mojo/public/cpp/environment/lib/environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698