Commit e1601613 authored by vmpstr's avatar vmpstr Committed by Commit bot

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}
parent 2b6d4cba
......@@ -26,7 +26,8 @@ class Value;
namespace cc {
class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> {
class CC_EXPORT PicturePileBase
: public base::RefCountedThreadSafe<PicturePileBase> {
public:
PicturePileBase();
explicit PicturePileBase(const PicturePileBase* other);
......@@ -136,7 +137,7 @@ class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> {
private:
void SetBufferPixels(int buffer_pixels);
friend class base::RefCounted<PicturePileBase>;
friend class base::RefCountedThreadSafe<PicturePileBase>;
DISALLOW_COPY_AND_ASSIGN(PicturePileBase);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment