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

Unified Diff: gpu/command_buffer/service/cmd_parser.cc

Issue 2275203002: Make command buffer commands and immediate data volatile (Closed)
Patch Set: std::copy->const_cast+memcpy Created 4 years, 3 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 | « gpu/command_buffer/service/cmd_parser.h ('k') | gpu/command_buffer/service/common_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/cmd_parser.cc
diff --git a/gpu/command_buffer/service/cmd_parser.cc b/gpu/command_buffer/service/cmd_parser.cc
index 3c4c39e6d18a853c47cf900dc1ad42b72facd7b7..2178cd5ba8b16a60aa609ef9d1f85c8f24d43ed4 100644
--- a/gpu/command_buffer/service/cmd_parser.cc
+++ b/gpu/command_buffer/service/cmd_parser.cc
@@ -76,18 +76,18 @@ error::Error CommandParser::ProcessAllCommands() {
// changed by a (malicious) client at any time, so if validation has to happen,
// it should operate on a copy of them.
error::Error AsyncAPIInterface::DoCommands(unsigned int num_commands,
- const void* buffer,
+ const volatile void* buffer,
int num_entries,
int* entries_processed) {
int commands_to_process = num_commands;
error::Error result = error::kNoError;
- const CommandBufferEntry* cmd_data =
- static_cast<const CommandBufferEntry*>(buffer);
+ const volatile CommandBufferEntry* cmd_data =
+ static_cast<const volatile CommandBufferEntry*>(buffer);
int process_pos = 0;
while (process_pos < num_entries && result == error::kNoError &&
commands_to_process--) {
- CommandHeader header = cmd_data->value_header;
+ CommandHeader header = CommandHeader::FromVolatile(cmd_data->value_header);
if (header.size == 0) {
DVLOG(1) << "Error: zero sized command in command buffer";
return error::kInvalidSize;
« no previous file with comments | « gpu/command_buffer/service/cmd_parser.h ('k') | gpu/command_buffer/service/common_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698