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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 2043983002: gpu: Disallow null client ids in Gen* functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/build_gles2_cmd_buffer.py
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 9310f7c2f2a281079051eaf40ce640aa4195bd06..2863dd6a856d8a6ecc7dddf7369cceb27126d751 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -6186,7 +6186,7 @@ class GENnHandler(TypeHandler):
def WriteImmediateHandlerImplementation(self, func, f):
"""Overrriden from TypeHandler."""
param_name = func.GetLastOriginalArg().name
- f.write(" if (!CheckUniqueIds(n, %s) || !%sHelper(n, %s)) {\n"
+ f.write(" if (!CheckUniqueAndNonNullIds(n, %s) || !%sHelper(n, %s)) {\n"
" return error::kInvalidArguments;\n"
" }\n" %
(param_name, func.original_name, param_name))
@@ -6292,7 +6292,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
'resource_name': func.GetInfo('resource_type'),
}, *extras)
duplicate_id_test = """
-TEST_P(%(test_name)s, %(name)sDuplicateIds) {
+TEST_P(%(test_name)s, %(name)sDuplicateOrNullIds) {
EXPECT_CALL(*gl_, %(gl_func_name)s(_, _)).Times(0);
cmds::%(name)s* cmd = GetImmediateAs<cmds::%(name)s>();
GLuint temp[3] = {kNewClientId, kNewClientId + 1, kNewClientId};
@@ -6306,6 +6306,11 @@ TEST_P(%(test_name)s, %(name)sDuplicateIds) {
ExecuteImmediateCmd(*cmd, sizeof(temp)));
EXPECT_TRUE(Get%(resource_name)s(kNewClientId) == NULL);
EXPECT_TRUE(Get%(resource_name)s(kNewClientId + 1) == NULL);
+ GLuint null_id[2] = {kNewClientId, 0};
+ cmd->Init(2, null_id);
+ EXPECT_EQ(error::kInvalidArguments,
+ ExecuteImmediateCmd(*cmd, sizeof(temp)));
+ EXPECT_TRUE(Get%(resource_name)s(kNewClientId) == NULL);
}
"""
self.WriteValidUnitTest(func, f, duplicate_id_test, {
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698