perf: cache the return value of IsX11()
(#46427)
* perf: cache the return value of IsX11() Co-authored-by: Charles Kerr <charles@charleskerr.com> * fix: mark as nodiscard for those who call, but mark as maybe_unused for Windows Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
7299dd1501
commit
a0ac690881
1 changed files with 5 additions and 4 deletions
|
@ -163,10 +163,11 @@ gfx::Size WindowSizeToContentSizeBuggy(HWND hwnd, const gfx::Size& size) {
|
|||
|
||||
#endif
|
||||
|
||||
[[maybe_unused]] bool IsX11() {
|
||||
return ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.electron_can_call_x11;
|
||||
[[maybe_unused, nodiscard]] bool IsX11() {
|
||||
static const bool is_x11 = ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.electron_can_call_x11;
|
||||
return is_x11;
|
||||
}
|
||||
|
||||
class NativeWindowClientView : public views::ClientView {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue