summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorzork@google.com <zork@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 18:33:47 +0000
committerzork@google.com <zork@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 18:33:47 +0000
commit3daa8452e64a3d3c25f456083f52eef56bc0d888 (patch)
tree585edd77aee894f3944b6efcb18dc4abcf5ef701 /chrome
parent8c8657d61fb8792985888c88730b2eb2f4fc4019 (diff)
downloadchromium_src-3daa8452e64a3d3c25f456083f52eef56bc0d888.zip
chromium_src-3daa8452e64a3d3c25f456083f52eef56bc0d888.tar.gz
chromium_src-3daa8452e64a3d3c25f456083f52eef56bc0d888.tar.bz2
Fixing a crash when plugin messages are sent to dialogs.
Review URL: http://codereview.chromium.org/18130 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8189 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/chrome_plugin_lib.cc5
-rw-r--r--chrome/common/chrome_plugin_lib.h1
-rw-r--r--chrome/renderer/render_thread.cc3
3 files changed, 9 insertions, 0 deletions
diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc
index a0e41da..0f4b4e6 100644
--- a/chrome/common/chrome_plugin_lib.cc
+++ b/chrome/common/chrome_plugin_lib.cc
@@ -43,6 +43,11 @@ static bool IsSingleProcessMode() {
}
// static
+bool ChromePluginLib::IsInitialized() {
+ return (g_loaded_libs != NULL);
+}
+
+// static
ChromePluginLib* ChromePluginLib::Create(const FilePath& filename,
const CPBrowserFuncs* bfuncs) {
// Keep a map of loaded plugins to ensure we only load each library once.
diff --git a/chrome/common/chrome_plugin_lib.h b/chrome/common/chrome_plugin_lib.h
index 1609bad..21bf925 100644
--- a/chrome/common/chrome_plugin_lib.h
+++ b/chrome/common/chrome_plugin_lib.h
@@ -21,6 +21,7 @@ class MessageLoop;
// issues a NOTIFY_CHROME_PLUGIN_UNLOADED notification.
class ChromePluginLib : public base::RefCounted<ChromePluginLib> {
public:
+ static bool IsInitialized();
static ChromePluginLib* Create(const FilePath& filename,
const CPBrowserFuncs* bfuncs);
static ChromePluginLib* Find(const FilePath& filename);
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index e0108e4..08ccd27 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -177,6 +177,9 @@ void RenderThread::OnMessageReceived(const IPC::Message& msg) {
void RenderThread::OnPluginMessage(const FilePath& plugin_path,
const std::vector<uint8>& data) {
+ if (!ChromePluginLib::IsInitialized()) {
+ return;
+ }
CHECK(ChromePluginLib::IsPluginThread());
ChromePluginLib *chrome_plugin = ChromePluginLib::Find(plugin_path);
if (chrome_plugin) {