Index: cc/resources/texture_uploader.cc |
diff --git a/cc/resources/texture_uploader.cc b/cc/resources/texture_uploader.cc |
index eb4e6c097a43b0f4257318a2a1f90386e264c030..8c7010b5f487fee7db3ef466b5a940a180fca2b4 100644 |
--- a/cc/resources/texture_uploader.cc |
+++ b/cc/resources/texture_uploader.cc |
@@ -116,6 +116,12 @@ double TextureUploader::EstimatedTexturesPerSecond() { |
} |
void TextureUploader::BeginQuery() { |
+ // Check to see if any of the pending queries are free before allocating a |
+ // new one. If this is not done, queries may be allocated without bound. |
+ // http://crbug.com/398072 |
+ if (available_queries_.empty()) |
+ ProcessQueries(); |
+ |
if (available_queries_.empty()) |
available_queries_.push_back(Query::Create(gl_)); |