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

Side by Side Diff: blimp/net/blimp_message_pump.h

Issue 1551583003: Implementation and fixes for Blimp client/engine E2E communication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dtrainor-linux-cl1528243002
Patch Set: Fixed misplaced EXPORT directive Created 4 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 | « blimp/net/blimp_message_output_buffer.cc ('k') | blimp/net/blimp_message_pump.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 BLIMP_NET_BLIMP_MESSAGE_PUMP_H_ 5 #ifndef BLIMP_NET_BLIMP_MESSAGE_PUMP_H_
6 #define BLIMP_NET_BLIMP_MESSAGE_PUMP_H_ 6 #define BLIMP_NET_BLIMP_MESSAGE_PUMP_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 private: 45 private:
46 // Read next packet from |reader_|. 46 // Read next packet from |reader_|.
47 void ReadNextPacket(); 47 void ReadNextPacket();
48 48
49 // Callback when next packet is ready in |buffer_|. 49 // Callback when next packet is ready in |buffer_|.
50 void OnReadPacketComplete(int result); 50 void OnReadPacketComplete(int result);
51 51
52 // Callback when |processor_| finishes processing a BlimpMessage. 52 // Callback when |processor_| finishes processing a BlimpMessage.
53 // Any values other than net::OK indicate that |processor_| has encountered an
54 // error that should be handled. Currently all errors will cause the
55 // connection to be dropped; in the future we will need to add more
56 // sophisticated error handling logic here.
57 // TODO(kmarshall): Improve error handling.
53 void OnProcessMessageComplete(int result); 58 void OnProcessMessageComplete(int result);
54 59
55 PacketReader* reader_; 60 PacketReader* reader_;
56 ConnectionErrorObserver* error_observer_ = nullptr; 61 ConnectionErrorObserver* error_observer_ = nullptr;
57 BlimpMessageProcessor* processor_ = nullptr; 62 BlimpMessageProcessor* processor_ = nullptr;
58 scoped_refptr<net::GrowableIOBuffer> buffer_; 63 scoped_refptr<net::GrowableIOBuffer> buffer_;
59 bool read_inflight_ = false; 64 bool read_inflight_ = false;
60 65
61 // Cancelled in the event that the connection is destroyed (along with 66 // Cancelled in the event that the connection is destroyed (along with
62 // |this|) while a inflight callback is held by |processor_|. 67 // |this|) while a inflight callback is held by |processor_|.
63 net::CancelableCompletionCallback process_msg_callback_; 68 net::CancelableCompletionCallback process_msg_callback_;
64 69
65 // Cancelled to guard against |this| being called back from a completed read 70 // Cancelled to guard against |this| being called back from a completed read
66 // operation. 71 // operation.
67 net::CancelableCompletionCallback read_callback_; 72 net::CancelableCompletionCallback read_callback_;
68 73
69 DISALLOW_COPY_AND_ASSIGN(BlimpMessagePump); 74 DISALLOW_COPY_AND_ASSIGN(BlimpMessagePump);
70 }; 75 };
71 76
72 } // namespace blimp 77 } // namespace blimp
73 78
74 #endif // BLIMP_NET_BLIMP_MESSAGE_PUMP_H_ 79 #endif // BLIMP_NET_BLIMP_MESSAGE_PUMP_H_
OLDNEW
« no previous file with comments | « blimp/net/blimp_message_output_buffer.cc ('k') | blimp/net/blimp_message_pump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698