From e1601613e8f4b8cbe451fb37d99409b1da19b74a Mon Sep 17 00:00:00 2001 From: vmpstr Date: Mon, 27 Oct 2014 13:36:52 -0700 Subject: [PATCH] cc: Make picture pile base thread safe. This patch ensures that picture pile base is thread safe, since it is not guaranteed that the ref is always adjusted on the same thread. In particular, the worker thread (which refs picture pile on the cc thread) might deref it (and delete it) on the worker thread. R=reveman Review URL: https://codereview.chromium.org/683543002 Cr-Commit-Position: refs/heads/master@{#301434} --- cc/resources/picture_pile_base.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cc/resources/picture_pile_base.h b/cc/resources/picture_pile_base.h index bb9116c63f74..07540cbf37f5 100644 --- a/cc/resources/picture_pile_base.h +++ b/cc/resources/picture_pile_base.h @@ -26,7 +26,8 @@ class Value; namespace cc { -class CC_EXPORT PicturePileBase : public base::RefCounted { +class CC_EXPORT PicturePileBase + : public base::RefCountedThreadSafe { public: PicturePileBase(); explicit PicturePileBase(const PicturePileBase* other); @@ -136,7 +137,7 @@ class CC_EXPORT PicturePileBase : public base::RefCounted { private: void SetBufferPixels(int buffer_pixels); - friend class base::RefCounted; + friend class base::RefCountedThreadSafe; DISALLOW_COPY_AND_ASSIGN(PicturePileBase); }; -- 2.11.4.GIT