summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/cmd_parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/service/cmd_parser.cc')
-rw-r--r--gpu/command_buffer/service/cmd_parser.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/gpu/command_buffer/service/cmd_parser.cc b/gpu/command_buffer/service/cmd_parser.cc
index 885385b..804b894 100644
--- a/gpu/command_buffer/service/cmd_parser.cc
+++ b/gpu/command_buffer/service/cmd_parser.cc
@@ -36,27 +36,27 @@ CommandParser::CommandParser(void *shm_address,
// conditions). This function only validates the header, leaving the arguments
// validation to the handler, so it can pass a reference to them.
// - get_ is modified *after* the command has been executed.
-parse_error::ParseError CommandParser::ProcessCommand() {
+error::Error CommandParser::ProcessCommand() {
CommandBufferOffset get = get_;
- if (get == put_) return parse_error::kParseNoError;
+ if (get == put_) return error::kNoError;
CommandHeader header = buffer_[get].value_header;
if (header.size == 0) {
DLOG(INFO) << "Error: zero sized command in command buffer";
- return parse_error::kParseInvalidSize;
+ return error::kInvalidSize;
}
if (static_cast<int>(header.size) + get > entry_count_) {
DLOG(INFO) << "Error: get offset out of bounds";
- return parse_error::kParseOutOfBounds;
+ return error::kOutOfBounds;
}
- parse_error::ParseError result = handler_->DoCommand(
+ error::Error result = handler_->DoCommand(
header.command, header.size - 1, buffer_ + get);
// TODO(gman): If you want to log errors this is the best place to catch them.
// It seems like we need an official way to turn on a debug mode and
// get these errors.
- if (result != parse_error::kParseNoError) {
+ if (result != error::kNoError) {
ReportError(header.command, result);
}
get_ = (get + header.size) % entry_count_;
@@ -64,19 +64,19 @@ parse_error::ParseError CommandParser::ProcessCommand() {
}
void CommandParser::ReportError(unsigned int command_id,
- parse_error::ParseError result) {
+ error::Error result) {
DLOG(INFO) << "Error: " << result << " for Command "
<< handler_->GetCommandName(command_id);
}
// Processes all the commands, while the buffer is not empty. Stop if an error
// is encountered.
-parse_error::ParseError CommandParser::ProcessAllCommands() {
+error::Error CommandParser::ProcessAllCommands() {
while (!IsEmpty()) {
- parse_error::ParseError error = ProcessCommand();
+ error::Error error = ProcessCommand();
if (error) return error;
}
- return parse_error::kParseNoError;
+ return error::kNoError;
}
} // namespace gpu