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

Unified Diff: plugin/linux/main_linux.cc

Issue 340044: Linux: Add support for loading environment variables at plugin start-up from ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 1 month 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 | « plugin/linux/envvars.cc ('k') | plugin/plugin.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: plugin/linux/main_linux.cc
===================================================================
--- plugin/linux/main_linux.cc (revision 30693)
+++ plugin/linux/main_linux.cc (working copy)
@@ -42,6 +42,7 @@
#include "base/scoped_ptr.h"
#include "plugin/cross/main.h"
#include "plugin/cross/out_of_memory.h"
+#include "plugin/linux/envvars.h"
using glue::_o3d::PluginObject;
using glue::StreamManager;
@@ -59,6 +60,9 @@
bool g_xembed_support = false;
+// This is a #define set on the build command-line for greater flexibility.
+static const char *kEnvVarsFilePath = O3D_PLUGIN_ENV_VARS_FILE;
+
static void DrawPlugin(PluginObject *obj) {
// Limit drawing to no more than once every timer tick.
if (!obj->draw_) return;
@@ -624,6 +628,16 @@
DLOG(INFO) << "NP_Initialize";
+ // Before doing anything more, we first load our environment variables file.
+ // This file is a newline-delimited list of any system-specific environment
+ // variables that need to be set in the browser. Since we are a shared library
+ // and not an executable, we can't set them at browser start time, so we
+ // instead set them in every process that loads our shared library. It is
+ // important that we do this as early as possible so that any relevant
+ // variables are already set when we initialize our shared library
+ // dependencies.
+ o3d::LoadEnvironmentVariablesFile(kEnvVarsFilePath);
+
// Check for XEmbed support in the browser.
NPBool xembed_support = 0;
NPError err = NPN_GetValue(NULL, NPNVSupportsXEmbedBool, &xembed_support);
« no previous file with comments | « plugin/linux/envvars.cc ('k') | plugin/plugin.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698