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

Unified Diff: chrome/browser/plugins/plugin_observer.cc

Issue 2442953002: Remove stl_util's deletion function use from chrome/. (Closed)
Patch Set: fix Created 4 years, 2 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
« no previous file with comments | « chrome/browser/plugins/plugin_observer.h ('k') | chrome/browser/printing/background_printing_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_observer.cc
diff --git a/chrome/browser/plugins/plugin_observer.cc b/chrome/browser/plugins/plugin_observer.cc
index 611bc871ebef81dbd35e411a4f7137882ee16d2d..08f73eddfb84b468471cb7db628ed57b96e97fdd 100644
--- a/chrome/browser/plugins/plugin_observer.cc
+++ b/chrome/browser/plugins/plugin_observer.cc
@@ -11,7 +11,6 @@
#include "base/debug/crash_logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
-#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
@@ -304,9 +303,6 @@ PluginObserver::PluginObserver(content::WebContents* web_contents)
}
PluginObserver::~PluginObserver() {
-#if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION)
- base::STLDeleteValues(&plugin_placeholders_);
-#endif
}
void PluginObserver::PluginCrashed(const base::FilePath& plugin_path,
@@ -391,8 +387,9 @@ void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id,
PluginInstaller* installer = NULL;
std::unique_ptr<PluginMetadata> plugin;
if (finder->FindPluginWithIdentifier(identifier, &installer, &plugin)) {
- plugin_placeholders_[placeholder_id] = new PluginPlaceholderHost(
- this, placeholder_id, plugin->name(), installer);
+ plugin_placeholders_[placeholder_id] =
+ base::MakeUnique<PluginPlaceholderHost>(this, placeholder_id,
+ plugin->name(), installer);
OutdatedPluginInfoBarDelegate::Create(
InfoBarService::FromWebContents(web_contents()), installer,
std::move(plugin));
@@ -424,13 +421,11 @@ void PluginObserver::RemoveComponentObserver(int placeholder_id) {
#if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION)
void PluginObserver::OnRemovePluginPlaceholderHost(int placeholder_id) {
- std::map<int, PluginPlaceholderHost*>::iterator it =
- plugin_placeholders_.find(placeholder_id);
+ auto it = plugin_placeholders_.find(placeholder_id);
if (it == plugin_placeholders_.end()) {
NOTREACHED();
return;
}
- delete it->second;
plugin_placeholders_.erase(it);
}
#endif // BUILDFLAG(ENABLE_PLUGIN_INSTALLATION)
« no previous file with comments | « chrome/browser/plugins/plugin_observer.h ('k') | chrome/browser/printing/background_printing_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698