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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 125 |
125 // Allow the embedder to perform any necessary per-process initialization | 126 // Allow the embedder to perform any necessary per-process initialization |
126 // before the sandbox is initialized. | 127 // before the sandbox is initialized. |
127 if (GetContentClient()->plugin()) | 128 if (GetContentClient()->plugin()) |
128 GetContentClient()->plugin()->PreSandboxInitialization(); | 129 GetContentClient()->plugin()->PreSandboxInitialization(); |
129 | 130 |
130 #if defined(OS_LINUX) | 131 #if defined(OS_LINUX) |
131 LinuxSandbox::InitializeSandbox(); | 132 LinuxSandbox::InitializeSandbox(); |
132 #endif | 133 #endif |
133 | 134 |
| 135 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 136 feature_list->InitializeFromCommandLine( |
| 137 command_line.GetSwitchValueASCII(switches::kEnableFeatures), |
| 138 command_line.GetSwitchValueASCII(switches::kDisableFeatures)); |
| 139 base::FeatureList::SetInstance(std::move(feature_list)); |
| 140 |
134 ChildProcess ppapi_process; | 141 ChildProcess ppapi_process; |
135 ppapi_process.set_main_thread( | 142 ppapi_process.set_main_thread( |
136 new PpapiThread(parameters.command_line, false)); // Not a broker. | 143 new PpapiThread(parameters.command_line, false)); // Not a broker. |
137 | 144 |
138 #if defined(OS_WIN) | 145 #if defined(OS_WIN) |
139 if (!base::win::IsUser32AndGdi32Available()) | 146 if (!base::win::IsUser32AndGdi32Available()) |
140 gfx::win::MaybeInitializeDirectWrite(); | 147 gfx::win::MaybeInitializeDirectWrite(); |
141 bool use_direct_write = gfx::win::IsDirectWriteEnabled(); | 148 bool use_direct_write = gfx::win::IsDirectWriteEnabled(); |
142 if (use_direct_write) { | 149 if (use_direct_write) { |
143 InitializeDWriteFontProxy(); | 150 InitializeDWriteFontProxy(); |
144 } else { | 151 } else { |
145 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); | 152 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); |
146 } | 153 } |
147 | 154 |
148 blink::WebFontRendering::setUseDirectWrite(use_direct_write); | 155 blink::WebFontRendering::setUseDirectWrite(use_direct_write); |
149 blink::WebFontRendering::setDeviceScaleFactor(gfx::GetDPIScale()); | 156 blink::WebFontRendering::setDeviceScaleFactor(gfx::GetDPIScale()); |
150 #endif | 157 #endif |
151 | 158 |
152 main_message_loop.Run(); | 159 main_message_loop.Run(); |
153 | 160 |
154 #if defined(OS_WIN) | 161 #if defined(OS_WIN) |
155 UninitializeDWriteFontProxy(); | 162 UninitializeDWriteFontProxy(); |
156 #endif | 163 #endif |
157 return 0; | 164 return 0; |
158 } | 165 } |
159 | 166 |
160 } // namespace content | 167 } // namespace content |
OLD | NEW |