Make ppapi Resource objects RefCountedThreadSafe

In DCHECK_IS_ON mode, base::RefCounted's sequence checker will trigger
because ppapi's Resources will be ref-counted across threads.

One specific case is the interaction between MessageLoopResource and
pp::SimpleThread. Constructing a SimpleThread will create and ref a
MessageLoopResource on the creation thread, but when the thread is
started, the thread calls AttachToCurrentThread() where
MessageLoopResource will ref itself.

BUG=756531,907972

Change-Id: I00454970a293db5f1298d5152c44bf08ec704122
Reviewed-on: https://chromium-review.googlesource.com/c/1350439
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Commit-Queue: Anand Mistry <amistry@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#617051}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c78b3e69be46642bab7f56dd845ee996408f7703
1 file changed