Commit b27cda94 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Make optimization of blink::SelectType easier

* Add |final| to SelectType subclasses so that compilers can omit vtbl
  lookup code

* Add |const| to SelectType::select_ to avoid getting its value from
  memory multiple times in a single SelectType method

This CL has no behavior changes.

Bug: 1052232
Change-Id: I6c941defd9c8a4f428abd2a62e673f026daddb2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2057223
Auto-Submit: Kent Tamura <tkent@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741465}
parent 4f0c590a
......@@ -34,7 +34,7 @@
namespace blink {
class MenuListSelectType : public SelectType {
class MenuListSelectType final : public SelectType {
public:
explicit MenuListSelectType(HTMLSelectElement& select) : SelectType(select) {}
......@@ -77,7 +77,7 @@ void MenuListSelectType::DidSelectOption(
// ============================================================================
class ListBoxSelectType : public SelectType {
class ListBoxSelectType final : public SelectType {
public:
explicit ListBoxSelectType(HTMLSelectElement& select) : SelectType(select) {}
};
......
......@@ -28,7 +28,7 @@ class SelectType : public GarbageCollected<SelectType> {
protected:
explicit SelectType(HTMLSelectElement& select);
Member<HTMLSelectElement> select_;
const Member<HTMLSelectElement> select_;
private:
SelectType(const SelectType&) = delete;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment