| Index: gpu/command_buffer/service/cmd_parser.cc
|
| ===================================================================
|
| --- gpu/command_buffer/service/cmd_parser.cc (revision 37750)
|
| +++ gpu/command_buffer/service/cmd_parser.cc (working copy)
|
| @@ -36,27 +36,27 @@
|
| // 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 @@
|
| }
|
|
|
| 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
|
|
|