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

Unified Diff: net/test/spawned_test_server/local_test_server_win.cc

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 11 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 | « net/ssl/client_cert_store_chromeos.h ('k') | net/tools/crash_cache/crash_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/spawned_test_server/local_test_server_win.cc
diff --git a/net/test/spawned_test_server/local_test_server_win.cc b/net/test/spawned_test_server/local_test_server_win.cc
index 5eb5aafe91b720d3304c1b0d66eb983fb025fb93..71e1f7e70af1b5ea48d5fdb43bbcbfb91fe53810 100644
--- a/net/test/spawned_test_server/local_test_server_win.cc
+++ b/net/test/spawned_test_server/local_test_server_win.cc
@@ -78,60 +78,6 @@ bool ReadData(HANDLE read_fd, HANDLE write_fd,
return true;
}
-// Class that sets up a temporary path that includes the supplied path
-// at the end.
-//
-// TODO(bratell): By making this more generic we can possibly reuse
-// it at other places such as
-// chrome/common/multi_process_lock_unittest.cc.
-class ScopedPath {
- public:
- // Constructor which sets up the environment to include the path to
- // |path_to_add|.
- explicit ScopedPath(const base::FilePath& path_to_add);
-
- // Destructor that restores the path that were active when the
- // object was constructed.
- ~ScopedPath();
-
- private:
- // The PATH environment variable before it was changed or an empty
- // string if there was no PATH environment variable.
- std::string old_path_;
-
- // The helper object that allows us to read and set environment
- // variables more easily.
- scoped_ptr<base::Environment> environment_;
-
- // A flag saying if we have actually modified the environment.
- bool path_modified_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedPath);
-};
-
-ScopedPath::ScopedPath(const base::FilePath& path_to_add)
- : environment_(base::Environment::Create()),
- path_modified_(false) {
- environment_->GetVar("PATH", &old_path_);
-
- std::string new_value = old_path_;
- if (!new_value.empty())
- new_value += ";";
-
- new_value += base::WideToUTF8(path_to_add.value());
-
- path_modified_ = environment_->SetVar("PATH", new_value);
-}
-
-ScopedPath::~ScopedPath() {
- if (!path_modified_)
- return;
- if (old_path_.empty())
- environment_->UnSetVar("PATH");
- else
- environment_->SetVar("PATH", old_path_);
-}
-
} // namespace
namespace net {
« no previous file with comments | « net/ssl/client_cert_store_chromeos.h ('k') | net/tools/crash_cache/crash_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698