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

Unified Diff: net/spdy/spdy_frame_producer.h

Issue 13009012: [SPDY] Refactor SpdySession's write queue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix use-after-free (crbug.com/230259) Created 7 years, 8 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
« no previous file with comments | « net/net.gyp ('k') | net/spdy/spdy_frame_producer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_frame_producer.h
diff --git a/net/spdy/spdy_frame_producer.h b/net/spdy/spdy_frame_producer.h
new file mode 100644
index 0000000000000000000000000000000000000000..9db20cefdc52971f398866092b8e057e6df24505
--- /dev/null
+++ b/net/spdy/spdy_frame_producer.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2013 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_SPDY_SPDY_FRAME_PRODUCER_H_
+#define NET_SPDY_SPDY_FRAME_PRODUCER_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "net/base/net_export.h"
+
+namespace net {
+
+class SpdyFrame;
+
+// An object which provides a SpdyFrame for writing. We pass these
+// around instead of SpdyFrames since some frames have to be generated
+// "just in time".
+class NET_EXPORT_PRIVATE SpdyFrameProducer {
+ public:
+ SpdyFrameProducer();
+
+ // Produces the frame to be written. Will be called at most once.
+ virtual scoped_ptr<SpdyFrame> ProduceFrame() = 0;
+
+ virtual ~SpdyFrameProducer();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SpdyFrameProducer);
+};
+
+// A simple wrapper around a single SpdyFrame.
+class NET_EXPORT_PRIVATE SimpleFrameProducer : public SpdyFrameProducer {
+ public:
+ explicit SimpleFrameProducer(scoped_ptr<SpdyFrame> frame);
+
+ virtual ~SimpleFrameProducer();
+
+ virtual scoped_ptr<SpdyFrame> ProduceFrame() OVERRIDE;
+
+ private:
+ scoped_ptr<SpdyFrame> frame_;
+
+ DISALLOW_COPY_AND_ASSIGN(SimpleFrameProducer);
+};
+
+} // namespace net
+
+#endif // NET_SPDY_SPDY_FRAME_PRODUCER_H_
« no previous file with comments | « net/net.gyp ('k') | net/spdy/spdy_frame_producer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698