From 09afa3a843531a1768896bed3f64fb49ed81b525 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 25 Sep 2018 15:40:02 +0200 Subject: [PATCH] Clarify expectations for CefRenderHandler::GetViewRect (issue #1910) --- include/capi/cef_render_handler_capi.h | 13 +-- include/cef_render_handler.h | 7 +- .../osr/render_widget_host_view_osr.cc | 82 ++++++++++--------- libcef_dll/cpptoc/render_handler_cpptoc.cc | 15 ++-- libcef_dll/ctocpp/render_handler_ctocpp.cc | 14 ++-- libcef_dll/ctocpp/render_handler_ctocpp.h | 4 +- .../browser/browser_window_osr_gtk.cc | 13 +-- .../browser/browser_window_osr_gtk.h | 2 +- .../browser/browser_window_osr_mac.h | 2 +- .../browser/browser_window_osr_mac.mm | 14 ++-- tests/cefclient/browser/client_handler_osr.cc | 11 ++- tests/cefclient/browser/client_handler_osr.h | 4 +- tests/cefclient/browser/osr_window_win.cc | 3 +- tests/cefclient/browser/osr_window_win.h | 4 +- tests/ceftests/os_rendering_unittest.cc | 5 +- tests/ceftests/osr_accessibility_unittest.cc | 3 +- tests/ceftests/osr_display_unittest.cc | 3 +- 17 files changed, 100 insertions(+), 99 deletions(-) diff --git a/include/capi/cef_render_handler_capi.h b/include/capi/cef_render_handler_capi.h index b499aa49b..b659a3809 100644 --- a/include/capi/cef_render_handler_capi.h +++ b/include/capi/cef_render_handler_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=f2f3acb1df9815e4ac9bf34010ce260a2496ae5a$ +// $hash=d259309846e69d866a834aa701bbf8c9562dd117$ // #ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ @@ -68,7 +68,8 @@ typedef struct _cef_render_handler_t { /// // Called to retrieve the root window rectangle in screen coordinates. Return - // true (1) if the rectangle was provided. + // true (1) if the rectangle was provided. If this function returns false (0) + // the rectangle from GetViewRect will be used. /// int(CEF_CALLBACK* get_root_screen_rect)(struct _cef_render_handler_t* self, struct _cef_browser_t* browser, @@ -76,11 +77,11 @@ typedef struct _cef_render_handler_t { /// // Called to retrieve the view rectangle which is relative to screen - // coordinates. Return true (1) if the rectangle was provided. + // coordinates. This function must always provide a non-NULL rectangle. /// - int(CEF_CALLBACK* get_view_rect)(struct _cef_render_handler_t* self, - struct _cef_browser_t* browser, - cef_rect_t* rect); + void(CEF_CALLBACK* get_view_rect)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, + cef_rect_t* rect); /// // Called to retrieve the translation from view coordinates to actual screen diff --git a/include/cef_render_handler.h b/include/cef_render_handler.h index 38cb74a1b..7bb4c1662 100644 --- a/include/cef_render_handler.h +++ b/include/cef_render_handler.h @@ -69,7 +69,8 @@ class CefRenderHandler : public virtual CefBaseRefCounted { /// // Called to retrieve the root window rectangle in screen coordinates. Return - // true if the rectangle was provided. + // true if the rectangle was provided. If this method returns false the + // rectangle from GetViewRect will be used. /// /*--cef()--*/ virtual bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) { @@ -78,10 +79,10 @@ class CefRenderHandler : public virtual CefBaseRefCounted { /// // Called to retrieve the view rectangle which is relative to screen - // coordinates. Return true if the rectangle was provided. + // coordinates. This method must always provide a non-empty rectangle. /// /*--cef()--*/ - virtual bool GetViewRect(CefRefPtr browser, CefRect& rect) = 0; + virtual void GetViewRect(CefRefPtr browser, CefRect& rect) = 0; /// // Called to retrieve the translation from view coordinates to actual screen diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 48f0043e1..c9580c118 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -414,8 +414,12 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetViewBounds() const { CefRect rc; CefRefPtr handler = browser_impl_->GetClient()->GetRenderHandler(); - if (handler.get()) - handler->GetViewRect(browser_impl_.get(), rc); + CHECK(handler); + + handler->GetViewRect(browser_impl_.get(), rc); + CHECK_GT(rc.width, 0); + CHECK_GT(rc.height, 0); + return gfx::Rect(rc.x, rc.y, rc.width, rc.height); } @@ -557,8 +561,9 @@ void CefRenderWidgetHostViewOSR::InitAsPopup( CefRefPtr handler = browser_impl_->GetClient()->GetRenderHandler(); - if (handler.get()) - handler->OnPopupShow(browser_impl_.get(), true); + CHECK(handler); + + handler->OnPopupShow(browser_impl_.get(), true); popup_position_ = pos; @@ -595,8 +600,7 @@ void CefRenderWidgetHostViewOSR::UpdateCursor( CefRefPtr handler = browser_impl_->GetClient()->GetRenderHandler(); - if (!handler.get()) - return; + CHECK(handler); content::CursorInfo cursor_info; cursor.GetCursorInfo(&cursor_info); @@ -717,25 +721,26 @@ void CefRenderWidgetHostViewOSR::GetScreenInfo( CefRefPtr handler = browser_impl_->client()->GetRenderHandler(); - if (handler.get() && - (!handler->GetScreenInfo(browser_impl_.get(), screen_info) || - screen_info.rect.width == 0 || screen_info.rect.height == 0 || - screen_info.available_rect.width == 0 || - screen_info.available_rect.height == 0)) { + CHECK(handler); + if (!handler->GetScreenInfo(browser_impl_.get(), screen_info) || + screen_info.rect.width == 0 || screen_info.rect.height == 0 || + screen_info.available_rect.width == 0 || + screen_info.available_rect.height == 0) { // If a screen rectangle was not provided, try using the view rectangle // instead. Otherwise, popup views may be drawn incorrectly, or not at all. CefRect screenRect; - if (!handler->GetViewRect(browser_impl_.get(), screenRect)) { - NOTREACHED(); - screenRect = CefRect(); + handler->GetViewRect(browser_impl_.get(), screenRect); + CHECK_GT(screenRect.width, 0); + CHECK_GT(screenRect.height, 0); + + if (screen_info.rect.width == 0 || screen_info.rect.height == 0) { + screen_info.rect = screenRect; } - if (screen_info.rect.width == 0 && screen_info.rect.height == 0) - screen_info.rect = screenRect; - - if (screen_info.available_rect.width == 0 && - screen_info.available_rect.height == 0) + if (screen_info.available_rect.width == 0 || + screen_info.available_rect.height == 0) { screen_info.available_rect = screenRect; + } } *results = ScreenInfoFrom(screen_info); @@ -751,7 +756,8 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() { CefRect rc; CefRefPtr handler = browser_impl_->client()->GetRenderHandler(); - if (handler.get() && handler->GetRootScreenRect(browser_impl_.get(), rc)) + CHECK(handler); + if (handler->GetRootScreenRect(browser_impl_.get(), rc)) return gfx::Rect(rc.x, rc.y, rc.width, rc.height); return GetViewBounds(); } @@ -852,11 +858,11 @@ void CefRenderWidgetHostViewOSR::SelectionChanged(const base::string16& text, CefRefPtr handler = browser_impl_->GetClient()->GetRenderHandler(); - if (handler.get()) { - CefRange cef_range(range.start(), range.end()); - handler->OnTextSelectionChanged(browser_impl_.get(), selected_text, - cef_range); - } + CHECK(handler); + + CefRange cef_range(range.start(), range.end()); + handler->OnTextSelectionChanged(browser_impl_.get(), selected_text, + cef_range); } #if !defined(OS_MACOSX) @@ -1242,8 +1248,7 @@ void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect, CefRefPtr handler = browser_impl_->client()->GetRenderHandler(); - if (!handler.get()) - return; + CHECK(handler); // Don't execute SynchronizeVisualProperties while the OnPaint callback is // pending. @@ -1326,8 +1331,8 @@ void CefRenderWidgetHostViewOSR::SetDeviceScaleFactor() { CefRect()); CefRefPtr handler = browser_impl_->client()->GetRenderHandler(); - if (handler.get() && - handler->GetScreenInfo(browser_impl_.get(), screen_info)) { + CHECK(handler); + if (handler->GetScreenInfo(browser_impl_.get(), screen_info)) { new_scale_factor = screen_info.device_scale_factor; } } @@ -1432,8 +1437,8 @@ void CefRenderWidgetHostViewOSR::CancelWidget() { if (IsPopupWidget() && browser_impl_.get()) { CefRefPtr handler = browser_impl_->client()->GetRenderHandler(); - if (handler.get()) - handler->OnPopupShow(browser_impl_.get(), false); + CHECK(handler); + handler->OnPopupShow(browser_impl_.get(), false); browser_impl_ = NULL; } @@ -1467,11 +1472,9 @@ void CefRenderWidgetHostViewOSR::OnScrollOffsetChanged() { if (browser_impl_.get()) { CefRefPtr handler = browser_impl_->client()->GetRenderHandler(); - if (handler.get()) { - handler->OnScrollOffsetChanged(browser_impl_.get(), - last_scroll_offset_.x(), - last_scroll_offset_.y()); - } + CHECK(handler); + handler->OnScrollOffsetChanged(browser_impl_.get(), last_scroll_offset_.x(), + last_scroll_offset_.y()); } is_scroll_offset_changed_pending_ = false; } @@ -1534,10 +1537,9 @@ void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged( CefRefPtr handler = browser_impl_->GetClient()->GetRenderHandler(); - if (handler.get()) { - handler->OnImeCompositionRangeChanged(browser_impl_->GetBrowser(), - cef_range, rcList); - } + CHECK(handler); + handler->OnImeCompositionRangeChanged(browser_impl_->GetBrowser(), + cef_range, rcList); } } diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.cc b/libcef_dll/cpptoc/render_handler_cpptoc.cc index a064ab8b5..998d70fc8 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/render_handler_cpptoc.cc @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=98625368df8daaeca9df1791f1867828a6271a89$ +// $hash=6cf6466ab2a1b87a1b57b5994aab64992b9f12dd$ // #include "libcef_dll/cpptoc/render_handler_cpptoc.h" @@ -70,7 +70,7 @@ render_handler_get_root_screen_rect(struct _cef_render_handler_t* self, return _retval; } -int CEF_CALLBACK +void CEF_CALLBACK render_handler_get_view_rect(struct _cef_render_handler_t* self, cef_browser_t* browser, cef_rect_t* rect) { @@ -78,29 +78,26 @@ render_handler_get_view_rect(struct _cef_render_handler_t* self, DCHECK(self); if (!self) - return 0; + return; // Verify param: browser; type: refptr_diff DCHECK(browser); if (!browser) - return 0; + return; // Verify param: rect; type: simple_byref DCHECK(rect); if (!rect) - return 0; + return; // Translate param: rect; type: simple_byref CefRect rectVal = rect ? *rect : CefRect(); // Execute - bool _retval = CefRenderHandlerCppToC::Get(self)->GetViewRect( + CefRenderHandlerCppToC::Get(self)->GetViewRect( CefBrowserCToCpp::Wrap(browser), rectVal); // Restore param: rect; type: simple_byref if (rect) *rect = rectVal; - - // Return type: bool - return _retval; } int CEF_CALLBACK diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.cc b/libcef_dll/ctocpp/render_handler_ctocpp.cc index 11fa74eb1..2ac42d639 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/render_handler_ctocpp.cc @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=bd2800111c1f3f3a5c6107d0454a2b5fe67067b6$ +// $hash=db89496c825cdc7fe1eaa4b7822d8492ae3a3f23$ // #include "libcef_dll/ctocpp/render_handler_ctocpp.h" @@ -59,25 +59,21 @@ bool CefRenderHandlerCToCpp::GetRootScreenRect(CefRefPtr browser, } NO_SANITIZE("cfi-icall") -bool CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, +void CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, CefRect& rect) { cef_render_handler_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_view_rect)) - return false; + return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: browser; type: refptr_diff DCHECK(browser.get()); if (!browser.get()) - return false; + return; // Execute - int _retval = - _struct->get_view_rect(_struct, CefBrowserCppToC::Wrap(browser), &rect); - - // Return type: bool - return _retval ? true : false; + _struct->get_view_rect(_struct, CefBrowserCppToC::Wrap(browser), &rect); } NO_SANITIZE("cfi-icall") diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.h b/libcef_dll/ctocpp/render_handler_ctocpp.h index 1a3bc1532..972713abf 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.h +++ b/libcef_dll/ctocpp/render_handler_ctocpp.h @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=9e2bcb61512095fba2fca928f4696fbb39d9d3b1$ +// $hash=46dd8560076264a776129a02ba11e2c2f56bf209$ // #ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_ @@ -36,7 +36,7 @@ class CefRenderHandlerCToCpp // CefRenderHandler methods. CefRefPtr GetAccessibilityHandler() override; bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) override; - bool GetViewRect(CefRefPtr browser, CefRect& rect) override; + void GetViewRect(CefRefPtr browser, CefRect& rect) override; bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, diff --git a/tests/cefclient/browser/browser_window_osr_gtk.cc b/tests/cefclient/browser/browser_window_osr_gtk.cc index 8600bed02..25b3f9de1 100644 --- a/tests/cefclient/browser/browser_window_osr_gtk.cc +++ b/tests/cefclient/browser/browser_window_osr_gtk.cc @@ -1122,12 +1122,17 @@ bool BrowserWindowOsrGtk::GetRootScreenRect(CefRefPtr browser, return false; } -bool BrowserWindowOsrGtk::GetViewRect(CefRefPtr browser, +void BrowserWindowOsrGtk::GetViewRect(CefRefPtr browser, CefRect& rect) { CEF_REQUIRE_UI_THREAD(); - if (!glarea_) - return false; + rect.x = rect.y = 0; + + if (!glarea_) { + // Never return an empty rectangle. + rect.width = rect.height = 1; + return; + } float device_scale_factor; { @@ -1137,11 +1142,9 @@ bool BrowserWindowOsrGtk::GetViewRect(CefRefPtr browser, // The simulated screen and view rectangle are the same. This is necessary // for popup menus to be located and sized inside the view. - rect.x = rect.y = 0; rect.width = DeviceToLogical(glarea_->allocation.width, device_scale_factor); rect.height = DeviceToLogical(glarea_->allocation.height, device_scale_factor); - return true; } bool BrowserWindowOsrGtk::GetScreenPoint(CefRefPtr browser, diff --git a/tests/cefclient/browser/browser_window_osr_gtk.h b/tests/cefclient/browser/browser_window_osr_gtk.h index 56d417b2f..99c98356d 100644 --- a/tests/cefclient/browser/browser_window_osr_gtk.h +++ b/tests/cefclient/browser/browser_window_osr_gtk.h @@ -55,7 +55,7 @@ class BrowserWindowOsrGtk : public BrowserWindow, void OnAfterCreated(CefRefPtr browser) OVERRIDE; void OnBeforeClose(CefRefPtr browser) OVERRIDE; bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) OVERRIDE; - bool GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; + void GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, diff --git a/tests/cefclient/browser/browser_window_osr_mac.h b/tests/cefclient/browser/browser_window_osr_mac.h index 7dcbd3335..5a5694b12 100644 --- a/tests/cefclient/browser/browser_window_osr_mac.h +++ b/tests/cefclient/browser/browser_window_osr_mac.h @@ -52,7 +52,7 @@ class BrowserWindowOsrMac : public BrowserWindow, void OnAfterCreated(CefRefPtr browser) OVERRIDE; void OnBeforeClose(CefRefPtr browser) OVERRIDE; bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) OVERRIDE; - bool GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; + void GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, diff --git a/tests/cefclient/browser/browser_window_osr_mac.mm b/tests/cefclient/browser/browser_window_osr_mac.mm index 66a036cf8..617692561 100644 --- a/tests/cefclient/browser/browser_window_osr_mac.mm +++ b/tests/cefclient/browser/browser_window_osr_mac.mm @@ -1348,13 +1348,18 @@ bool BrowserWindowOsrMac::GetRootScreenRect(CefRefPtr browser, return false; } -bool BrowserWindowOsrMac::GetViewRect(CefRefPtr browser, +void BrowserWindowOsrMac::GetViewRect(CefRefPtr browser, CefRect& rect) { CEF_REQUIRE_UI_THREAD(); REQUIRE_MAIN_THREAD(); - if (!nsview_) - return false; + rect.x = rect.y = 0; + + if (!nsview_) { + // Never return an empty rectangle. + rect.width = rect.height = 1; + return; + } const float device_scale_factor = [GLView(nsview_) getDeviceScaleFactor]; @@ -1365,11 +1370,8 @@ bool BrowserWindowOsrMac::GetViewRect(CefRefPtr browser, bounds = [GLView(nsview_) convertRectToBackingInternal:bounds]; // Convert to browser view coordinates. - rect.x = rect.y = 0; rect.width = DeviceToLogical(bounds.size.width, device_scale_factor); rect.height = DeviceToLogical(bounds.size.height, device_scale_factor); - - return true; } bool BrowserWindowOsrMac::GetScreenPoint(CefRefPtr browser, diff --git a/tests/cefclient/browser/client_handler_osr.cc b/tests/cefclient/browser/client_handler_osr.cc index a2a2863f0..7dad8e21f 100644 --- a/tests/cefclient/browser/client_handler_osr.cc +++ b/tests/cefclient/browser/client_handler_osr.cc @@ -50,12 +50,15 @@ bool ClientHandlerOsr::GetRootScreenRect(CefRefPtr browser, return osr_delegate_->GetRootScreenRect(browser, rect); } -bool ClientHandlerOsr::GetViewRect(CefRefPtr browser, +void ClientHandlerOsr::GetViewRect(CefRefPtr browser, CefRect& rect) { CEF_REQUIRE_UI_THREAD(); - if (!osr_delegate_) - return false; - return osr_delegate_->GetViewRect(browser, rect); + if (!osr_delegate_) { + // Never return an empty rectangle. + rect.width = rect.height = 1; + return; + } + osr_delegate_->GetViewRect(browser, rect); } bool ClientHandlerOsr::GetScreenPoint(CefRefPtr browser, diff --git a/tests/cefclient/browser/client_handler_osr.h b/tests/cefclient/browser/client_handler_osr.h index 42723102b..f55c1cb77 100644 --- a/tests/cefclient/browser/client_handler_osr.h +++ b/tests/cefclient/browser/client_handler_osr.h @@ -27,7 +27,7 @@ class ClientHandlerOsr : public ClientHandler, // These methods match the CefRenderHandler interface. virtual bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) = 0; - virtual bool GetViewRect(CefRefPtr browser, CefRect& rect) = 0; + virtual void GetViewRect(CefRefPtr browser, CefRect& rect) = 0; virtual bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, @@ -87,7 +87,7 @@ class ClientHandlerOsr : public ClientHandler, // CefRenderHandler methods. bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) OVERRIDE; - bool GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; + void GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, diff --git a/tests/cefclient/browser/osr_window_win.cc b/tests/cefclient/browser/osr_window_win.cc index 288c964ae..e47fc67d0 100644 --- a/tests/cefclient/browser/osr_window_win.cc +++ b/tests/cefclient/browser/osr_window_win.cc @@ -870,7 +870,7 @@ bool OsrWindowWin::GetRootScreenRect(CefRefPtr browser, return false; } -bool OsrWindowWin::GetViewRect(CefRefPtr browser, CefRect& rect) { +void OsrWindowWin::GetViewRect(CefRefPtr browser, CefRect& rect) { CEF_REQUIRE_UI_THREAD(); DCHECK_GT(device_scale_factor_, 0); @@ -879,7 +879,6 @@ bool OsrWindowWin::GetViewRect(CefRefPtr browser, CefRect& rect) { device_scale_factor_); rect.height = DeviceToLogical(client_rect_.bottom - client_rect_.top, device_scale_factor_); - return true; } bool OsrWindowWin::GetScreenPoint(CefRefPtr browser, diff --git a/tests/cefclient/browser/osr_window_win.h b/tests/cefclient/browser/osr_window_win.h index 900af2d85..fa9971b31 100644 --- a/tests/cefclient/browser/osr_window_win.h +++ b/tests/cefclient/browser/osr_window_win.h @@ -27,7 +27,7 @@ class OsrWindowWin : public base::RefCountedThreadSafe, public ClientHandlerOsr::OsrDelegate #if defined(CEF_USE_ATL) - , + , public OsrDragEvents #endif { @@ -114,7 +114,7 @@ class OsrWindowWin void OnAfterCreated(CefRefPtr browser) OVERRIDE; void OnBeforeClose(CefRefPtr browser) OVERRIDE; bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) OVERRIDE; - bool GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; + void GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE; bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, diff --git a/tests/ceftests/os_rendering_unittest.cc b/tests/ceftests/os_rendering_unittest.cc index e7ba14b74..1bb4e3026 100644 --- a/tests/ceftests/os_rendering_unittest.cc +++ b/tests/ceftests/os_rendering_unittest.cc @@ -324,13 +324,12 @@ class OSRTestHandler : public RoutingTestHandler, } // CefRenderHandler methods - bool GetViewRect(CefRefPtr browser, CefRect& rect) override { + void GetViewRect(CefRefPtr browser, CefRect& rect) override { if (test_type_ == OSR_TEST_RESIZE && started()) { rect = CefRect(0, 0, kOsrWidth * 2, kOsrHeight * 2); - return true; + return; } rect = CefRect(0, 0, kOsrWidth, kOsrHeight); - return true; } bool GetScreenPoint(CefRefPtr browser, diff --git a/tests/ceftests/osr_accessibility_unittest.cc b/tests/ceftests/osr_accessibility_unittest.cc index c9e2e6a4c..a943735ff 100644 --- a/tests/ceftests/osr_accessibility_unittest.cc +++ b/tests/ceftests/osr_accessibility_unittest.cc @@ -47,9 +47,8 @@ class AccessibilityTestHandler : public TestHandler, CefRefPtr GetRenderHandler() override { return this; } // Cef Renderer Handler Methods - bool GetViewRect(CefRefPtr browser, CefRect& rect) override { + void GetViewRect(CefRefPtr browser, CefRect& rect) override { rect = CefRect(0, 0, kOsrWidth, kOsrHeight); - return true; } bool GetScreenInfo(CefRefPtr browser, diff --git a/tests/ceftests/osr_display_unittest.cc b/tests/ceftests/osr_display_unittest.cc index 720d5bdc5..a95b5b9a9 100644 --- a/tests/ceftests/osr_display_unittest.cc +++ b/tests/ceftests/osr_display_unittest.cc @@ -24,9 +24,8 @@ class DisplayTestHandler : public RoutingTestHandler, public CefRenderHandler { CefRefPtr GetRenderHandler() override { return this; } - bool GetViewRect(CefRefPtr browser, CefRect& rect) override { + void GetViewRect(CefRefPtr browser, CefRect& rect) override { rect = CefRect(0, 0, kOsrWidth, kOsrHeight); - return true; } bool GetScreenInfo(CefRefPtr browser,