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

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

Issue 10332304: Don't depend on MessageLoopProxy in remoting protocol code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/libjingle_transport_factory.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) 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_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/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void Init(net::Socket* socket, const MessageReceivedCallback& callback); 47 void Init(net::Socket* socket, const MessageReceivedCallback& callback);
48 48
49 private: 49 private:
50 friend class base::RefCountedThreadSafe<MessageReader>; 50 friend class base::RefCountedThreadSafe<MessageReader>;
51 virtual ~MessageReader(); 51 virtual ~MessageReader();
52 52
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(scoped_refptr<base::MessageLoopProxy> message_loop); 57 void OnMessageDone(scoped_refptr<base::SingleThreadTaskRunner> task_runner);
58 void ProcessDoneEvent(); 58 void ProcessDoneEvent();
59 59
60 net::Socket* socket_; 60 net::Socket* socket_;
61 61
62 // 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
63 // OnRead() to be called when new data is received. 63 // OnRead() to be called when new data is received.
64 bool read_pending_; 64 bool read_pending_;
65 65
66 // Number of messages that we received, but haven't finished 66 // Number of messages that we received, but haven't finished
67 // 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
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 scoped_refptr<MessageReader> message_reader_; 114 scoped_refptr<MessageReader> message_reader_;
115 MessageReceivedCallback message_received_callback_; 115 MessageReceivedCallback message_received_callback_;
116 }; 116 };
117 117
118 } // namespace protocol 118 } // namespace protocol
119 } // namespace remoting 119 } // namespace remoting
120 120
121 #endif // REMOTING_PROTOCOL_MESSAGE_READER_H_ 121 #endif // REMOTING_PROTOCOL_MESSAGE_READER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/libjingle_transport_factory.cc ('k') | remoting/protocol/message_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698