OLD | NEW |
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 "extensions/browser/api/cast_channel/cast_framer.h" | 5 #include "extensions/browser/api/cast_channel/cast_framer.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
| 11 #include "base/memory/free_deleter.h" |
11 #include "base/numerics/safe_conversions.h" | 12 #include "base/numerics/safe_conversions.h" |
12 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
13 #include "base/sys_byteorder.h" | 14 #include "base/sys_byteorder.h" |
14 #include "extensions/common/api/cast_channel/cast_channel.pb.h" | 15 #include "extensions/common/api/cast_channel/cast_channel.pb.h" |
15 | 16 |
16 namespace extensions { | 17 namespace extensions { |
17 namespace api { | 18 namespace api { |
18 namespace cast_channel { | 19 namespace cast_channel { |
19 MessageFramer::MessageFramer(scoped_refptr<net::GrowableIOBuffer> input_buffer) | 20 MessageFramer::MessageFramer(scoped_refptr<net::GrowableIOBuffer> input_buffer) |
20 : input_buffer_(input_buffer), error_(false) { | 21 : input_buffer_(input_buffer), error_(false) { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 void MessageFramer::Reset() { | 173 void MessageFramer::Reset() { |
173 current_element_ = HEADER; | 174 current_element_ = HEADER; |
174 message_bytes_received_ = 0; | 175 message_bytes_received_ = 0; |
175 body_size_ = 0; | 176 body_size_ = 0; |
176 input_buffer_->set_offset(0); | 177 input_buffer_->set_offset(0); |
177 } | 178 } |
178 | 179 |
179 } // namespace cast_channel | 180 } // namespace cast_channel |
180 } // namespace api | 181 } // namespace api |
181 } // namespace extensions | 182 } // namespace extensions |
OLD | NEW |