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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/base_paths.h"
5 #include "base/command_line.h" 6 #include "base/command_line.h"
6 #include "base/debug/debugger.h" 7 #include "base/debug/debugger.h"
8 #include "base/files/file_path.h"
7 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
8 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/path_service.h"
9 #include "base/threading/platform_thread.h" 12 #include "base/threading/platform_thread.h"
10 #include "build/build_config.h" 13 #include "build/build_config.h"
11 #include "content/child/child_process.h" 14 #include "content/child/child_process.h"
12 #include "content/common/content_constants_internal.h" 15 #include "content/common/content_constants_internal.h"
13 #include "content/common/sandbox_linux/sandbox_linux.h" 16 #include "content/common/sandbox_linux/sandbox_linux.h"
14 #include "content/ppapi_plugin/ppapi_thread.h" 17 #include "content/ppapi_plugin/ppapi_thread.h"
15 #include "content/public/common/content_client.h" 18 #include "content/public/common/content_client.h"
16 #include "content/public/common/content_switches.h" 19 #include "content/public/common/content_switches.h"
17 #include "content/public/common/main_function_params.h" 20 #include "content/public/common/main_function_params.h"
18 #include "content/public/plugin/content_plugin_client.h" 21 #include "content/public/plugin/content_plugin_client.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 std::replace(locale.begin(), locale.end(), '-', '_'); 97 std::replace(locale.begin(), locale.end(), '-', '_');
95 locale.append(".UTF-8"); 98 locale.append(".UTF-8");
96 setlocale(LC_ALL, locale.c_str()); 99 setlocale(LC_ALL, locale.c_str());
97 setenv("LANG", locale.c_str(), 0); 100 setenv("LANG", locale.c_str(), 0);
98 #endif 101 #endif
99 } 102 }
100 103
101 #if defined(OS_CHROMEOS) 104 #if defined(OS_CHROMEOS)
102 // Specifies $HOME explicitly because some plugins rely on $HOME but 105 // Specifies $HOME explicitly because some plugins rely on $HOME but
103 // no other part of Chrome OS uses that. See crbug.com/335290. 106 // no other part of Chrome OS uses that. See crbug.com/335290.
104 setenv("HOME", base::GetHomeDir().value().c_str(), 1); 107 base::FilePath homedir;
108 if (command_line.HasSwitch(switches::kHomedir)) {
109 homedir =
110 base::FilePath(command_line.GetSwitchValueASCII(switches::kHomedir));
111 } else {
112 PathService::Get(base::DIR_HOME, &homedir);
113 }
114 setenv("HOME", homedir.value().c_str(), 1);
105 #endif 115 #endif
106 116
107 base::MessageLoop main_message_loop; 117 base::MessageLoop main_message_loop;
108 base::PlatformThread::SetName("CrPPAPIMain"); 118 base::PlatformThread::SetName("CrPPAPIMain");
109 base::debug::TraceLog::GetInstance()->SetProcessName("PPAPI Process"); 119 base::debug::TraceLog::GetInstance()->SetProcessName("PPAPI Process");
110 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( 120 base::debug::TraceLog::GetInstance()->SetProcessSortIndex(
111 kTraceEventPpapiProcessSortIndex); 121 kTraceEventPpapiProcessSortIndex);
112 122
113 #if defined(OS_LINUX) && defined(USE_NSS) 123 #if defined(OS_LINUX) && defined(USE_NSS)
114 // Some out-of-process PPAPI plugins use NSS. 124 // Some out-of-process PPAPI plugins use NSS.
(...skipping 16 matching lines...) Expand all
131 141
132 #if defined(OS_WIN) 142 #if defined(OS_WIN)
133 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); 143 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont);
134 #endif 144 #endif
135 145
136 main_message_loop.Run(); 146 main_message_loop.Run();
137 return 0; 147 return 0;
138 } 148 }
139 149
140 } // namespace content 150 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698