http://code.google.com/chrome/nativeclient/docs/tutorial.html#messageHandler
virtual void HandleMessage(const pp::Var& var_message) {
if (!var_message.is_string()) {
return;
}
std::string message = var_message.AsString();
pp::Var var_reply;
if (message == kHelloString)
var_reply = pp::Var(kReplyString);
PostMessage(var_reply);
}
};
It's hard to see in this copy above, but the indentation is incorrect.
1 - The first 'If' is 4 spaces in instead of 2
2 - Inconsistent use if {} for single line statement in the first IF vs second
IF. Why not just 'return;' instead? The usual convention wrt {} is use it if
it's on multiple lines, otherwise use same line as if.
3 - Either their is a missing { on the second if, or here is an extra } before
the final }; Again it's hard to tell the original intention because of the 4
space on the original if.
Original issue reported on code.google.com by noelal...@google.com on 11 Aug 2011 at 6:56
Original issue reported on code.google.com by
noelal...@google.com
on 11 Aug 2011 at 6:56