OLD | NEW |
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 Loading... |
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 PathService::Get(base::DIR_HOME, &homedir); |
| 109 setenv("HOME", homedir.value().c_str(), 1); |
105 #endif | 110 #endif |
106 | 111 |
107 base::MessageLoop main_message_loop; | 112 base::MessageLoop main_message_loop; |
108 base::PlatformThread::SetName("CrPPAPIMain"); | 113 base::PlatformThread::SetName("CrPPAPIMain"); |
109 base::debug::TraceLog::GetInstance()->SetProcessName("PPAPI Process"); | 114 base::debug::TraceLog::GetInstance()->SetProcessName("PPAPI Process"); |
110 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( | 115 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( |
111 kTraceEventPpapiProcessSortIndex); | 116 kTraceEventPpapiProcessSortIndex); |
112 | 117 |
113 #if defined(OS_LINUX) && defined(USE_NSS) | 118 #if defined(OS_LINUX) && defined(USE_NSS) |
114 // Some out-of-process PPAPI plugins use NSS. | 119 // Some out-of-process PPAPI plugins use NSS. |
(...skipping 16 matching lines...) Expand all Loading... |
131 | 136 |
132 #if defined(OS_WIN) | 137 #if defined(OS_WIN) |
133 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); | 138 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); |
134 #endif | 139 #endif |
135 | 140 |
136 main_message_loop.Run(); | 141 main_message_loop.Run(); |
137 return 0; | 142 return 0; |
138 } | 143 } |
139 | 144 |
140 } // namespace content | 145 } // namespace content |
OLD | NEW |