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

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

Issue 921223002: Cpp bindings: Return false from Validator::Accept() on unrecognized message or invalid flags (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fixes spelling error. Created 5 years, 9 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/public/cpp/bindings/lib/validation_errors.h" 5 #include "mojo/public/cpp/bindings/lib/validation_errors.h"
6 6
7 #include "mojo/public/cpp/environment/logging.h" 7 #include "mojo/public/cpp/environment/logging.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 namespace internal { 10 namespace internal {
(...skipping 22 matching lines...) Expand all
33 case VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE: 33 case VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE:
34 return "VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE"; 34 return "VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE";
35 case VALIDATION_ERROR_ILLEGAL_POINTER: 35 case VALIDATION_ERROR_ILLEGAL_POINTER:
36 return "VALIDATION_ERROR_ILLEGAL_POINTER"; 36 return "VALIDATION_ERROR_ILLEGAL_POINTER";
37 case VALIDATION_ERROR_UNEXPECTED_NULL_POINTER: 37 case VALIDATION_ERROR_UNEXPECTED_NULL_POINTER:
38 return "VALIDATION_ERROR_UNEXPECTED_NULL_POINTER"; 38 return "VALIDATION_ERROR_UNEXPECTED_NULL_POINTER";
39 case VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION: 39 case VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION:
40 return "VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION"; 40 return "VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION";
41 case VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID: 41 case VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID:
42 return "VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID"; 42 return "VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID";
43 case VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD:
yzshen1 2015/03/03 18:05:37 Please use the exact same order as the enum defini
rudominer 2015/03/04 00:12:01 Done.
44 return "VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD";
43 case VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP: 45 case VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP:
44 return "VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP"; 46 return "VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP";
45 case VALIDATION_ERROR_UNKOWN_UNION_TAG: 47 case VALIDATION_ERROR_UNKOWN_UNION_TAG:
46 return "VALIDATION_ERROR_UNKOWN_UNION_TAG"; 48 return "VALIDATION_ERROR_UNKOWN_UNION_TAG";
47 } 49 }
48 50
49 return "Unknown error"; 51 return "Unknown error";
50 } 52 }
51 53
52 void ReportValidationError(ValidationError error, const char* description) { 54 void ReportValidationError(ValidationError error, const char* description) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 89 }
88 90
89 SerializationWarningObserverForTesting:: 91 SerializationWarningObserverForTesting::
90 ~SerializationWarningObserverForTesting() { 92 ~SerializationWarningObserverForTesting() {
91 MOJO_DCHECK(g_serialization_warning_observer == this); 93 MOJO_DCHECK(g_serialization_warning_observer == this);
92 g_serialization_warning_observer = nullptr; 94 g_serialization_warning_observer = nullptr;
93 } 95 }
94 96
95 } // namespace internal 97 } // namespace internal
96 } // namespace mojo 98 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698