From: Chandan Padhi Date: Wed, 7 Oct 2020 13:17:58 +0000 (+0530) Subject: [M85 Dev] Fix crash at webview launch for TV profile X-Git-Tag: submit/tizen/20201118.160233~127 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e19f4416a55007dabbd34990dafbd67998bb9249;p=platform%2Fframework%2Fweb%2Fchromium-efl.git [M85 Dev] Fix crash at webview launch for TV profile This commit ensures that a list of display::Display is maintained locally to fix crash during webview launch. Change-Id: I36caf3eca6b442be4a5d01fb4539df3efd264c33 Signed-off-by: Chandan Padhi --- diff --git a/tizen_src/chromium_impl/ui/display/screen_efl.cc b/tizen_src/chromium_impl/ui/display/screen_efl.cc index 2e9bd6c..e48ea49 100644 --- a/tizen_src/chromium_impl/ui/display/screen_efl.cc +++ b/tizen_src/chromium_impl/ui/display/screen_efl.cc @@ -20,7 +20,7 @@ namespace ui { class ScreenEfl : public display::Screen { public: - ScreenEfl() {} + ScreenEfl() { AddDisplay(); } ~ScreenEfl() override {} @@ -48,7 +48,7 @@ class ScreenEfl : public display::Screen { int GetNumDisplays() const override { return 1; } const std::vector& GetAllDisplays() const override { - return std::vector(1, GetPrimaryDisplay()); + return displays_; } display::Display GetDisplayNearestWindow( @@ -66,7 +66,18 @@ class ScreenEfl : public display::Screen { return GetPrimaryDisplay(); } - display::Display GetPrimaryDisplay() const override { + display::Display GetPrimaryDisplay() const override { return displays_[0]; } + + void AddObserver(display::DisplayObserver* /*observer*/) override { + NOTIMPLEMENTED(); + } + + void RemoveObserver(display::DisplayObserver* /*observer*/) override { + NOTIMPLEMENTED(); + } + + private: + void AddDisplay() { display::DeviceDisplayInfoEfl display_info; const float device_scale_factor = display::Display::HasForceDeviceScaleFactor() @@ -86,18 +97,11 @@ class ScreenEfl : public display::Screen { display.set_device_scale_factor(device_scale_factor); display.set_bounds(bounds_in_dip); - return display; + displays_.push_back(display); } - void AddObserver(display::DisplayObserver* /*observer*/) override { - NOTIMPLEMENTED(); - } + std::vector displays_; - void RemoveObserver(display::DisplayObserver* /*observer*/) override { - NOTIMPLEMENTED(); - } - - private: DISALLOW_COPY_AND_ASSIGN(ScreenEfl); };