Refactor Uses of std::set to std::vector in SimpleFeature
commit43eb02c2ffcfa18adfcbf34cd0507a3d7494febe
authorrobliao <robliao@chromium.org>
Fri, 27 Mar 2015 18:25:11 +0000 (27 11:25 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 27 Mar 2015 18:26:01 +0000 (27 18:26 +0000)
tree97480dd6f2a973a6a187e71ad86aa77bea59de26
parentddde1d3ec2c03222808b4d93a8c23208b3f4c2ff
Refactor Uses of std::set to std::vector in SimpleFeature

Local profiling suggests that converting std::set to std::vector will save
around 10% of the overall startup time, likely due to the reduced allocs
involved with std::vector.

This change also reduces lookups by traversing the incoming dictionary
and iterating on the available values instead of looking through all
values for all features.

Finally, cleaned up and enforced the testing accessors via code and friend
declarations

BUG=460987

Review URL: https://codereview.chromium.org/1010973013

Cr-Commit-Position: refs/heads/master@{#322609}
base/stl_util.h
chrome/browser/content_settings/content_settings_internal_extension_provider.cc
chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
chrome/browser/extensions/external_component_loader.cc
extensions/browser/api/app_window/app_window_api.cc
extensions/common/features/base_feature_provider_unittest.cc
extensions/common/features/simple_feature.cc
extensions/common/features/simple_feature.h
extensions/common/features/simple_feature_unittest.cc