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

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: Address further 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 44%
copy from net/quic/quic_default_packet_writer.h
copy to net/quic/quic_connection_packet_writer_wrapper.h
index ed3b5975cee5edb964ad0466c12eb993deda238e..4354f86d17dcb9121fdd73a584d242202056ec85 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,22 @@
#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"
wtc 2014/06/20 21:40:48 Delete this header. This file is not using UDPServ
dmziegler 2014/06/23 18:31:23 Done.
namespace net {
-struct WriteResult;
+class QuicBlockedWriterInterface;
wtc 2014/06/20 21:40:48 Delete this unused forward declaration.
dmziegler 2014/06/23 18:31:23 Done.
+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.
+// TODO(dmz) Try to merge with Chrome's default packet writer
+class QuicConnectionPacketWriterWrapper : public QuicPacketWriter {
wtc 2014/06/20 21:40:48 Why isn't this class named QuicServerPacketWriterW
dmziegler 2014/06/23 18:31:23 I've renamed to QuicPerConnectionPacketWriter (and
public:
- QuicDefaultPacketWriter();
- explicit QuicDefaultPacketWriter(DatagramClientSocket* socket);
- virtual ~QuicDefaultPacketWriter();
+ QuicConnectionPacketWriterWrapper(QuicServerPacketWriter* writer,
+ QuicConnection* connection);
+ virtual ~QuicConnectionPacketWriterWrapper();
// QuicPacketWriter
virtual WriteResult WritePacket(const char* buffer,
@@ -34,25 +37,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);
wtc 2014/06/20 21:40:48 Name this parameter "result". Our Style Guide reco
dmziegler 2014/06/23 18:31:23 Done.
+
+ base::WeakPtrFactory<QuicConnectionPacketWriterWrapper> weak_factory_;
+ QuicServerPacketWriter* writer_; // Not owned.
wtc 2014/06/20 21:40:48 Our Style Guide recommends at least two spaces bef
dmziegler 2014/06/23 18:31:23 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