summaryrefslogtreecommitdiffstats
path: root/cc/resources/resource_provider.h
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-11 06:37:25 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-11 06:37:25 +0000
commit7ba3ca741c8a5b174dd2ebdc0c3495857c402106 (patch)
tree28d5ab69d881ae807383166c98e95af5ea5e6cf4 /cc/resources/resource_provider.h
parentb5c8ccc922e201f1b7424d85380d5131de025101 (diff)
downloadchromium_src-7ba3ca741c8a5b174dd2ebdc0c3495857c402106.zip
chromium_src-7ba3ca741c8a5b174dd2ebdc0c3495857c402106.tar.gz
chromium_src-7ba3ca741c8a5b174dd2ebdc0c3495857c402106.tar.bz2
cc: Delete resources when ResourceProvider shuts down.
When the ResourceProvider is destroyed, it should destroy the resources it owns, and notify the creators of the resources that they are released (in the TextureMailbox case). If the context is lost, then callback should inform the creator that the resource is destroyed in the callback. So a bool is added to make this information known. If a resource is in use in the parent, it will be leaked still, which is a known issue and will be addressed in the future. Tests: ResourceProviderTest.Shutdown ResourceProviderTest.LostContext ResourceProviderTest.ShutdownWithExportedResource R=piman BUG=230126 Review URL: https://chromiumcodereview.appspot.com/13887008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/resource_provider.h')
-rw-r--r--cc/resources/resource_provider.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index 56daa3e..01e6027 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -60,6 +60,8 @@ class CC_EXPORT ResourceProvider {
virtual ~ResourceProvider();
+ void DidLoseOutputSurface() { lost_output_surface_ = true; }
+
WebKit::WebGraphicsContext3D* GraphicsContext3D();
TextureCopier* texture_copier() const { return texture_copier_.get(); }
int max_texture_size() const { return max_texture_size_; }
@@ -369,10 +371,15 @@ class CC_EXPORT ResourceProvider {
bool TransferResource(WebKit::WebGraphicsContext3D* context,
ResourceId id,
TransferableResource* resource);
- void DeleteResourceInternal(ResourceMap::iterator it);
+ enum DeleteStyle {
+ Normal,
+ ForShutdown,
+ };
+ void DeleteResourceInternal(ResourceMap::iterator it, DeleteStyle style);
void LazyAllocate(Resource* resource);
OutputSurface* output_surface_;
+ bool lost_output_surface_;
ResourceId next_id_;
ResourceMap resources_;
int next_child_;