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

Unified Diff: chrome/plugin/plugin_main.cc

Issue 79020: linux (and some posix): multiprocess plugins compiling. (Closed)
Patch Set: rebased Created 11 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/plugin/plugin_channel_base.cc ('k') | chrome/plugin/plugin_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/plugin_main.cc
diff --git a/chrome/plugin/plugin_main.cc b/chrome/plugin/plugin_main.cc
index fe71ea0440fb82d9e676e700d8263e93ad7feefd..7b21066b3f11409b571d5fec5219b1d5794b0b53 100644
--- a/chrome/plugin/plugin_main.cc
+++ b/chrome/plugin/plugin_main.cc
@@ -6,22 +6,22 @@
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/system_monitor.h"
+#include "build/build_config.h"
#include "chrome/common/child_process.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/main_function_params.h"
-#include "chrome/common/win_util.h"
#include "chrome/plugin/plugin_thread.h"
+
+#if defined(OS_WIN)
+#include "chrome/common/win_util.h"
#include "chrome/test/injection_test_dll.h"
#include "sandbox/src/sandbox.h"
+#endif
-// mainline routine for running as the plugin process
+// main() routine for running as the plugin process.
int PluginMain(const MainFunctionParams& parameters) {
- const CommandLine& parsed_command_line = parameters.command_line_;
- sandbox::TargetServices* target_services =
- parameters.sandbox_info_.TargetServices();
-
// The main thread of the plugin services IO.
MessageLoopForIO main_message_loop;
std::wstring app_name = chrome::kBrowserAppName;
@@ -30,6 +30,12 @@ int PluginMain(const MainFunctionParams& parameters) {
// Initialize the SystemMonitor
base::SystemMonitor::Start();
+#if defined(OS_WIN)
+ const CommandLine& parsed_command_line = parameters.command_line_;
+
+ sandbox::TargetServices* target_services =
+ parameters.sandbox_info_.TargetServices();
+
CoInitialize(NULL);
DLOG(INFO) << "Started plugin with " <<
parsed_command_line.command_line_string();
@@ -53,12 +59,15 @@ int PluginMain(const MainFunctionParams& parameters) {
win_util::MessageBox(NULL, L"plugin starting...", title,
MB_OK | MB_SETFOREGROUND);
}
+#else
+ NOTIMPLEMENTED() << " non-windows startup, plugin startup dialog etc.";
+#endif
{
ChildProcess plugin_process(new PluginThread());
- if (!no_sandbox && target_services) {
+#if defined(OS_WIN)
+ if (!no_sandbox && target_services)
target_services->LowerToken();
- }
if (sandbox_test_module) {
RunRendererTests run_security_tests =
@@ -75,12 +84,14 @@ int PluginMain(const MainFunctionParams& parameters) {
__debugbreak();
}
}
+#endif
- // Load the accelerator table from the browser executable and tell the
- // message loop to use it when translating messages.
MessageLoop::current()->Run();
}
+#if defined(OS_WIN)
CoUninitialize();
+#endif
+
return 0;
}
« no previous file with comments | « chrome/plugin/plugin_channel_base.cc ('k') | chrome/plugin/plugin_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698