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

Side by Side Diff: extensions/common/features/complex_feature.cc

Issue 1908953003: Convert //extensions/{common,shell} from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/common/features/complex_feature.h" 5 #include "extensions/common/features/complex_feature.h"
6 6
7 namespace extensions { 7 namespace extensions {
8 8
9 ComplexFeature::ComplexFeature(scoped_ptr<FeatureList> features) { 9 ComplexFeature::ComplexFeature(std::unique_ptr<FeatureList> features) {
10 DCHECK_GT(features->size(), 0UL); 10 DCHECK_GT(features->size(), 0UL);
11 features_.swap(*features); 11 features_.swap(*features);
12 no_parent_ = features_[0]->no_parent(); 12 no_parent_ = features_[0]->no_parent();
13 13
14 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) 14 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
15 // Verify IsInternal and no_parent is consistent across all features. 15 // Verify IsInternal and no_parent is consistent across all features.
16 bool first_is_internal = features_[0]->IsInternal(); 16 bool first_is_internal = features_[0]->IsInternal();
17 for (FeatureList::const_iterator it = features_.begin() + 1; 17 for (FeatureList::const_iterator it = features_.begin() + 1;
18 it != features_.end(); 18 it != features_.end();
19 ++it) { 19 ++it) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 Context context) const { 108 Context context) const {
109 if (result == IS_AVAILABLE) 109 if (result == IS_AVAILABLE)
110 return std::string(); 110 return std::string();
111 111
112 // TODO(justinlin): Form some kind of combined availabilities/messages from 112 // TODO(justinlin): Form some kind of combined availabilities/messages from
113 // SimpleFeatures. 113 // SimpleFeatures.
114 return features_[0]->GetAvailabilityMessage(result, type, url, context); 114 return features_[0]->GetAvailabilityMessage(result, type, url, context);
115 } 115 }
116 116
117 } // namespace extensions 117 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/features/complex_feature.h ('k') | extensions/common/features/complex_feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698