| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/android/stream_texture_factory_synchronous_impl
.h" | 5 #include "content/renderer/media/android/stream_texture_factory_synchronous_impl
.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 : public StreamTextureProxy, | 29 : public StreamTextureProxy, |
| 30 public base::SupportsWeakPtr<StreamTextureProxyImpl> { | 30 public base::SupportsWeakPtr<StreamTextureProxyImpl> { |
| 31 public: | 31 public: |
| 32 explicit StreamTextureProxyImpl( | 32 explicit StreamTextureProxyImpl( |
| 33 StreamTextureFactorySynchronousImpl::ContextProvider* provider); | 33 StreamTextureFactorySynchronousImpl::ContextProvider* provider); |
| 34 virtual ~StreamTextureProxyImpl(); | 34 virtual ~StreamTextureProxyImpl(); |
| 35 | 35 |
| 36 // StreamTextureProxy implementation: | 36 // StreamTextureProxy implementation: |
| 37 virtual void BindToLoop(int32 stream_id, | 37 virtual void BindToLoop(int32 stream_id, |
| 38 cc::VideoFrameProvider::Client* client, | 38 cc::VideoFrameProvider::Client* client, |
| 39 scoped_refptr<base::MessageLoopProxy> loop) OVERRIDE; | 39 scoped_refptr<base::MessageLoopProxy> loop) override; |
| 40 virtual void Release() OVERRIDE; | 40 virtual void Release() override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 void BindOnThread(int32 stream_id); | 43 void BindOnThread(int32 stream_id); |
| 44 void OnFrameAvailable(); | 44 void OnFrameAvailable(); |
| 45 | 45 |
| 46 // Protects access to |client_| and |loop_|. | 46 // Protects access to |client_| and |loop_|. |
| 47 base::Lock lock_; | 47 base::Lock lock_; |
| 48 cc::VideoFrameProvider::Client* client_; | 48 cc::VideoFrameProvider::Client* client_; |
| 49 scoped_refptr<base::MessageLoopProxy> loop_; | 49 scoped_refptr<base::MessageLoopProxy> loop_; |
| 50 | 50 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 227 |
| 228 void StreamTextureFactorySynchronousImpl::RemoveObserver( | 228 void StreamTextureFactorySynchronousImpl::RemoveObserver( |
| 229 StreamTextureFactoryContextObserver* obs) { | 229 StreamTextureFactoryContextObserver* obs) { |
| 230 DCHECK_EQ(observer_, obs); | 230 DCHECK_EQ(observer_, obs); |
| 231 observer_ = NULL; | 231 observer_ = NULL; |
| 232 if (context_provider_.get()) | 232 if (context_provider_.get()) |
| 233 context_provider_->RemoveObserver(obs); | 233 context_provider_->RemoveObserver(obs); |
| 234 } | 234 } |
| 235 | 235 |
| 236 } // namespace content | 236 } // namespace content |
| OLD | NEW |