Chromium Code Reviews| Index: chrome/browser/plugin_finder.cc |
| diff --git a/chrome/browser/plugin_finder.cc b/chrome/browser/plugin_finder.cc |
| index eee77570c6632e47bd2d0cc4ba36ca53616dcff5..347eb29d44d41f0bd875d1bdd7f4872758b2c257 100644 |
| --- a/chrome/browser/plugin_finder.cc |
| +++ b/chrome/browser/plugin_finder.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/message_loop.h" |
| #include "base/values.h" |
| #include "chrome/browser/browser_process.h" |
| +#include "chrome/browser/plugin_installer.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/common/pref_names.h" |
| #include "content/public/browser/browser_thread.h" |
| @@ -81,17 +82,29 @@ void PluginFinder::FindPlugin( |
| success = (*mime_type_it)->GetAsString(&mime_type_str); |
| DCHECK(success); |
| if (mime_type_str == mime_type) { |
| - std::string url; |
| - success = plugin->GetString("url", &url); |
| + std::string identifier; |
| + success = plugin->GetString("identifier", &identifier); |
| DCHECK(success); |
| - string16 name; |
| - success = plugin->GetString("name", &name); |
| - DCHECK(success); |
| - bool display_url = false; |
| - plugin->GetBoolean("displayurl", &display_url); |
| + PluginInstaller* installer = installers_[identifier]; |
| + if (!installer) { |
| + std::string url; |
| + success = plugin->GetString("url", &url); |
| + DCHECK(success); |
| + std::string help_url; |
| + plugin->GetString("help_url", &help_url); |
| + string16 name; |
| + success = plugin->GetString("name", &name); |
| + DCHECK(success); |
| + bool display_url = false; |
| + plugin->GetBoolean("displayurl", &display_url); |
| + installer = new PluginInstaller(identifier, |
| + GURL(url), GURL(help_url), name, |
| + display_url); |
| + installers_[identifier] = installer; |
|
battre
2011/11/30 14:10:06
do you need to free the installers_ in the destruc
Bernhard Bauer
2011/11/30 14:29:23
True, there might be circumstances where we destro
Bernhard Bauer
2011/12/01 09:39:25
Done.
|
| + } |
| MessageLoop::current()->PostTask( |
| FROM_HERE, |
| - base::Bind(found_callback, GURL(url), name, display_url)); |
| + base::Bind(found_callback, installer)); |
|
battre
2011/11/30 14:10:06
once you free the installers_ int he destructor yo
Bernhard Bauer
2011/11/30 14:29:23
Hm, during normal browser runs I think it's reason
|
| return; |
| } |
| } |