extensions::ExternalInstallInfo and related are awfully pointer-y |
||
Issue descriptionextensions::ExternalInstallInfo [1] is awfully pointery. Each subclass (ExternalInstallInfoFile and ExternalInstallInfoUpdateUrl) has a member stored in a unique_ptr for no real reason, and they are passed around in vectors of unique pointers. We should un-pointer-ify them to reduce allocation cost as well as necessary nullchecks and redirections.
,
Oct 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4 commit 19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4 Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Sun Oct 01 04:14:05 2017 [Extensions] Don't store ExternalInstallInfo in vectors of pointers ExternalInstallInfos are currently stored in std::vector<std::unique_ptr<T>>s, but they should just be stored in std::vector<T>s (where T is either ExternalInstallInfoFile or ExternalInstallInfoUpdateUrl). Once constructed, the vectors themselves are never passed, so the only time moves are necessary is during vector resizing, which for the number of external extensions users should be relatively rare. Additionally, the structs themselves are fairly cheap to move. Save on dynamic allocations and just store these in std::vectors. TBR=stevenjb@chromium.org for customization/customization_document_unittest.cc Bug: 770007 Change-Id: Ic3e3ea2de8ee09455fc021914eba20e1bdca2df0 Reviewed-on: https://chromium-review.googlesource.com/692975 Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Karan Bhatia <karandeepb@chromium.org> Cr-Commit-Position: refs/heads/master@{#505501} [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/chrome/browser/chromeos/customization/customization_document_unittest.cc [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/chrome/browser/extensions/extension_service.cc [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/chrome/browser/extensions/extension_service.h [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/chrome/browser/extensions/extension_service_unittest.cc [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/chrome/browser/extensions/external_policy_loader_unittest.cc [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/chrome/browser/extensions/external_provider_impl.cc [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/chrome/browser/extensions/external_provider_impl.h [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/extensions/browser/external_install_info.cc [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/extensions/browser/external_install_info.h [modify] https://crrev.com/19f70b6a0d53a9cce4aff3cb62fbaef8be3981d4/extensions/browser/external_provider_interface.h
,
Oct 2 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/92c52cac628a9ac111a2aa7e5b59996610f38e34 commit 92c52cac628a9ac111a2aa7e5b59996610f38e34 Author: Devlin Cronin <rdevlin.cronin@chromium.org> Date: Mon Oct 02 21:29:01 2017 [Extensions] Allocate ExternalInstallInfos on the stack in unittests ExtensionService unittests construct a bunch of ExternalInstallInfos, but for some reason choose smart pointers over stack allocation (even though they aren't passed anywhere). Use stack allocation instead. Bug: 770007 Change-Id: Ic5a2ee425581b7f887b95a49d9409a5238d2394d Reviewed-on: https://chromium-review.googlesource.com/693396 Reviewed-by: Karan Bhatia <karandeepb@chromium.org> Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/master@{#505790} [modify] https://crrev.com/92c52cac628a9ac111a2aa7e5b59996610f38e34/chrome/browser/extensions/extension_service_unittest.cc
,
Oct 4 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Sep 29 2017