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

Unified Diff: net/proxy/proxy_config_service_linux.cc

Issue 2086103002: Add base::ExecutableExistsInPath (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't leak base::Environment 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
« no previous file with comments | « chrome/browser/ui/webui/settings_utils_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config_service_linux.cc
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index db65567a3ecb5f10b96a4a6cb6f01bb664dd3b57..d6f89db918dd6019bbf7c63022025cfacbeb551d 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -19,7 +19,6 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/debug/leak_annotations.h"
-#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
@@ -29,7 +28,6 @@
#include "base/nix/xdg_util.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_split.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h"
@@ -834,23 +832,15 @@ bool SettingGetterImplGSettings::LoadAndCheckVersion(
}
g_object_unref(client);
- std::string path;
- if (!env->GetVar("PATH", &path)) {
- LOG(ERROR) << "No $PATH variable. Assuming no gnome-network-properties.";
- } else {
- // Yes, we're on the UI thread. Yes, we're accessing the file system.
- // Sadly, we don't have much choice. We need the proxy settings and we
- // need them now, and to figure out where to get them, we have to check
- // for this binary. See http://crbug.com/69057 for additional details.
+ // Yes, we're on the UI thread. Yes, we're accessing the file system.
+ // Sadly, we don't have much choice. We need the proxy settings and we
+ // need them now, and to figure out where to get them, we have to check
+ // for this binary. See http://crbug.com/69057 for additional details.
+ {
base::ThreadRestrictions::ScopedAllowIO allow_io;
-
- for (const base::StringPiece& path_str : base::SplitStringPiece(
- path, ":", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
- base::FilePath file(path_str);
- if (base::PathExists(file.Append("gnome-network-properties"))) {
- VLOG(1) << "Found gnome-network-properties. Will fall back to gconf.";
- return false;
- }
+ if (base::ExecutableExistsInPath(env, "gnome-network-properties")) {
+ VLOG(1) << "Found gnome-network-properties. Will fall back to gconf.";
+ return false;
}
}
« no previous file with comments | « chrome/browser/ui/webui/settings_utils_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698