summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-16 08:30:01 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-16 08:30:01 +0000
commit9354b0924f460ecc8658b4fe3d105660a51809b0 (patch)
tree0f0428ba2c96222062d6d68e42e498d1483e935e /chrome/plugin
parente35db34e72668bef96178b8a1fb735691a0f3101 (diff)
downloadchromium_src-9354b0924f460ecc8658b4fe3d105660a51809b0.zip
chromium_src-9354b0924f460ecc8658b4fe3d105660a51809b0.tar.gz
chromium_src-9354b0924f460ecc8658b4fe3d105660a51809b0.tar.bz2
Run the Chromoting client plugin out-of-process.
This requires an additional callback to embedders to allow Chrome initialize NSS for use by the Chromoting plugin before activating the sandbox, and to specially handle built-in ("internal") plugins like the Chromoting client. BUG=160121 Review URL: https://chromiumcodereview.appspot.com/11369207 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168168 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/DEPS1
-rw-r--r--chrome/plugin/chrome_content_plugin_client.cc38
-rw-r--r--chrome/plugin/chrome_content_plugin_client.h1
3 files changed, 40 insertions, 0 deletions
diff --git a/chrome/plugin/DEPS b/chrome/plugin/DEPS
index df419af..b5c727f 100644
--- a/chrome/plugin/DEPS
+++ b/chrome/plugin/DEPS
@@ -1,4 +1,5 @@
include_rules = [
"+content/public/plugin",
"+grit",
+ "+media",
]
diff --git a/chrome/plugin/chrome_content_plugin_client.cc b/chrome/plugin/chrome_content_plugin_client.cc
index 0a8e42b..d92ff309 100644
--- a/chrome/plugin/chrome_content_plugin_client.cc
+++ b/chrome/plugin/chrome_content_plugin_client.cc
@@ -4,6 +4,19 @@
#include "chrome/plugin/chrome_content_plugin_client.h"
+#if defined(ENABLE_REMOTING)
+#include "base/path_service.h"
+#include "base/file_path.h"
+#include "content/public/common/content_paths.h"
+#include "media/base/media.h"
+#if defined(OS_WIN)
+#include "base/logging.h"
+#include "base/native_library.h"
+#elif defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS)
+#include "crypto/nss_util.h"
+#endif
+#endif
+
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
@@ -14,6 +27,31 @@
namespace chrome {
+void ChromeContentPluginClient::PreSandboxInitialization() {
+#if defined(ENABLE_REMOTING)
+
+ // Load crypto libraries for the Chromoting client plugin.
+#if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS)
+ // On platforms where we use system NSS libraries, the .so's must be loaded
+ // before the sandbox is initialized.
+ crypto::ForceNSSNoDBInit();
+ crypto::EnsureNSSInit();
+#elif defined(OS_WIN)
+ // crypt32.dll is used to decode X509 certificates for Chromoting.
+ std::string error;
+ if (base::LoadNativeLibrary(FilePath(L"crypt32.dll"), &error) == NULL)
+ LOG(ERROR) << "Failed to load crypto32.dll: " << error;
+#endif // defined(OS_WIN)
+
+ // Load media libraries for the Chromoting client plugin.
+ FilePath media_path;
+ PathService::Get(content::DIR_MEDIA_LIBS, &media_path);
+ if (!media_path.empty())
+ media::InitializeMediaLibrary(media_path);
+
+#endif // defined(ENABLE_REMOTING)
+}
+
void ChromeContentPluginClient::PluginProcessStarted(
const string16& plugin_name) {
#if defined(OS_MACOSX)
diff --git a/chrome/plugin/chrome_content_plugin_client.h b/chrome/plugin/chrome_content_plugin_client.h
index 56ab0ce..0392102 100644
--- a/chrome/plugin/chrome_content_plugin_client.h
+++ b/chrome/plugin/chrome_content_plugin_client.h
@@ -12,6 +12,7 @@ namespace chrome {
class ChromeContentPluginClient : public content::ContentPluginClient {
public:
+ virtual void PreSandboxInitialization() OVERRIDE;
virtual void PluginProcessStarted(const string16& plugin_name) OVERRIDE;
};