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/base_paths.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/debug/crash_logging.h" | 7 #include "base/debug/crash_logging.h" |
8 #include "base/debug/debugger.h" | 8 #include "base/debug/debugger.h" |
| 9 #include "base/feature_list.h" |
9 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
10 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
12 #include "base/path_service.h" | 13 #include "base/path_service.h" |
13 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
15 #include "content/child/child_process.h" | 16 #include "content/child/child_process.h" |
16 #include "content/common/content_constants_internal.h" | 17 #include "content/common/content_constants_internal.h" |
17 #include "content/common/sandbox_linux/sandbox_linux.h" | 18 #include "content/common/sandbox_linux/sandbox_linux.h" |
18 #include "content/ppapi_plugin/ppapi_thread.h" | 19 #include "content/ppapi_plugin/ppapi_thread.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 127 |
127 // Allow the embedder to perform any necessary per-process initialization | 128 // Allow the embedder to perform any necessary per-process initialization |
128 // before the sandbox is initialized. | 129 // before the sandbox is initialized. |
129 if (GetContentClient()->plugin()) | 130 if (GetContentClient()->plugin()) |
130 GetContentClient()->plugin()->PreSandboxInitialization(); | 131 GetContentClient()->plugin()->PreSandboxInitialization(); |
131 | 132 |
132 #if defined(OS_LINUX) | 133 #if defined(OS_LINUX) |
133 LinuxSandbox::InitializeSandbox(); | 134 LinuxSandbox::InitializeSandbox(); |
134 #endif | 135 #endif |
135 | 136 |
| 137 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 138 feature_list->InitializeFromCommandLine( |
| 139 command_line.GetSwitchValueASCII(switches::kEnableFeatures), |
| 140 command_line.GetSwitchValueASCII(switches::kDisableFeatures)); |
| 141 base::FeatureList::SetInstance(std::move(feature_list)); |
| 142 |
136 ChildProcess ppapi_process; | 143 ChildProcess ppapi_process; |
137 ppapi_process.set_main_thread( | 144 ppapi_process.set_main_thread( |
138 new PpapiThread(parameters.command_line, false)); // Not a broker. | 145 new PpapiThread(parameters.command_line, false)); // Not a broker. |
139 | 146 |
140 #if defined(OS_WIN) | 147 #if defined(OS_WIN) |
141 if (!base::win::IsUser32AndGdi32Available()) | 148 if (!base::win::IsUser32AndGdi32Available()) |
142 gfx::win::MaybeInitializeDirectWrite(); | 149 gfx::win::MaybeInitializeDirectWrite(); |
143 bool use_direct_write = gfx::win::IsDirectWriteEnabled(); | 150 bool use_direct_write = gfx::win::IsDirectWriteEnabled(); |
144 if (use_direct_write) { | 151 if (use_direct_write) { |
145 if (ShouldUseDirectWriteFontProxyFieldTrial()) { | 152 if (ShouldUseDirectWriteFontProxyFieldTrial()) { |
(...skipping 12 matching lines...) Expand all Loading... |
158 main_message_loop.Run(); | 165 main_message_loop.Run(); |
159 | 166 |
160 #if defined(OS_WIN) | 167 #if defined(OS_WIN) |
161 if (ShouldUseDirectWriteFontProxyFieldTrial()) | 168 if (ShouldUseDirectWriteFontProxyFieldTrial()) |
162 UninitializeDWriteFontProxy(); | 169 UninitializeDWriteFontProxy(); |
163 #endif | 170 #endif |
164 return 0; | 171 return 0; |
165 } | 172 } |
166 | 173 |
167 } // namespace content | 174 } // namespace content |
OLD | NEW |