| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/power_monitor/power_monitor.h" | 14 #include "base/power_monitor/power_monitor.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/threading/platform_thread.h" | 16 #include "base/threading/platform_thread.h" |
| 17 #include "base/timer/hi_res_timer_manager.h" | 17 #include "base/timer/hi_res_timer_manager.h" |
| 18 #include "content/child/child_process.h" | 18 #include "content/child/child_process.h" |
| 19 #include "content/common/content_constants_internal.h" |
| 19 #include "content/plugin/plugin_thread.h" | 20 #include "content/plugin/plugin_thread.h" |
| 20 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
| 21 #include "content/public/common/main_function_params.h" | 22 #include "content/public/common/main_function_params.h" |
| 22 | 23 |
| 23 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
| 24 #include "base/win/scoped_com_initializer.h" | 25 #include "base/win/scoped_com_initializer.h" |
| 25 #include "content/public/common/injection_test_win.h" | 26 #include "content/public/common/injection_test_win.h" |
| 26 #include "sandbox/win/src/sandbox.h" | 27 #include "sandbox/win/src/sandbox.h" |
| 27 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 28 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
| 28 #include "base/posix/global_descriptors.h" | 29 #include "base/posix/global_descriptors.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 47 int PluginMain(const MainFunctionParams& parameters) { | 48 int PluginMain(const MainFunctionParams& parameters) { |
| 48 // The main thread of the plugin services UI. | 49 // The main thread of the plugin services UI. |
| 49 #if defined(OS_MACOSX) | 50 #if defined(OS_MACOSX) |
| 50 #if !defined(__LP64__) | 51 #if !defined(__LP64__) |
| 51 TrimInterposeEnvironment(); | 52 TrimInterposeEnvironment(); |
| 52 #endif | 53 #endif |
| 53 InitializeChromeApplication(); | 54 InitializeChromeApplication(); |
| 54 #endif | 55 #endif |
| 55 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); | 56 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); |
| 56 base::PlatformThread::SetName("CrPluginMain"); | 57 base::PlatformThread::SetName("CrPluginMain"); |
| 58 base::debug::TraceLog::GetInstance()->SetProcessName("Plugin Process"); |
| 59 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( |
| 60 kTraceEventPluginProcessSortIndex); |
| 57 | 61 |
| 58 base::PowerMonitor power_monitor; | 62 base::PowerMonitor power_monitor; |
| 59 base::HighResolutionTimerManager high_resolution_timer_manager; | 63 base::HighResolutionTimerManager high_resolution_timer_manager; |
| 60 | 64 |
| 61 const CommandLine& parsed_command_line = parameters.command_line; | 65 const CommandLine& parsed_command_line = parameters.command_line; |
| 62 | 66 |
| 63 #if defined(OS_LINUX) | 67 #if defined(OS_LINUX) |
| 64 | 68 |
| 65 #if defined(ARCH_CPU_64_BITS) | 69 #if defined(ARCH_CPU_64_BITS) |
| 66 WorkaroundFlashLAHF(); | 70 WorkaroundFlashLAHF(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 77 { | 81 { |
| 78 ChildProcess plugin_process; | 82 ChildProcess plugin_process; |
| 79 plugin_process.set_main_thread(new PluginThread()); | 83 plugin_process.set_main_thread(new PluginThread()); |
| 80 base::MessageLoop::current()->Run(); | 84 base::MessageLoop::current()->Run(); |
| 81 } | 85 } |
| 82 | 86 |
| 83 return 0; | 87 return 0; |
| 84 } | 88 } |
| 85 | 89 |
| 86 } // namespace content | 90 } // namespace content |
| OLD | NEW |