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

Unified Diff: content/ppapi_plugin/ppapi_plugin_main.cc

Issue 200473002: Move all callers of GetHomeDir() to PathService::Get(base::DIR_HOME). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 9 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: content/ppapi_plugin/ppapi_plugin_main.cc
diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc
index ab32b665346b4b57ce4f4af44574e567cbbbc34c..3c1d7215fcde666fe89c36ade87c46162e153fc8 100644
--- a/content/ppapi_plugin/ppapi_plugin_main.cc
+++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -2,10 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/debug/debugger.h"
+#include "base/files/file_path.h"
#include "base/i18n/rtl.h"
#include "base/message_loop/message_loop.h"
+#include "base/path_service.h"
#include "base/threading/platform_thread.h"
#include "build/build_config.h"
#include "content/child/child_process.h"
@@ -101,7 +104,14 @@ int PpapiPluginMain(const MainFunctionParams& parameters) {
#if defined(OS_CHROMEOS)
// Specifies $HOME explicitly because some plugins rely on $HOME but
// no other part of Chrome OS uses that. See crbug.com/335290.
- setenv("HOME", base::GetHomeDir().value().c_str(), 1);
+ base::FilePath homedir;
+ if (command_line.HasSwitch(switches::kHomedir)) {
+ homedir =
+ base::FilePath(command_line.GetSwitchValueASCII(switches::kHomedir));
+ } else {
+ PathService::Get(base::DIR_HOME, &homedir);
+ }
+ setenv("HOME", homedir.value().c_str(), 1);
#endif
base::MessageLoop main_message_loop;

Powered by Google App Engine
This is Rietveld 408576698