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

Unified Diff: chrome/browser/shell_integration_linux_unittest.cc

Issue 2094913002: Make base::Environment::Create() return unique_ptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: '' Created 4 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: chrome/browser/shell_integration_linux_unittest.cc
diff --git a/chrome/browser/shell_integration_linux_unittest.cc b/chrome/browser/shell_integration_linux_unittest.cc
index 96a18a01250006b68d21b9fff8a280e28638c61c..ff5ff43d5f3155140b6a1206fdcda2cd5a1db5a2 100644
--- a/chrome/browser/shell_integration_linux_unittest.cc
+++ b/chrome/browser/shell_integration_linux_unittest.cc
@@ -41,11 +41,11 @@ class MockEnvironment : public base::Environment {
public:
MockEnvironment() {}
- void Set(const std::string& name, const std::string& value) {
+ void Set(base::StringPiece name, const std::string& value) {
variables_[name] = value;
}
- bool GetVar(const char* variable_name, std::string* result) override {
+ bool GetVar(base::StringPiece variable_name, std::string* result) override {
if (ContainsKey(variables_, variable_name)) {
*result = variables_[variable_name];
return true;
@@ -54,19 +54,19 @@ class MockEnvironment : public base::Environment {
return false;
}
- bool SetVar(const char* variable_name,
+ bool SetVar(base::StringPiece variable_name,
const std::string& new_value) override {
ADD_FAILURE();
return false;
}
- bool UnSetVar(const char* variable_name) override {
+ bool UnSetVar(base::StringPiece variable_name) override {
ADD_FAILURE();
return false;
}
private:
- std::map<std::string, std::string> variables_;
+ std::map<base::StringPiece, std::string> variables_;
dcheng 2016/06/24 17:28:35 It's not obvious that this is safe (or that it wil
Lei Zhang 2016/06/24 18:56:03 Sure. I don't have strong feelings about creating
DISALLOW_COPY_AND_ASSIGN(MockEnvironment);
};

Powered by Google App Engine
This is Rietveld 408576698