diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-15 23:58:04 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-15 23:58:04 +0000 |
commit | 2964d2080646dc87150c3abb140ccac800282958 (patch) | |
tree | 176b65b769a863d4a033b909d418b09ccf550cbf /remoting/client/rectangle_update_decoder.cc | |
parent | dc04be7c8fa4f83a72aab879b312a3707016e371 (diff) | |
download | chromium_src-2964d2080646dc87150c3abb140ccac800282958.zip chromium_src-2964d2080646dc87150c3abb140ccac800282958.tar.gz chromium_src-2964d2080646dc87150c3abb140ccac800282958.tar.bz2 |
Fix RectangleUpdateDecoder to reference the FrameConsumerProxy.
RectangleUpdateDecoder runs on a separate thread from the FrameConsumer in the PPAPI plugin client, requiring FrameConsumer calls to be proxied to the correct thread. Previously it was passed a bare FrameConsumer pointer, with the underlying FrameConsumerProxy lifetime managed by the ChromotingInstance. Since the RectangleUpdateDecoder is itself ref-counted it can outlive the ChromotingInstance, and thereby the FrameConsumerProxy, if it is still processing queued messages at the time.
This CL:
* Changes RectangleUpdateDecoder() to take scoped_refptr<>s to the message-loop-proxy and consumer.
* Has RectangleUpdateDecoder() take a FrameConsumerProxy, since FrameConsumer is not ref-counted. Ideally it should take a scoped_ptr<FrameConsumer>, and leave ref-counting to be an internal detail of FrameConsumerProxy.
Also:
* FrameConsumerProxy now accepts a WeakPtr<FrameConsumer>, removing the need for an explicit Detach(), which feels safer. The WeakPtr must have been created on the thread the FrameConsumerProxy will punt calls to, which shouldn't be a problem.
* PepperView now SupportsWeakPtr rather than containing a WeakPtrFactory, to make it easy to get a WeakPtr to it.
BUG=118110
Review URL: http://codereview.chromium.org/9703006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127035 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/rectangle_update_decoder.cc')
-rw-r--r-- | remoting/client/rectangle_update_decoder.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/remoting/client/rectangle_update_decoder.cc b/remoting/client/rectangle_update_decoder.cc index d829576..8eeebd5 100644 --- a/remoting/client/rectangle_update_decoder.cc +++ b/remoting/client/rectangle_update_decoder.cc @@ -25,7 +25,8 @@ using remoting::protocol::SessionConfig; namespace remoting { RectangleUpdateDecoder::RectangleUpdateDecoder( - base::MessageLoopProxy* message_loop, FrameConsumer* consumer) + scoped_refptr<base::MessageLoopProxy> message_loop, + scoped_refptr<FrameConsumerProxy> consumer) : message_loop_(message_loop), consumer_(consumer), source_size_(SkISize::Make(0, 0)), |