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

Unified Diff: net/quic/quic_connection_packet_writer_wrapper.h

Issue 340433002: Port QuicServer to Chrome network stack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Additional comments Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_connection_packet_writer_wrapper.h
diff --git a/net/quic/quic_default_packet_writer.h b/net/quic/quic_connection_packet_writer_wrapper.h
similarity index 46%
copy from net/quic/quic_default_packet_writer.h
copy to net/quic/quic_connection_packet_writer_wrapper.h
index ed3b5975cee5edb964ad0466c12eb993deda238e..747cd7a85c736ebbb0ff6df916931ba1c09bd842 100644
--- a/net/quic/quic_default_packet_writer.h
+++ b/net/quic/quic_connection_packet_writer_wrapper.h
@@ -1,9 +1,9 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
-#define NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
+#ifndef NET_QUIC_QUIC_CONNECTION_PACKET_WRITER_WRAPPER_H_
+#define NET_QUIC_QUIC_CONNECTION_PACKET_WRITER_WRAPPER_H_
#include "base/basictypes.h"
#include "base/memory/weak_ptr.h"
@@ -11,19 +11,21 @@
#include "net/quic/quic_connection.h"
#include "net/quic/quic_packet_writer.h"
#include "net/quic/quic_protocol.h"
-#include "net/udp/datagram_client_socket.h"
+#include "net/quic/quic_types.h"
+#include "net/udp/udp_server_socket.h"
namespace net {
-struct WriteResult;
+class QuicBlockedWriterInterface;
+class QuicServerPacketWriter;
-// Chrome specific packet writer which uses a DatagramClientSocket for writing
-// data.
-class NET_EXPORT_PRIVATE QuicDefaultPacketWriter : public QuicPacketWriter {
+// A wrapper packet writer that notifies a particular connection after its
+// writes to the shared server packet writer finish.
+class QuicConnectionPacketWriterWrapper : public QuicPacketWriter {
Ryan Hamilton 2014/06/19 19:21:29 It's worth thinking about how we could potentially
dmz 2014/06/19 20:06:28 Done.
public:
- QuicDefaultPacketWriter();
- explicit QuicDefaultPacketWriter(DatagramClientSocket* socket);
- virtual ~QuicDefaultPacketWriter();
+ QuicConnectionPacketWriterWrapper(QuicServerPacketWriter* writer,
+ QuicConnection* connection);
+ virtual ~QuicConnectionPacketWriterWrapper();
// QuicPacketWriter
virtual WriteResult WritePacket(const char* buffer,
@@ -34,25 +36,16 @@ class NET_EXPORT_PRIVATE QuicDefaultPacketWriter : public QuicPacketWriter {
virtual bool IsWriteBlocked() const OVERRIDE;
virtual void SetWritable() OVERRIDE;
- void OnWriteComplete(int rv);
- void SetConnection(QuicConnection* connection) {
- connection_ = connection;
- }
-
- protected:
- void set_write_blocked(bool is_blocked) {
- write_blocked_ = is_blocked;
- }
-
private:
- base::WeakPtrFactory<QuicDefaultPacketWriter> weak_factory_;
- DatagramClientSocket* socket_;
+ void OnWriteComplete(WriteResult wr);
+
+ base::WeakPtrFactory<QuicConnectionPacketWriterWrapper> weak_factory_;
+ QuicServerPacketWriter* writer_;
Ryan Hamilton 2014/06/19 19:21:29 Please add a comment that this is not owned.
dmz 2014/06/19 20:06:28 Done.
QuicConnection* connection_;
- bool write_blocked_;
- DISALLOW_COPY_AND_ASSIGN(QuicDefaultPacketWriter);
+ DISALLOW_COPY_AND_ASSIGN(QuicConnectionPacketWriterWrapper);
};
} // namespace net
-#endif // NET_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
+#endif // NET_QUIC_QUIC_CONNECTION_PACKET_WRITER_WRAPPER_H_

Powered by Google App Engine
This is Rietveld 408576698