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

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

Issue 1429193002: Add interfaces for most major Blimp net components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address wez's feedback. Created 5 years, 1 month 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BLIMP_NET_BLIMP_MESSAGE_OUTPUT_BUFFER_H_
6 #define BLIMP_NET_BLIMP_MESSAGE_OUTPUT_BUFFER_H_
7
8 #include "base/macros.h"
9 #include "blimp/net/blimp_message_checkpoint_observer.h"
10 #include "blimp/net/blimp_message_processor.h"
11 #include "blimp/net/blimp_net_export.h"
12
13 namespace blimp {
14
15 class BlimpConnection;
16
17 // Provides a FIFO buffer for reliable, ordered message delivery.
18 // Messages are retained for redelivery until they are acknowledged by the
19 // receiving end (via BlimpMessageAckObserver).
20 // (Redelivery will be used in a future CL to implement Fast Recovery
21 // of dropped connections.)
22 class BLIMP_NET_EXPORT BlimpMessageOutputBuffer
23 : public BlimpMessageProcessor,
24 public BlimpMessageCheckpointObserver {
25 public:
26 BlimpMessageOutputBuffer();
27 ~BlimpMessageOutputBuffer() override;
28
29 // Sets the processor to receive messages from this buffer.
30 void set_outgoing_message_processor(BlimpMessageProcessor* processor) {
31 NOTIMPLEMENTED();
Wez 2015/11/12 03:45:57 Simple setter is no good if it's not simple. Let's
Kevin M 2015/11/12 19:03:47 Done.
32 }
33
34 // BlimpMessageProcessor implementation.
35 // |callback|, if set, will be called once the remote end has acknowledged the
36 // receipt of |message|.
37 void ProcessMessage(const BlimpMessage& message,
38 const net::CompletionCallback& callback) override;
39
40 // MessageCheckpointObserver implementation.
41 // Flushes acknowledged messages from the buffer and invokes their
42 // |callbacks|, if any.
43 // Callbacks should not destroy |this| so as to not interfere with the
44 // processing of any other pending callbacks.
45 void OnMessageCheckpoint(int64 message_id) override;
46
47 private:
48 DISALLOW_COPY_AND_ASSIGN(BlimpMessageOutputBuffer);
49 };
50
51 } // namespace blimp
52
53 #endif // BLIMP_NET_BLIMP_MESSAGE_OUTPUT_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698