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

Side by Side Diff: remoting/base/protocol_decoder.cc

Issue 3161034: Rename (Host|Client)Message to Chromoting(Host|Client)Message. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Fix merge conflicts Created 10 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
« no previous file with comments | « remoting/base/protocol_decoder.h ('k') | remoting/base/protocol_decoder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "remoting/base/protocol_decoder.h" 5 #include "remoting/base/protocol_decoder.h"
6 6
7 #include "remoting/base/multiple_array_input_stream.h" 7 #include "remoting/base/multiple_array_input_stream.h"
8 #include "talk/base/byteorder.h" 8 #include "talk/base/byteorder.h"
9 9
10 namespace remoting { 10 namespace remoting {
11 11
12 ProtocolDecoder::ProtocolDecoder() 12 ProtocolDecoder::ProtocolDecoder()
13 : last_read_position_(0), 13 : last_read_position_(0),
14 available_bytes_(0), 14 available_bytes_(0),
15 next_payload_(0), 15 next_payload_(0),
16 next_payload_known_(false) { 16 next_payload_known_(false) {
17 } 17 }
18 18
19 void ProtocolDecoder::ParseClientMessages(scoped_refptr<media::DataBuffer> data, 19 void ProtocolDecoder::ParseClientMessages(scoped_refptr<media::DataBuffer> data,
20 ClientMessageList* messages) { 20 ClientMessageList* messages) {
21 ParseMessages<ClientMessage>(data, messages); 21 ParseMessages<ChromotingClientMessage>(data, messages);
22 } 22 }
23 23
24 void ProtocolDecoder::ParseHostMessages(scoped_refptr<media::DataBuffer> data, 24 void ProtocolDecoder::ParseHostMessages(scoped_refptr<media::DataBuffer> data,
25 HostMessageList* messages) { 25 HostMessageList* messages) {
26 ParseMessages<HostMessage>(data, messages); 26 ParseMessages<ChromotingHostMessage>(data, messages);
27 } 27 }
28 28
29 template <typename T> 29 template <typename T>
30 void ProtocolDecoder::ParseMessages(scoped_refptr<media::DataBuffer> data, 30 void ProtocolDecoder::ParseMessages(scoped_refptr<media::DataBuffer> data,
31 std::vector<T*>* messages) { 31 std::vector<T*>* messages) {
32 // If this is the first data in the processing queue, then set the 32 // If this is the first data in the processing queue, then set the
33 // last read position to 0. 33 // last read position to 0.
34 if (data_list_.empty()) 34 if (data_list_.empty())
35 last_read_position_ = 0; 35 last_read_position_ = 0;
36 36
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 if (header.length() == kHeaderSize) { 140 if (header.length() == kHeaderSize) {
141 *size = talk_base::GetBE32(header.c_str()); 141 *size = talk_base::GetBE32(header.c_str());
142 return true; 142 return true;
143 } 143 }
144 NOTREACHED() << "Unable to extract payload size"; 144 NOTREACHED() << "Unable to extract payload size";
145 return false; 145 return false;
146 } 146 }
147 147
148 } // namespace remoting 148 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/protocol_decoder.h ('k') | remoting/base/protocol_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698