diff options
Diffstat (limited to 'chromium/base/environment.h')
-rw-r--r-- | chromium/base/environment.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/chromium/base/environment.h b/chromium/base/environment.h index 12eeaf7ebb1..3a4ed04e4bb 100644 --- a/chromium/base/environment.h +++ b/chromium/base/environment.h @@ -11,6 +11,7 @@ #include "base/base_export.h" #include "base/strings/string16.h" +#include "base/strings/string_piece.h" #include "build/build_config.h" namespace base { @@ -27,23 +28,22 @@ class BASE_EXPORT Environment { public: virtual ~Environment(); - // Static factory method that returns the implementation that provide the - // appropriate platform-specific instance. - static Environment* Create(); + // Returns the appropriate platform-specific instance. + static std::unique_ptr<Environment> Create(); // Gets an environment variable's value and stores it in |result|. // Returns false if the key is unset. - virtual bool GetVar(const char* variable_name, std::string* result) = 0; + virtual bool GetVar(StringPiece variable_name, std::string* result) = 0; - // Syntactic sugar for GetVar(variable_name, NULL); - virtual bool HasVar(const char* variable_name); + // Syntactic sugar for GetVar(variable_name, nullptr); + virtual bool HasVar(StringPiece variable_name); // Returns true on success, otherwise returns false. - virtual bool SetVar(const char* variable_name, + virtual bool SetVar(StringPiece variable_name, const std::string& new_value) = 0; // Returns true on success, otherwise returns false. - virtual bool UnSetVar(const char* variable_name) = 0; + virtual bool UnSetVar(StringPiece variable_name) = 0; }; |