diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-16 16:31:28 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-16 16:31:28 +0000 |
commit | 188505284e175f0f75c341c1a7fbe00ca1773324 (patch) | |
tree | e1e868575e2b04b802770eb4579ce96271890dd0 /base/native_library_win.cc | |
parent | 2242609d9f24588b538af015d3ada1d4a9f8beb1 (diff) | |
download | chromium_src-188505284e175f0f75c341c1a7fbe00ca1773324.zip chromium_src-188505284e175f0f75c341c1a7fbe00ca1773324.tar.gz chromium_src-188505284e175f0f75c341c1a7fbe00ca1773324.tar.bz2 |
Quick fix to use file_util::SetCurrentDirectory method instead of the PathService method, also avoids the conflict with the the windows function.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/196072
Patch from thiago.farina@gmail.com.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26351 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/native_library_win.cc')
-rw-r--r-- | base/native_library_win.cc | 13 |
1 files changed, 6 insertions, 7 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, ¤t_directory)) { + FilePath current_directory; + if (file_util::GetCurrentDirectory(¤t_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; } |