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

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

Issue 12817: A new copy of the old system monitor changelist. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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/browser/suspend_controller.cc ('k') | chrome/renderer/renderer_main.cc » ('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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/system_monitor.h"
7 #include "chrome/common/chrome_constants.h" 8 #include "chrome/common/chrome_constants.h"
8 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
9 #include "chrome/common/logging_chrome.h" 10 #include "chrome/common/logging_chrome.h"
10 #include "chrome/common/win_util.h" 11 #include "chrome/common/win_util.h"
11 #include "chrome/plugin/plugin_process.h" 12 #include "chrome/plugin/plugin_process.h"
12 #include "chrome/test/injection_test_dll.h" 13 #include "chrome/test/injection_test_dll.h"
13 #include "sandbox/src/sandbox.h" 14 #include "sandbox/src/sandbox.h"
14 15
15 // mainline routine for running as the plugin process 16 // mainline routine for running as the plugin process
16 int PluginMain(CommandLine &parsed_command_line, 17 int PluginMain(CommandLine &parsed_command_line,
17 sandbox::TargetServices* target_services) { 18 sandbox::TargetServices* target_services) {
18 // The main thread of the plugin services IO. 19 // The main thread of the plugin services IO.
19 MessageLoopForIO main_message_loop; 20 MessageLoopForIO main_message_loop;
20 std::wstring app_name = chrome::kBrowserAppName; 21 std::wstring app_name = chrome::kBrowserAppName;
21 PlatformThread::SetName(WideToASCII(app_name + L"_PluginMain").c_str()); 22 PlatformThread::SetName(WideToASCII(app_name + L"_PluginMain").c_str());
22 23
24 // Initialize the SystemMonitor
25 base::SystemMonitor::Start();
26
23 CoInitialize(NULL); 27 CoInitialize(NULL);
24 DLOG(INFO) << "Started plugin with " << 28 DLOG(INFO) << "Started plugin with " <<
25 parsed_command_line.command_line_string(); 29 parsed_command_line.command_line_string();
26 30
27 HMODULE sandbox_test_module = NULL; 31 HMODULE sandbox_test_module = NULL;
28 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox) || 32 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox) ||
29 !parsed_command_line.HasSwitch(switches::kSafePlugins); 33 !parsed_command_line.HasSwitch(switches::kSafePlugins);
30 if (target_services && !no_sandbox) { 34 if (target_services && !no_sandbox) {
31 // The command line might specify a test dll to load. 35 // The command line might specify a test dll to load.
32 if (parsed_command_line.HasSwitch(switches::kTestSandbox)) { 36 if (parsed_command_line.HasSwitch(switches::kTestSandbox)) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // Load the accelerator table from the browser executable and tell the 76 // Load the accelerator table from the browser executable and tell the
73 // message loop to use it when translating messages. 77 // message loop to use it when translating messages.
74 MessageLoop::current()->Run(); 78 MessageLoop::current()->Run();
75 } 79 }
76 PluginProcess::GlobalCleanup(); 80 PluginProcess::GlobalCleanup();
77 81
78 CoUninitialize(); 82 CoUninitialize();
79 return 0; 83 return 0;
80 } 84 }
81 85
OLDNEW
« no previous file with comments | « chrome/browser/suspend_controller.cc ('k') | chrome/renderer/renderer_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698