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

Unified Diff: content/common/npobject_util.cc

Issue 7982026: Add GetPluginPath() to npobject_util to avoid content/plugin/ include from npobject_stub.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
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;
}

Powered by Google App Engine
This is Rietveld 408576698