summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/native_library_win.cc13
-rw-r--r--base/path_service.cc4
-rw-r--r--base/path_service.h11
3 files changed, 6 insertions, 22 deletions
diff --git a/base/native_library_win.cc b/base/native_library_win.cc
index 459e2ff..1c7accf 100644
--- a/base/native_library_win.cc
+++ b/base/native_library_win.cc
@@ -6,8 +6,7 @@
#include <windows.h>
-#include "base/file_path.h"
-#include "base/path_service.h"
+#include "base/file_util.h"
#include "base/string_util.h"
namespace base {
@@ -17,18 +16,18 @@ NativeLibrary LoadNativeLibrary(const FilePath& library_path) {
// Switch the current directory to the library directory as the library
// may have dependencies on DLLs in this directory.
bool restore_directory = false;
- std::wstring current_directory;
- if (PathService::Get(base::DIR_CURRENT, &current_directory)) {
+ FilePath current_directory;
+ if (file_util::GetCurrentDirectory(&current_directory)) {
FilePath plugin_path = library_path.DirName();
- if (!plugin_path.value().empty()) {
- PathService::SetCurrentDirectory(plugin_path.value());
+ if (!plugin_path.empty()) {
+ file_util::SetCurrentDirectory(plugin_path);
restore_directory = true;
}
}
HMODULE module = LoadLibrary(library_path.value().c_str());
if (restore_directory)
- PathService::SetCurrentDirectory(current_directory);
+ file_util::SetCurrentDirectory(current_directory);
return module;
}
diff --git a/base/path_service.cc b/base/path_service.cc
index a1b1db9..da172b3 100644
--- a/base/path_service.cc
+++ b/base/path_service.cc
@@ -231,10 +231,6 @@ bool PathService::Override(int key, const FilePath& path) {
return true;
}
-bool PathService::SetCurrentDirectory(const std::wstring& current_directory) {
- return file_util::SetCurrentDirectory(current_directory);
-}
-
void PathService::RegisterProvider(ProviderFunc func, int key_start,
int key_end) {
PathData* path_data = GetPathData();
diff --git a/base/path_service.h b/base/path_service.h
index c85a39a..39aaa2a 100644
--- a/base/path_service.h
+++ b/base/path_service.h
@@ -6,14 +6,6 @@
#define BASE_PATH_SERVICE_H_
#include "build/build_config.h"
-#ifdef OS_WIN
-// TODO(erikkay): this should be removable, but because SetCurrentDirectory
-// is the name of a Windows function, it gets macro-ized to SetCurrentDirectoryW
-// by windows.h, which leads to a different name in the header vs. the impl.
-// Even if we could fix that, it would still hose all callers of the function.
-// The right thing is likely to rename.
-#include <windows.h>
-#endif
#include <string>
@@ -53,9 +45,6 @@ class PathService {
// Return whether a path was overridden.
static bool IsOverridden(int key);
- // Sets the current directory.
- static bool SetCurrentDirectory(const std::wstring& current_directory);
-
// To extend the set of supported keys, you can register a path provider,
// which is just a function mirroring PathService::Get. The ProviderFunc
// returns false if it cannot provide a non-empty path for the given key.