Chromium Code Reviews| Index: cc/resources/resource_provider.h |
| diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h |
| index 56daa3e534f5eb37fc009e88a91a9b3d061ef903..641b2ff2c1d68fe69684fa2555d9480404d764e5 100644 |
| --- a/cc/resources/resource_provider.h |
| +++ b/cc/resources/resource_provider.h |
| @@ -14,6 +14,7 @@ |
| #include "base/callback.h" |
| #include "base/hash_tables.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/memory/weak_ptr.h" |
| #include "base/threading/thread_checker.h" |
| #include "cc/base/cc_export.h" |
| #include "cc/output/context_provider.h" |
| @@ -39,8 +40,11 @@ namespace cc { |
| class TextureUploader; |
| // This class is not thread-safe and can only be called from the thread it was |
| -// created on (in practice, the impl thread). |
| -class CC_EXPORT ResourceProvider { |
| +// created on (in practice, the impl thread). It supports WeakPtr in order to |
| +// tell when the provider and the context it holds is destroyed and no longer |
| +// usable. |
| +class CC_EXPORT ResourceProvider |
| + : public base::SupportsWeakPtr<ResourceProvider> { |
|
piman
2013/04/08 21:03:47
Will the VideoResourceUpdater outlive the layer? I
danakj
2013/04/08 21:44:56
Removed this as per offline convo. The callback is
|
| public: |
| typedef unsigned ResourceId; |
| typedef std::vector<ResourceId> ResourceIdArray; |