summaryrefslogtreecommitdiffstats
path: root/extensions/common/permissions
diff options
context:
space:
mode:
authorlimasdf <limasdf@gmail.com>2015-11-11 10:11:45 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-11 18:12:44 +0000
commit6344254e644c93237df15620f9d45496dfd4733c (patch)
tree5ae7079a5b6df3cddb368c72b19ee5c226055681 /extensions/common/permissions
parent236413c0a788098a49b734592c3d31fb69ffe930 (diff)
downloadchromium_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/common/permissions')
-rw-r--r--extensions/common/permissions/permissions_data.cc6
-rw-r--r--extensions/common/permissions/permissions_data.h5
2 files changed, 5 insertions, 6 deletions
diff --git a/extensions/common/permissions/permissions_data.cc b/extensions/common/permissions/permissions_data.cc
index ea66b6c..c904af7 100644
--- a/extensions/common/permissions/permissions_data.cc
+++ b/extensions/common/permissions/permissions_data.cc
@@ -23,7 +23,7 @@ namespace extensions {
namespace {
-PermissionsData::PolicyDelegate* g_policy_delegate = NULL;
+PermissionsData::PolicyDelegate* g_policy_delegate = nullptr;
class AutoLockOnValidThread {
public:
@@ -149,7 +149,7 @@ void PermissionsData::UpdateTabSpecificPermissions(
? static_cast<const PermissionSet&>(PermissionSet())
: *iter->second,
permissions);
- tab_specific_permissions_.set(tab_id, new_permissions.Pass());
+ tab_specific_permissions_[tab_id] = new_permissions.Pass();
}
void PermissionsData::ClearTabSpecificPermissions(int tab_id) const {
@@ -304,7 +304,7 @@ const PermissionSet* PermissionsData::GetTabSpecificPermissions(
runtime_lock_.AssertAcquired();
TabPermissionsMap::const_iterator iter =
tab_specific_permissions_.find(tab_id);
- return (iter != tab_specific_permissions_.end()) ? iter->second : nullptr;
+ return iter != tab_specific_permissions_.end() ? iter->second.get() : nullptr;
}
bool PermissionsData::HasTabSpecificPermissionToExecuteScript(
diff --git a/extensions/common/permissions/permissions_data.h b/extensions/common/permissions/permissions_data.h
index 5de25c2..650c0ef 100644
--- a/extensions/common/permissions/permissions_data.h
+++ b/extensions/common/permissions/permissions_data.h
@@ -9,8 +9,8 @@
#include <string>
#include <vector>
-#include "base/containers/scoped_ptr_map.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
@@ -45,8 +45,7 @@ class PermissionsData {
// the given page.
};
- using TabPermissionsMap =
- base::ScopedPtrMap<int, scoped_ptr<const PermissionSet>>;
+ using TabPermissionsMap = std::map<int, scoped_ptr<const PermissionSet>>;
// Delegate class to allow different contexts (e.g. browser vs renderer) to
// have control over policy decisions.