OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/message_buffer.h" | 5 #include "mojo/public/cpp/bindings/lib/message_buffer.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "mojo/public/cpp/bindings/lib/serialization_util.h" | 9 #include "mojo/public/cpp/bindings/lib/serialization_util.h" |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 if (new_bytes_claimed > data_num_bytes_) { | 54 if (new_bytes_claimed > data_num_bytes_) { |
55 NOTREACHED(); | 55 NOTREACHED(); |
56 return nullptr; | 56 return nullptr; |
57 } | 57 } |
58 | 58 |
59 char* start = static_cast<char*>(buffer_) + bytes_claimed_; | 59 char* start = static_cast<char*>(buffer_) + bytes_claimed_; |
60 bytes_claimed_ = new_bytes_claimed; | 60 bytes_claimed_ = new_bytes_claimed; |
61 return static_cast<void*>(start); | 61 return static_cast<void*>(start); |
62 } | 62 } |
63 | 63 |
| 64 void MessageBuffer::NotifyBadMessage(const std::string& error) { |
| 65 DCHECK(message_.is_valid()); |
| 66 MojoResult result = mojo::NotifyBadMessage(message_.get(), error); |
| 67 DCHECK_EQ(result, MOJO_RESULT_OK); |
| 68 } |
| 69 |
64 } // namespace internal | 70 } // namespace internal |
65 } // namespace mojo | 71 } // namespace mojo |
OLD | NEW |