Commit 49ac5d53 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

[Code health] Make some members in Blink::PaintWorkletInput const

The Blink::PaintWorkletInput is a const data structure, once it is
created, its member should never be changed.

Bug: 884698
Change-Id: I9ac31481066fb6a6f2f0d02524b4136f3f084d23
Reviewed-on: https://chromium-review.googlesource.com/c/1388108Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618592}
parent 44c80f25
......@@ -17,9 +17,12 @@ PaintWorkletInput::PaintWorkletInput(
const Vector<AtomicString>& custom_properties)
: name_(name),
container_size_(container_size),
effective_zoom_(effective_zoom) {
style_map_ = MakeGarbageCollected<PaintWorkletStylePropertyMap>(
document, style, styled_node, native_properties, custom_properties);
}
effective_zoom_(effective_zoom),
style_map_(MakeGarbageCollected<PaintWorkletStylePropertyMap>(
document,
style,
styled_node,
native_properties,
custom_properties)) {}
} // namespace blink
......@@ -38,12 +38,10 @@ class CORE_EXPORT PaintWorkletInput : public cc::PaintWorkletInput {
PaintWorkletStylePropertyMap* StyleMap() { return style_map_.Get(); }
private:
// TODO(xidachen): these members should be const as they are immutable once
// created.
std::string name_;
FloatSize container_size_;
float effective_zoom_;
CrossThreadPersistent<PaintWorkletStylePropertyMap> style_map_;
const std::string name_;
const FloatSize container_size_;
const float effective_zoom_;
const CrossThreadPersistent<PaintWorkletStylePropertyMap> style_map_;
};
} // namespace blink
......
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