| Index: content/common/npobject_util.cc
|
| diff --git a/content/common/npobject_util.cc b/content/common/npobject_util.cc
|
| index 5d188f60cc05aabeb65e957744148553f190154d..f8bb8893ddf3d7a867a984b5fe9950e224a7bd0a 100644
|
| --- a/content/common/npobject_util.cc
|
| +++ b/content/common/npobject_util.cc
|
| @@ -15,9 +15,11 @@
|
|
|
| using WebKit::WebBindings;
|
|
|
| -// true if the current process is a plugin process, false if it's a renderer
|
| -// process.
|
| +// true if the current process is a plugin process, false otherwise.
|
| static bool g_plugin_process;
|
| +// The path of the plugin file that this process hosts, if this is a plugin
|
| +// process.
|
| +static FilePath* g_plugin_path = NULL;
|
|
|
| namespace {
|
| // The next 7 functions are called by the plugin code when it's using the
|
| @@ -125,8 +127,10 @@ NPNetscapeFuncs *GetHostFunctions() {
|
|
|
| }
|
|
|
| -void PatchNPNFunctions() {
|
| +void PatchNPNFunctions(const FilePath& plugin_path) {
|
| g_plugin_process = true;
|
| + DCHECK(!g_plugin_path);
|
| + g_plugin_path = new FilePath(plugin_path);
|
| NPNetscapeFuncs* funcs = GetHostFunctions();
|
| webkit::npapi::PluginHost::Singleton()->PatchNPNetscapeFuncs(funcs);
|
| }
|
| @@ -135,6 +139,11 @@ bool IsPluginProcess() {
|
| return g_plugin_process;
|
| }
|
|
|
| +const FilePath& GetPluginPath() {
|
| + DCHECK(g_plugin_process);
|
| + return *g_plugin_path;
|
| +}
|
| +
|
| void CreateNPIdentifierParam(NPIdentifier id, NPIdentifier_Param* param) {
|
| param->identifier = id;
|
| }
|
|
|