Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3277)

Unified Diff: cc/resources/resource_provider.cc

Issue 1062043003: cc: Add ResourceId validation checks at the time of AppendQuads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resource-validate: fixtests Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/test/fake_ui_resource_layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index f31cfd4da34e776878b87574f37a281741467f94..f3c6540707efd90652a5e1d3b19440fd429df13f 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -870,7 +870,7 @@ base::TimeTicks ResourceProvider::EstimatedUploadCompletionTime(
ResourceProvider::Resource* ResourceProvider::GetResource(ResourceId id) {
DCHECK(thread_checker_.CalledOnValidThread());
- // Try to differentiate GetResource with a bad id vs with no id.
+ // TODO(danakj): crbug.com/455931
CHECK(id);
ResourceMap::iterator it = resources_.find(id);
CHECK(it != resources_.end());
@@ -2134,6 +2134,13 @@ GLint ResourceProvider::GetActiveTextureUnit(GLES2Interface* gl) {
return active_unit;
}
+void ResourceProvider::ValidateResource(ResourceId id) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ CHECK(id);
+ ResourceMap::iterator it = resources_.find(id);
+ CHECK(it != resources_.end());
+}
+
GLES2Interface* ResourceProvider::ContextGL() const {
ContextProvider* context_provider = output_surface_->context_provider();
return context_provider ? context_provider->ContextGL() : NULL;
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/test/fake_ui_resource_layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698