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

Unified Diff: chrome/plugin/plugin_thread.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_thread.h ('k') | chrome/plugin/webplugin_delegate_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/plugin_thread.cc
diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc
index 3b7c614d22ed15d222c92ff2bf8bb5914a54704c..d24faf0480769d037dcf79b3f6a5b345a1b0101b 100644
--- a/chrome/plugin/plugin_thread.cc
+++ b/chrome/plugin/plugin_thread.cc
@@ -2,12 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/plugin/plugin_thread.h"
+
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
#include <windows.h>
#include <objbase.h>
-
-#include "chrome/plugin/plugin_thread.h"
+#endif
#include "base/command_line.h"
+#include "base/process_util.h"
#include "chrome/common/child_process.h"
#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/common/chrome_switches.h"
@@ -46,8 +51,12 @@ void PluginThread::OnControlMessageReceived(const IPC::Message& msg) {
void PluginThread::Init() {
ChildThread::Init();
+
PatchNPNFunctions();
+#if defined(OS_WIN)
CoInitialize(NULL);
+#endif
+
notification_service_.reset(new NotificationService);
// Preload the library to avoid loading, unloading then reloading
@@ -68,17 +77,19 @@ void PluginThread::Init() {
void PluginThread::CleanUp() {
if (preloaded_plugin_module_) {
- FreeLibrary(preloaded_plugin_module_);
+ base::UnloadNativeLibrary(preloaded_plugin_module_);
preloaded_plugin_module_ = NULL;
}
PluginChannelBase::CleanupChannels();
NPAPI::PluginLib::UnloadAllPlugins();
ChromePluginLib::UnloadAllPlugins();
notification_service_.reset();
+#if defined(OS_WIN)
CoUninitialize();
+#endif
if (webkit_glue::ShouldForcefullyTerminatePluginProcess())
- TerminateProcess(GetCurrentProcess(), 0);
+ base::KillProcess(base::GetCurrentProcessHandle(), 0, /* wait= */ false);
// Call this last because it deletes the ResourceDispatcher, which is used
// in some of the above cleanup.
@@ -146,7 +157,12 @@ bool GetPluginFinderURL(std::string* plugin_finder_url) {
}
bool IsDefaultPluginEnabled() {
+#if defined(OS_WIN)
return true;
+#else
+ NOTIMPLEMENTED();
+ return false;
+#endif
}
// Dispatch the resolve proxy resquest to the right code, depending on which
« no previous file with comments | « chrome/plugin/plugin_thread.h ('k') | chrome/plugin/webplugin_delegate_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698