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" | |
10 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
11 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
12 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
13 #include "base/path_service.h" | 12 #include "base/path_service.h" |
14 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
15 #include "build/build_config.h" | 14 #include "build/build_config.h" |
16 #include "content/child/child_process.h" | 15 #include "content/child/child_process.h" |
17 #include "content/common/content_constants_internal.h" | 16 #include "content/common/content_constants_internal.h" |
18 #include "content/common/sandbox_linux/sandbox_linux.h" | 17 #include "content/common/sandbox_linux/sandbox_linux.h" |
19 #include "content/ppapi_plugin/ppapi_thread.h" | 18 #include "content/ppapi_plugin/ppapi_thread.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 127 |
129 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 128 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
130 gin::V8Initializer::LoadV8Snapshot(); | 129 gin::V8Initializer::LoadV8Snapshot(); |
131 gin::V8Initializer::LoadV8Natives(); | 130 gin::V8Initializer::LoadV8Natives(); |
132 #endif | 131 #endif |
133 | 132 |
134 #if defined(OS_LINUX) | 133 #if defined(OS_LINUX) |
135 LinuxSandbox::InitializeSandbox(); | 134 LinuxSandbox::InitializeSandbox(); |
136 #endif | 135 #endif |
137 | 136 |
138 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); | |
139 feature_list->InitializeFromCommandLine( | |
140 command_line.GetSwitchValueASCII(switches::kEnableFeatures), | |
141 command_line.GetSwitchValueASCII(switches::kDisableFeatures)); | |
142 base::FeatureList::SetInstance(std::move(feature_list)); | |
143 | |
144 ChildProcess ppapi_process; | 137 ChildProcess ppapi_process; |
145 ppapi_process.set_main_thread( | 138 ppapi_process.set_main_thread( |
146 new PpapiThread(parameters.command_line, false)); // Not a broker. | 139 new PpapiThread(parameters.command_line, false)); // Not a broker. |
147 | 140 |
148 #if defined(OS_WIN) | 141 #if defined(OS_WIN) |
149 if (!base::win::IsUser32AndGdi32Available()) | 142 if (!base::win::IsUser32AndGdi32Available()) |
150 gfx::win::MaybeInitializeDirectWrite(); | 143 gfx::win::MaybeInitializeDirectWrite(); |
151 bool use_direct_write = gfx::win::IsDirectWriteEnabled(); | 144 bool use_direct_write = gfx::win::IsDirectWriteEnabled(); |
152 if (use_direct_write) { | 145 if (use_direct_write) { |
153 InitializeDWriteFontProxy(); | 146 InitializeDWriteFontProxy(); |
154 } else { | 147 } else { |
155 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); | 148 SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont); |
156 } | 149 } |
157 | 150 |
158 blink::WebFontRendering::setUseDirectWrite(use_direct_write); | 151 blink::WebFontRendering::setUseDirectWrite(use_direct_write); |
159 blink::WebFontRendering::setDeviceScaleFactor(display::win::GetDPIScale()); | 152 blink::WebFontRendering::setDeviceScaleFactor(display::win::GetDPIScale()); |
160 #endif | 153 #endif |
161 | 154 |
162 main_message_loop.Run(); | 155 main_message_loop.Run(); |
163 | 156 |
164 #if defined(OS_WIN) | 157 #if defined(OS_WIN) |
165 UninitializeDWriteFontProxy(); | 158 UninitializeDWriteFontProxy(); |
166 #endif | 159 #endif |
167 return 0; | 160 return 0; |
168 } | 161 } |
169 | 162 |
170 } // namespace content | 163 } // namespace content |
OLD | NEW |