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

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

Issue 558054: Renamed ParseError -> Error, parse_error -> error, kParseNoError -> kNoError,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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/cmd_parser_test.cc » ('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
===================================================================
--- 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
« no previous file with comments | « gpu/command_buffer/service/cmd_parser.h ('k') | gpu/command_buffer/service/cmd_parser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698