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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « cc/resources/resource_provider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/resources/resource_provider.h" 5 #include "cc/resources/resource_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 2127
2128 resource->read_lock_fence->Wait(); 2128 resource->read_lock_fence->Wait();
2129 } 2129 }
2130 2130
2131 GLint ResourceProvider::GetActiveTextureUnit(GLES2Interface* gl) { 2131 GLint ResourceProvider::GetActiveTextureUnit(GLES2Interface* gl) {
2132 GLint active_unit = 0; 2132 GLint active_unit = 0;
2133 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit); 2133 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit);
2134 return active_unit; 2134 return active_unit;
2135 } 2135 }
2136 2136
2137 void ResourceProvider::ValidateResource(ResourceId id) {
2138 DCHECK(thread_checker_.CalledOnValidThread());
2139 CHECK(id);
2140 ResourceMap::iterator it = resources_.find(id);
2141 CHECK(it != resources_.end());
piman 2015/04/07 00:13:39 nit: all that is essentially (void)GetResource(id)
danakj 2015/04/07 00:15:00 Ya I copied it from there. Heh. My random thought
2142 }
2143
2137 GLES2Interface* ResourceProvider::ContextGL() const { 2144 GLES2Interface* ResourceProvider::ContextGL() const {
2138 ContextProvider* context_provider = output_surface_->context_provider(); 2145 ContextProvider* context_provider = output_surface_->context_provider();
2139 return context_provider ? context_provider->ContextGL() : NULL; 2146 return context_provider ? context_provider->ContextGL() : NULL;
2140 } 2147 }
2141 2148
2142 class GrContext* ResourceProvider::GrContext(bool worker_context) const { 2149 class GrContext* ResourceProvider::GrContext(bool worker_context) const {
2143 ContextProvider* context_provider = 2150 ContextProvider* context_provider =
2144 worker_context ? output_surface_->worker_context_provider() 2151 worker_context ? output_surface_->worker_context_provider()
2145 : output_surface_->context_provider(); 2152 : output_surface_->context_provider();
2146 return context_provider ? context_provider->GrContext() : NULL; 2153 return context_provider ? context_provider->GrContext() : NULL;
2147 } 2154 }
2148 2155
2149 } // namespace cc 2156 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698