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

Side by Side Diff: remoting/protocol/message_decoder.h

Issue 810133003: replace NULL->nullptr in src/remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/protocol/libjingle_transport_factory.cc ('k') | remoting/protocol/message_decoder.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef REMOTING_PROTOCOL_MESSAGE_DECODER_H_ 5 #ifndef REMOTING_PROTOCOL_MESSAGE_DECODER_H_
6 #define REMOTING_PROTOCOL_MESSAGE_DECODER_H_ 6 #define REMOTING_PROTOCOL_MESSAGE_DECODER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <list> 9 #include <list>
10 10
(...skipping 22 matching lines...) Expand all
33 class MessageDecoder { 33 class MessageDecoder {
34 public: 34 public:
35 MessageDecoder(); 35 MessageDecoder();
36 virtual ~MessageDecoder(); 36 virtual ~MessageDecoder();
37 37
38 // Add next chunk of data. MessageDecoder retains |data| until all 38 // Add next chunk of data. MessageDecoder retains |data| until all
39 // its bytes are consumed. 39 // its bytes are consumed.
40 void AddData(scoped_refptr<net::IOBuffer> data, int data_size); 40 void AddData(scoped_refptr<net::IOBuffer> data, int data_size);
41 41
42 // Returns next message from the stream. Ownership of the result is 42 // Returns next message from the stream. Ownership of the result is
43 // passed to the caller. Returns NULL if there are no complete 43 // passed to the caller. Returns nullptr if there are no complete
44 // messages yet, otherwise returns a buffer that contains one 44 // messages yet, otherwise returns a buffer that contains one
45 // message. 45 // message.
46 CompoundBuffer* GetNextMessage(); 46 CompoundBuffer* GetNextMessage();
47 47
48 private: 48 private:
49 // Retrieves the read payload size of the current protocol buffer via |size|. 49 // Retrieves the read payload size of the current protocol buffer via |size|.
50 // Returns false and leaves |size| unmodified, if we do not have enough data 50 // Returns false and leaves |size| unmodified, if we do not have enough data
51 // to retrieve the current size. 51 // to retrieve the current size.
52 bool GetPayloadSize(int* size); 52 bool GetPayloadSize(int* size);
53 53
54 CompoundBuffer buffer_; 54 CompoundBuffer buffer_;
55 55
56 // |next_payload_| stores the size of the next payload if known. 56 // |next_payload_| stores the size of the next payload if known.
57 // |next_payload_known_| is true if the size of the next payload is known. 57 // |next_payload_known_| is true if the size of the next payload is known.
58 // After one payload is read this is reset to false. 58 // After one payload is read this is reset to false.
59 int next_payload_; 59 int next_payload_;
60 bool next_payload_known_; 60 bool next_payload_known_;
61 }; 61 };
62 62
63 } // namespace protocol 63 } // namespace protocol
64 } // namespace remoting 64 } // namespace remoting
65 65
66 #endif // REMOTING_PROTOCOL_MESSAGE_DECODER_H_ 66 #endif // REMOTING_PROTOCOL_MESSAGE_DECODER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/libjingle_transport_factory.cc ('k') | remoting/protocol/message_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698