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

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

Issue 7633009: Use MessageLoopProxy for network message loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 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
« no previous file with comments | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/protocol/message_reader.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_READER_H_ 5 #ifndef REMOTING_PROTOCOL_MESSAGE_READER_H_
6 #define REMOTING_PROTOCOL_MESSAGE_READER_H_ 6 #define REMOTING_PROTOCOL_MESSAGE_READER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 private: 52 private:
53 void DoRead(); 53 void DoRead();
54 void OnRead(int result); 54 void OnRead(int result);
55 void HandleReadResult(int result); 55 void HandleReadResult(int result);
56 void OnDataReceived(net::IOBuffer* data, int data_size); 56 void OnDataReceived(net::IOBuffer* data, int data_size);
57 void OnMessageDone(CompoundBuffer* message); 57 void OnMessageDone(CompoundBuffer* message);
58 void ProcessDoneEvent(); 58 void ProcessDoneEvent();
59 59
60 net::Socket* socket_; 60 net::Socket* socket_;
61 61
62 // The network message loop this object runs on.
63 MessageLoop* message_loop_;
64
65 // Set to true, when we have a socket read pending, and expecting 62 // Set to true, when we have a socket read pending, and expecting
66 // OnRead() to be called when new data is received. 63 // OnRead() to be called when new data is received.
67 bool read_pending_; 64 bool read_pending_;
68 65
69 // Number of messages that we received, but haven't finished 66 // Number of messages that we received, but haven't finished
70 // processing yet, i.e. |done_task| hasn't been called for these 67 // processing yet, i.e. |done_task| hasn't been called for these
71 // messages. 68 // messages.
72 int pending_messages_; 69 int pending_messages_;
73 70
74 bool closed_; 71 bool closed_;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 118 }
122 119
123 scoped_refptr<MessageReader> message_reader_; 120 scoped_refptr<MessageReader> message_reader_;
124 scoped_ptr<MessageReceivedCallback> message_received_callback_; 121 scoped_ptr<MessageReceivedCallback> message_received_callback_;
125 }; 122 };
126 123
127 } // namespace protocol 124 } // namespace protocol
128 } // namespace remoting 125 } // namespace remoting
129 126
130 #endif // REMOTING_PROTOCOL_MESSAGE_READER_H_ 127 #endif // REMOTING_PROTOCOL_MESSAGE_READER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/protocol/message_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698