summaryrefslogtreecommitdiff
path: root/chromium/ui/accelerated_widget_mac
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-05-09 14:22:11 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-05-09 15:11:45 +0000
commit2ddb2d3e14eef3de7dbd0cef553d669b9ac2361c (patch)
treee75f511546c5fd1a173e87c1f9fb11d7ac8d1af3 /chromium/ui/accelerated_widget_mac
parenta4f3d46271c57e8155ba912df46a05559d14726e (diff)
downloadqtwebengine-chromium-2ddb2d3e14eef3de7dbd0cef553d669b9ac2361c.tar.gz
BASELINE: Update Chromium to 51.0.2704.41
Also adds in all smaller components by reversing logic for exclusion. Change-Id: Ibf90b506e7da088ea2f65dcf23f2b0992c504422 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'chromium/ui/accelerated_widget_mac')
-rw-r--r--chromium/ui/accelerated_widget_mac/accelerated_widget_mac.h6
-rw-r--r--chromium/ui/accelerated_widget_mac/accelerated_widget_mac.mm4
-rw-r--r--chromium/ui/accelerated_widget_mac/display_link_mac.cc22
3 files changed, 24 insertions, 8 deletions
diff --git a/chromium/ui/accelerated_widget_mac/accelerated_widget_mac.h b/chromium/ui/accelerated_widget_mac/accelerated_widget_mac.h
index 696dc188347..fea9a515e8d 100644
--- a/chromium/ui/accelerated_widget_mac/accelerated_widget_mac.h
+++ b/chromium/ui/accelerated_widget_mac/accelerated_widget_mac.h
@@ -51,7 +51,7 @@ class AcceleratedWidgetMacNSView {
// in an NSView by setting the AcceleratedWidgetMacNSView for the helper.
class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac {
public:
- explicit AcceleratedWidgetMac(bool needs_gl_finish_workaround);
+ AcceleratedWidgetMac();
virtual ~AcceleratedWidgetMac();
gfx::AcceleratedWidget accelerated_widget() { return native_widget_; }
@@ -113,10 +113,6 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac {
// The size in DIP of the last swap received from |compositor_|.
gfx::Size last_swap_size_dip_;
- // Whether surfaces created by the widget should use the glFinish() workaround
- // after compositing.
- bool needs_gl_finish_workaround_;
-
DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMac);
};
diff --git a/chromium/ui/accelerated_widget_mac/accelerated_widget_mac.mm b/chromium/ui/accelerated_widget_mac/accelerated_widget_mac.mm
index 135f64c2e4b..fc9269bd20f 100644
--- a/chromium/ui/accelerated_widget_mac/accelerated_widget_mac.mm
+++ b/chromium/ui/accelerated_widget_mac/accelerated_widget_mac.mm
@@ -45,9 +45,7 @@ AcceleratedWidgetMac* GetHelperFromAcceleratedWidget(
////////////////////////////////////////////////////////////////////////////////
// AcceleratedWidgetMac
-AcceleratedWidgetMac::AcceleratedWidgetMac(bool needs_gl_finish_workaround)
- : view_(NULL),
- needs_gl_finish_workaround_(needs_gl_finish_workaround) {
+AcceleratedWidgetMac::AcceleratedWidgetMac() : view_(nullptr) {
// Disable the fade-in animation as the layers are added.
ScopedCAActionDisabler disabler;
diff --git a/chromium/ui/accelerated_widget_mac/display_link_mac.cc b/chromium/ui/accelerated_widget_mac/display_link_mac.cc
index d9cc46876f9..72470f64b1e 100644
--- a/chromium/ui/accelerated_widget_mac/display_link_mac.cc
+++ b/chromium/ui/accelerated_widget_mac/display_link_mac.cc
@@ -25,6 +25,20 @@ struct ScopedTypeRefTraits<CVDisplayLinkRef> {
} // namespace base
+namespace {
+
+// Empty callback set during tear down.
+CVReturn VoidDisplayLinkCallback(CVDisplayLinkRef display_link,
+ const CVTimeStamp* now,
+ const CVTimeStamp* output_time,
+ CVOptionFlags flags_in,
+ CVOptionFlags* flags_out,
+ void* context) {
+ return kCVReturnSuccess;
+}
+
+} // namespace
+
namespace ui {
// static
@@ -86,6 +100,14 @@ DisplayLinkMac::DisplayLinkMac(
DisplayLinkMac::~DisplayLinkMac() {
StopDisplayLink();
+ // Usually |display_link_| holds the last reference to CVDisplayLinkRef, but
+ // that's not guaranteed, so it might not free all resources after the
+ // destructor completes. Ensure the callback is cleared out regardless to
+ // avoid possible crashes (see http://crbug.com/564780).
+ CVReturn ret = CVDisplayLinkSetOutputCallback(
+ display_link_, VoidDisplayLinkCallback, nullptr);
+ DCHECK_EQ(kCGErrorSuccess, ret);
+
DisplayMap::iterator found = display_map_.Get().find(display_id_);
DCHECK(found != display_map_.Get().end());
DCHECK(found->second == this);