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

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

Issue 473793004: Mojo C++ bindings: better log message for serialization warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/array_internal.h" 5 #include "mojo/public/cpp/bindings/lib/array_internal.h"
6 6
7 #include <sstream>
8
7 namespace mojo { 9 namespace mojo {
8 namespace internal { 10 namespace internal {
9 11
12 std::string MakeMessageWithArrayIndex(const char* message,
13 size_t size,
14 size_t index) {
15 std::ostringstream stream;
16 stream << message << ": array size - " << size << "; index - " << index;
17 return stream.str();
18 }
19
20 std::string MakeMessageWithExpectedArraySize(const char* message,
21 size_t size,
22 size_t expected_size) {
23 std::ostringstream stream;
24 stream << message << ": array size - " << size << "; expected size - "
25 << expected_size;
26 return stream.str();
27 }
28
10 ArrayDataTraits<bool>::BitRef::~BitRef() { 29 ArrayDataTraits<bool>::BitRef::~BitRef() {
11 } 30 }
12 31
13 ArrayDataTraits<bool>::BitRef::BitRef(uint8_t* storage, uint8_t mask) 32 ArrayDataTraits<bool>::BitRef::BitRef(uint8_t* storage, uint8_t mask)
14 : storage_(storage), 33 : storage_(storage),
15 mask_(mask) { 34 mask_(mask) {
16 } 35 }
17 36
18 ArrayDataTraits<bool>::BitRef& 37 ArrayDataTraits<bool>::BitRef&
19 ArrayDataTraits<bool>::BitRef::operator=(bool value) { 38 ArrayDataTraits<bool>::BitRef::operator=(bool value) {
(...skipping 27 matching lines...) Expand all
47 void ArraySerializationHelper<Handle, true>::DecodePointersAndHandles( 66 void ArraySerializationHelper<Handle, true>::DecodePointersAndHandles(
48 const ArrayHeader* header, 67 const ArrayHeader* header,
49 ElementType* elements, 68 ElementType* elements,
50 std::vector<Handle>* handles) { 69 std::vector<Handle>* handles) {
51 for (uint32_t i = 0; i < header->num_elements; ++i) 70 for (uint32_t i = 0; i < header->num_elements; ++i)
52 DecodeHandle(&elements[i], handles); 71 DecodeHandle(&elements[i], handles);
53 } 72 }
54 73
55 } // namespace internal 74 } // namespace internal
56 } // namespace mojo 75 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_internal.h ('k') | mojo/public/cpp/bindings/lib/array_serialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698