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

Side by Side Diff: mojo/public/cpp/bindings/lib/message_validation.cc

Issue 1412733002: C++ bindings: separate out serialization source set, have "mojom" targets optionally use serializat… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: address comments from previous patch Created 5 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/public/cpp/bindings/lib/message_validation.h"
6
7 #include "mojo/public/cpp/bindings/lib/validation_errors.h"
8 #include "mojo/public/cpp/bindings/message.h"
9
10 namespace mojo {
11 namespace internal {
12
13 bool ValidateMessageIsRequestWithoutResponse(const Message* message) {
14 if (message->has_flag(kMessageIsResponse) ||
15 message->has_flag(kMessageExpectsResponse)) {
16 ReportValidationError(VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS);
17 return false;
18 }
19 return true;
20 }
21
22 bool ValidateMessageIsRequestExpectingResponse(const Message* message) {
23 if (message->has_flag(kMessageIsResponse) ||
24 !message->has_flag(kMessageExpectsResponse)) {
25 ReportValidationError(VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS);
26 return false;
27 }
28 return true;
29 }
30
31 bool ValidateMessageIsResponse(const Message* message) {
32 if (message->has_flag(kMessageExpectsResponse) ||
33 !message->has_flag(kMessageIsResponse)) {
34 ReportValidationError(VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS);
35 return false;
36 }
37 return true;
38 }
39
40 } // namespace internal
41 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/message_validation.h ('k') | mojo/public/cpp/bindings/lib/validation_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698