| 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/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "content/child/child_process.h" | 15 #include "content/child/child_process.h" |
| 16 #include "content/common/content_constants_internal.h" | 16 #include "content/common/content_constants_internal.h" |
| 17 #include "content/common/sandbox_linux/sandbox_linux.h" | 17 #include "content/common/sandbox_linux/sandbox_linux.h" |
| 18 #include "content/ppapi_plugin/ppapi_thread.h" | 18 #include "content/ppapi_plugin/ppapi_thread.h" |
| 19 #include "content/public/common/content_client.h" | 19 #include "content/public/common/content_client.h" |
| 20 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
| 21 #include "content/public/common/main_function_params.h" | 21 #include "content/public/common/main_function_params.h" |
| 22 #include "content/public/plugin/content_plugin_client.h" | |
| 23 #include "ipc/ipc_sender.h" | 22 #include "ipc/ipc_sender.h" |
| 24 #include "ppapi/proxy/plugin_globals.h" | 23 #include "ppapi/proxy/plugin_globals.h" |
| 25 #include "ppapi/proxy/proxy_module.h" | 24 #include "ppapi/proxy/proxy_module.h" |
| 26 #include "ui/base/ui_base_switches.h" | 25 #include "ui/base/ui_base_switches.h" |
| 27 | 26 |
| 28 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 29 #include "base/win/win_util.h" | 28 #include "base/win/win_util.h" |
| 30 #include "base/win/windows_version.h" | 29 #include "base/win/windows_version.h" |
| 31 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" | 30 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h" |
| 32 #include "sandbox/win/src/sandbox.h" | 31 #include "sandbox/win/src/sandbox.h" |
| 33 #include "third_party/WebKit/public/web/win/WebFontRendering.h" | 32 #include "third_party/WebKit/public/web/win/WebFontRendering.h" |
| 34 #include "third_party/skia/include/ports/SkTypeface_win.h" | 33 #include "third_party/skia/include/ports/SkTypeface_win.h" |
| 35 #include "ui/gfx/win/direct_write.h" | 34 #include "ui/gfx/win/direct_write.h" |
| 36 #include "ui/gfx/win/dpi.h" | 35 #include "ui/gfx/win/dpi.h" |
| 37 #endif | 36 #endif |
| 38 | 37 |
| 39 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
| 40 #include "base/files/file_util.h" | 39 #include "base/files/file_util.h" |
| 41 #endif | 40 #endif |
| 42 | 41 |
| 43 #if defined(OS_LINUX) | 42 #if defined(OS_LINUX) |
| 44 #include "content/public/common/sandbox_init.h" | 43 #include "content/public/common/sandbox_init.h" |
| 45 #endif | 44 #endif |
| 46 | 45 |
| 46 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 47 #include "gin/v8_initializer.h" |
| 48 #endif |
| 49 |
| 47 #if defined(OS_POSIX) && !defined(OS_ANDROID) | 50 #if defined(OS_POSIX) && !defined(OS_ANDROID) |
| 48 #include <stdlib.h> | 51 #include <stdlib.h> |
| 49 #endif | 52 #endif |
| 50 | 53 |
| 51 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
| 52 sandbox::TargetServices* g_target_services = NULL; | 55 sandbox::TargetServices* g_target_services = NULL; |
| 53 #else | 56 #else |
| 54 void* g_target_services = 0; | 57 void* g_target_services = 0; |
| 55 #endif | 58 #endif |
| 56 | 59 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 PathService::Get(base::DIR_HOME, &homedir); | 118 PathService::Get(base::DIR_HOME, &homedir); |
| 116 setenv("HOME", homedir.value().c_str(), 1); | 119 setenv("HOME", homedir.value().c_str(), 1); |
| 117 #endif | 120 #endif |
| 118 | 121 |
| 119 base::MessageLoop main_message_loop; | 122 base::MessageLoop main_message_loop; |
| 120 base::PlatformThread::SetName("CrPPAPIMain"); | 123 base::PlatformThread::SetName("CrPPAPIMain"); |
| 121 base::trace_event::TraceLog::GetInstance()->SetProcessName("PPAPI Process"); | 124 base::trace_event::TraceLog::GetInstance()->SetProcessName("PPAPI Process"); |
| 122 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( | 125 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( |
| 123 kTraceEventPpapiProcessSortIndex); | 126 kTraceEventPpapiProcessSortIndex); |
| 124 | 127 |
| 125 // Allow the embedder to perform any necessary per-process initialization | 128 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 126 // before the sandbox is initialized. | 129 gin::V8Initializer::LoadV8Snapshot(); |
| 127 if (GetContentClient()->plugin()) | 130 gin::V8Initializer::LoadV8Natives(); |
| 128 GetContentClient()->plugin()->PreSandboxInitialization(); | 131 #endif |
| 129 | 132 |
| 130 #if defined(OS_LINUX) | 133 #if defined(OS_LINUX) |
| 131 LinuxSandbox::InitializeSandbox(); | 134 LinuxSandbox::InitializeSandbox(); |
| 132 #endif | 135 #endif |
| 133 | 136 |
| 134 ChildProcess ppapi_process; | 137 ChildProcess ppapi_process; |
| 135 ppapi_process.set_main_thread( | 138 ppapi_process.set_main_thread( |
| 136 new PpapiThread(parameters.command_line, false)); // Not a broker. | 139 new PpapiThread(parameters.command_line, false)); // Not a broker. |
| 137 | 140 |
| 138 #if defined(OS_WIN) | 141 #if defined(OS_WIN) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 151 | 154 |
| 152 main_message_loop.Run(); | 155 main_message_loop.Run(); |
| 153 | 156 |
| 154 #if defined(OS_WIN) | 157 #if defined(OS_WIN) |
| 155 UninitializeDWriteFontProxy(); | 158 UninitializeDWriteFontProxy(); |
| 156 #endif | 159 #endif |
| 157 return 0; | 160 return 0; |
| 158 } | 161 } |
| 159 | 162 |
| 160 } // namespace content | 163 } // namespace content |
| OLD | NEW |