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

Unified Diff: mojo/public/cpp/bindings/lib/array_internal.h

Issue 293983026: Mojo cpp bindings: remove redundant validation in Decode*(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | mojo/public/cpp/bindings/lib/array_internal.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/array_internal.h
diff --git a/mojo/public/cpp/bindings/lib/array_internal.h b/mojo/public/cpp/bindings/lib/array_internal.h
index c1cf3e47c1089cbb828d0a6ceba657d060ca2bc7..28a0a0d8d6accd24b7a4baf4c3d442260c82f373 100644
--- a/mojo/public/cpp/bindings/lib/array_internal.h
+++ b/mojo/public/cpp/bindings/lib/array_internal.h
@@ -106,10 +106,9 @@ struct ArraySerializationHelper<T, false> {
std::vector<Handle>* handles) {
}
- static bool DecodePointersAndHandles(const ArrayHeader* header,
+ static void DecodePointersAndHandles(const ArrayHeader* header,
ElementType* elements,
- Message* message) {
- return true;
+ std::vector<Handle>* handles) {
}
static bool ValidateElements(const ArrayHeader* header,
@@ -127,9 +126,9 @@ struct ArraySerializationHelper<Handle, true> {
ElementType* elements,
std::vector<Handle>* handles);
- static bool DecodePointersAndHandles(const ArrayHeader* header,
+ static void DecodePointersAndHandles(const ArrayHeader* header,
ElementType* elements,
- Message* message);
+ std::vector<Handle>* handles);
static bool ValidateElements(const ArrayHeader* header,
const ElementType* elements,
@@ -147,11 +146,11 @@ struct ArraySerializationHelper<H, true> {
header, elements, handles);
}
- static bool DecodePointersAndHandles(const ArrayHeader* header,
+ static void DecodePointersAndHandles(const ArrayHeader* header,
ElementType* elements,
- Message* message) {
- return ArraySerializationHelper<Handle, true>::DecodePointersAndHandles(
- header, elements, message);
+ std::vector<Handle>* handles) {
+ ArraySerializationHelper<Handle, true>::DecodePointersAndHandles(
+ header, elements, handles);
}
static bool ValidateElements(const ArrayHeader* header,
@@ -173,14 +172,11 @@ struct ArraySerializationHelper<P*, false> {
Encode(&elements[i], handles);
}
- static bool DecodePointersAndHandles(const ArrayHeader* header,
+ static void DecodePointersAndHandles(const ArrayHeader* header,
ElementType* elements,
- Message* message) {
- for (uint32_t i = 0; i < header->num_elements; ++i) {
- if (!Decode(&elements[i], message))
- return false;
- }
- return true;
+ std::vector<Handle>* handles) {
+ for (uint32_t i = 0; i < header->num_elements; ++i)
+ Decode(&elements[i], handles);
}
static bool ValidateElements(const ArrayHeader* header,
@@ -258,8 +254,8 @@ class Array_Data {
Helper::EncodePointersAndHandles(&header_, storage(), handles);
}
- bool DecodePointersAndHandles(Message* message) {
- return Helper::DecodePointersAndHandles(&header_, storage(), message);
+ void DecodePointersAndHandles(std::vector<Handle>* handles) {
+ Helper::DecodePointersAndHandles(&header_, storage(), handles);
}
private:
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/lib/array_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698