summaryrefslogtreecommitdiffstats
path: root/extensions/common/features
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2015-12-18 09:48:00 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-18 17:48:52 +0000
commite59eca16010c109a5e3e4922189c8b264d34caa9 (patch)
tree838815399c6364a99a465938df9978aeaf75c766 /extensions/common/features
parent5100baf1eac806abbdaaf8002887aacf652f34e5 (diff)
downloadchromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.zip
chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.tar.gz
chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.tar.bz2
Convert Pass()→std::move() in //extensions
BUG=557422 Review URL: https://codereview.chromium.org/1537893002 Cr-Commit-Position: refs/heads/master@{#366120}
Diffstat (limited to 'extensions/common/features')
-rw-r--r--extensions/common/features/base_feature_provider.cc5
-rw-r--r--extensions/common/features/complex_feature_unittest.cc12
-rw-r--r--extensions/common/features/json_feature_provider_source.cc4
-rw-r--r--extensions/common/features/simple_feature.cc3
4 files changed, 14 insertions, 10 deletions
diff --git a/extensions/common/features/base_feature_provider.cc b/extensions/common/features/base_feature_provider.cc
index cae08d6..3b60e47 100644
--- a/extensions/common/features/base_feature_provider.cc
+++ b/extensions/common/features/base_feature_provider.cc
@@ -128,10 +128,11 @@ BaseFeatureProvider::BaseFeatureProvider(const base::DictionaryValue& root,
feature.get()))
continue;
- features->push_back(feature.Pass());
+ features->push_back(std::move(feature));
}
- linked_ptr<ComplexFeature> feature(new ComplexFeature(features.Pass()));
+ linked_ptr<ComplexFeature> feature(
+ new ComplexFeature(std::move(features)));
feature->set_name(iter.key());
features_[iter.key()] = feature;
diff --git a/extensions/common/features/complex_feature_unittest.cc b/extensions/common/features/complex_feature_unittest.cc
index d06a15a..0dd7c8f 100644
--- a/extensions/common/features/complex_feature_unittest.cc
+++ b/extensions/common/features/complex_feature_unittest.cc
@@ -28,7 +28,7 @@ TEST(ComplexFeatureTest, MultipleRulesWhitelist) {
.Set("extension_types", std::move(ListBuilder().Append("extension")))
.Build());
simple_feature->Parse(rule.get());
- features->push_back(simple_feature.Pass());
+ features->push_back(std::move(simple_feature));
// Rule: "legacy_packaged_app", whitelist "bar".
simple_feature.reset(new SimpleFeature);
@@ -38,9 +38,9 @@ TEST(ComplexFeatureTest, MultipleRulesWhitelist) {
std::move(ListBuilder().Append("legacy_packaged_app")))
.Build();
simple_feature->Parse(rule.get());
- features->push_back(simple_feature.Pass());
+ features->push_back(std::move(simple_feature));
- scoped_ptr<ComplexFeature> feature(new ComplexFeature(features.Pass()));
+ scoped_ptr<ComplexFeature> feature(new ComplexFeature(std::move(features)));
// Test match 1st rule.
EXPECT_EQ(
@@ -90,7 +90,7 @@ TEST(ComplexFeatureTest, Dependencies) {
"manifest:content_security_policy")))
.Build();
simple_feature->Parse(rule.get());
- features->push_back(simple_feature.Pass());
+ features->push_back(std::move(simple_feature));
// Rule which depends on an platform-app-only feature (serial).
simple_feature.reset(new SimpleFeature);
@@ -99,9 +99,9 @@ TEST(ComplexFeatureTest, Dependencies) {
std::move(ListBuilder().Append("permission:serial")))
.Build();
simple_feature->Parse(rule.get());
- features->push_back(simple_feature.Pass());
+ features->push_back(std::move(simple_feature));
- scoped_ptr<ComplexFeature> feature(new ComplexFeature(features.Pass()));
+ scoped_ptr<ComplexFeature> feature(new ComplexFeature(std::move(features)));
// Available to extensions because of the content_security_policy rule.
EXPECT_EQ(
diff --git a/extensions/common/features/json_feature_provider_source.cc b/extensions/common/features/json_feature_provider_source.cc
index c41ecb7..4d2f834 100644
--- a/extensions/common/features/json_feature_provider_source.cc
+++ b/extensions/common/features/json_feature_provider_source.cc
@@ -4,6 +4,8 @@
#include "extensions/common/features/json_feature_provider_source.h"
+#include <utility>
+
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "ui/base/resource/resource_bundle.h"
@@ -29,7 +31,7 @@ void JSONFeatureProviderSource::LoadJSON(int resource_id) {
scoped_ptr<base::DictionaryValue> value_as_dict;
if (value) {
CHECK(value->IsType(base::Value::TYPE_DICTIONARY)) << name_;
- value_as_dict = base::DictionaryValue::From(value.Pass());
+ value_as_dict = base::DictionaryValue::From(std::move(value));
} else {
// There was some error loading the features file.
// http://crbug.com/176381
diff --git a/extensions/common/features/simple_feature.cc b/extensions/common/features/simple_feature.cc
index 4ead463..68c8dfa 100644
--- a/extensions/common/features/simple_feature.cc
+++ b/extensions/common/features/simple_feature.cc
@@ -6,6 +6,7 @@
#include <algorithm>
#include <map>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -293,7 +294,7 @@ bool SimpleFeature::HasDependencies() const {
}
void SimpleFeature::AddFilter(scoped_ptr<SimpleFeatureFilter> filter) {
- filters_.push_back(filter.Pass());
+ filters_.push_back(std::move(filter));
}
std::string SimpleFeature::Parse(const base::DictionaryValue* dictionary) {