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

Unified Diff: base/env_var.h

Issue 1606007: Move EnvironmentVariableGetter from base/linux_util.h to base/env_var.h. Labe... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix windows build for good this time? Created 10 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 | « base/base_paths_posix.cc ('k') | base/env_var.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/env_var.h
===================================================================
--- base/env_var.h (revision 0)
+++ base/env_var.h (revision 0)
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 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.
+
+#ifndef BASE_ENV_VAR_H_
+#define BASE_ENV_VAR_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+
+namespace base {
+
+// These are used to derive mocks for unittests.
+class EnvVarGetter {
+ public:
+ virtual ~EnvVarGetter() {}
+ // Gets an environment variable's value and stores it in |result|.
+ // Returns false if the key is unset.
+ virtual bool GetEnv(const char* variable_name, std::string* result) = 0;
+
+ // Syntactic sugar for GetEnv(variable_name, NULL);
+ virtual bool HasEnv(const char* variable_name) {
+ return GetEnv(variable_name, NULL);
+ }
+
+ // Create an instance of EnvVarGetter
+ static EnvVarGetter* Create();
+};
+
+} // namespace base
+
+#endif // BASE_ENV_VAR_H_
Property changes on: base/env_var.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « base/base_paths_posix.cc ('k') | base/env_var.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698