diff options
author | limasdf <limasdf@gmail.com> | 2015-11-11 10:11:45 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-11 18:12:44 +0000 |
commit | 6344254e644c93237df15620f9d45496dfd4733c (patch) | |
tree | 5ae7079a5b6df3cddb368c72b19ee5c226055681 /extensions/renderer | |
parent | 236413c0a788098a49b734592c3d31fb69ffe930 (diff) | |
download | chromium_src-6344254e644c93237df15620f9d45496dfd4733c.zip chromium_src-6344254e644c93237df15620f9d45496dfd4733c.tar.gz chromium_src-6344254e644c93237df15620f9d45496dfd4733c.tar.bz2 |
Remove ScopedPtrMap from extensions code
C++ 11 enables containers that contain move-only type, scoped_ptr.
So, Use std::map<key, scoped_ptr<Foo>> instead of ScopedPtrMap.
BUG=554291
Review URL: https://codereview.chromium.org/1436753002
Cr-Commit-Position: refs/heads/master@{#359116}
Diffstat (limited to 'extensions/renderer')
-rw-r--r-- | extensions/renderer/event_bindings.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/extensions/renderer/event_bindings.cc b/extensions/renderer/event_bindings.cc index 95f7580..7544f74b 100644 --- a/extensions/renderer/event_bindings.cc +++ b/extensions/renderer/event_bindings.cc @@ -9,7 +9,6 @@ #include "base/basictypes.h" #include "base/bind.h" -#include "base/containers/scoped_ptr_map.h" #include "base/lazy_instance.h" #include "base/memory/scoped_ptr.h" #include "components/crx_file/id_util.h" @@ -44,7 +43,7 @@ base::LazyInstance<std::map<std::string, EventListenerCounts>> // we transition between 0 and 1. using FilteredEventListenerKey = std::pair<std::string, std::string>; using FilteredEventListenerCounts = - base::ScopedPtrMap<FilteredEventListenerKey, scoped_ptr<ValueCounter>>; + std::map<FilteredEventListenerKey, scoped_ptr<ValueCounter>>; base::LazyInstance<FilteredEventListenerCounts> g_filtered_listener_counts = LAZY_INSTANCE_INITIALIZER; @@ -124,7 +123,9 @@ bool AddFilter(const std::string& event_name, FilteredEventListenerCounts& all_counts = g_filtered_listener_counts.Get(); FilteredEventListenerCounts::const_iterator counts = all_counts.find(key); if (counts == all_counts.end()) { - counts = all_counts.insert(key, make_scoped_ptr(new ValueCounter())).first; + counts = all_counts.insert(std::make_pair( + key, make_scoped_ptr(new ValueCounter()))) + .first; } return counts->second->Add(filter); } |