Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: chrome/plugin/plugin_main.cc

Issue 155876: Revert r21117 as it caused reliability failures.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/ipc_channel_proxy.cc ('k') | chrome/plugin/plugin_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "app/win_util.h" 8 #include "app/win_util.h"
9 #endif 9 #endif
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 11 matching lines...) Expand all
22 #if defined(OS_WIN) 22 #if defined(OS_WIN)
23 #include "chrome/test/injection_test_dll.h" 23 #include "chrome/test/injection_test_dll.h"
24 #include "sandbox/src/sandbox.h" 24 #include "sandbox/src/sandbox.h"
25 #elif defined(OS_LINUX) 25 #elif defined(OS_LINUX)
26 #include "chrome/common/chrome_descriptors.h" 26 #include "chrome/common/chrome_descriptors.h"
27 #include "base/global_descriptors_posix.h" 27 #include "base/global_descriptors_posix.h"
28 #endif 28 #endif
29 29
30 // main() routine for running as the plugin process. 30 // main() routine for running as the plugin process.
31 int PluginMain(const MainFunctionParams& parameters) { 31 int PluginMain(const MainFunctionParams& parameters) {
32 // The main thread of the plugin services UI. 32 // The main thread of the plugin services IO.
33 MessageLoop main_message_loop(MessageLoop::TYPE_UI); 33 MessageLoopForIO main_message_loop;
34 std::wstring app_name = chrome::kBrowserAppName; 34 std::wstring app_name = chrome::kBrowserAppName;
35 PlatformThread::SetName(WideToASCII(app_name + L"_PluginMain").c_str()); 35 PlatformThread::SetName(WideToASCII(app_name + L"_PluginMain").c_str());
36 36
37 // Initialize the SystemMonitor 37 // Initialize the SystemMonitor
38 base::SystemMonitor::Start(); 38 base::SystemMonitor::Start();
39 39
40 const CommandLine& parsed_command_line = parameters.command_line_; 40 const CommandLine& parsed_command_line = parameters.command_line_;
41 41
42 #if defined(OS_WIN) 42 #if defined(OS_WIN)
43 sandbox::TargetServices* target_services = 43 sandbox::TargetServices* target_services =
(...skipping 29 matching lines...) Expand all
73 LOG(WARNING) << "Plugin (" 73 LOG(WARNING) << "Plugin ("
74 << getpid() 74 << getpid()
75 << ") paused waiting for debugger to attach @ pid"; 75 << ") paused waiting for debugger to attach @ pid";
76 pause(); 76 pause();
77 #else 77 #else
78 NOTIMPLEMENTED() << " non-windows startup, plugin startup dialog etc."; 78 NOTIMPLEMENTED() << " non-windows startup, plugin startup dialog etc.";
79 #endif 79 #endif
80 } 80 }
81 81
82 { 82 {
83 ChildProcess plugin_process; 83 ChildProcess plugin_process(new PluginThread());
84 plugin_process.set_main_thread(new PluginThread());
85 #if defined(OS_WIN) 84 #if defined(OS_WIN)
86 if (!no_sandbox && target_services) 85 if (!no_sandbox && target_services)
87 target_services->LowerToken(); 86 target_services->LowerToken();
88 87
89 if (sandbox_test_module) { 88 if (sandbox_test_module) {
90 RunRendererTests run_security_tests = 89 RunRendererTests run_security_tests =
91 reinterpret_cast<RunPluginTests>(GetProcAddress(sandbox_test_module, 90 reinterpret_cast<RunPluginTests>(GetProcAddress(sandbox_test_module,
92 kPluginTestCall)); 91 kPluginTestCall));
93 DCHECK(run_security_tests); 92 DCHECK(run_security_tests);
94 if (run_security_tests) { 93 if (run_security_tests) {
(...skipping 10 matching lines...) Expand all
105 104
106 MessageLoop::current()->Run(); 105 MessageLoop::current()->Run();
107 } 106 }
108 107
109 #if defined(OS_WIN) 108 #if defined(OS_WIN)
110 CoUninitialize(); 109 CoUninitialize();
111 #endif 110 #endif
112 111
113 return 0; 112 return 0;
114 } 113 }
OLDNEW
« no previous file with comments | « chrome/common/ipc_channel_proxy.cc ('k') | chrome/plugin/plugin_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698