netty5/codec-http/src/main/java/io/netty/handler/codec/spdy
Trustin Lee 81e2db10fa ByteBufAllocator API w/ ByteBuf perf improvements
This commit introduces a new API for ByteBuf allocation which fixes
issue #643 along with refactoring of ByteBuf for simplicity and better
performance. (see #62)

A user can configure the ByteBufAllocator of a Channel via
ChannelOption.ALLOCATOR or ChannelConfig.get/setAllocator().  The
default allocator is currently UnpooledByteBufAllocator.HEAP_BY_DEFAULT.

To allocate a buffer, do not use Unpooled anymore. do the following:

  ctx.alloc().buffer(...); // allocator chooses the buffer type.
  ctx.alloc().heapBuffer(...);
  ctx.alloc().directBuffer(...);

To deallocate a buffer, use the unsafe free() operation:

  ((UnsafeByteBuf) buf).free();

The following is the list of the relevant changes:

- Add ChannelInboundHandler.freeInboundBuffer() and
  ChannelOutboundHandler.freeOutboundBuffer() to let a user free the
  buffer he or she allocated. ChannelHandler adapter classes implement
  is already, so most users won't need to call free() by themselves.
  freeIn/OutboundBuffer() methods are invoked when a Channel is closed
  and deregistered.

- All ByteBuf by contract must implement UnsafeByteBuf. To access an
  unsafe operation: ((UnsafeByteBuf) buf).internalNioBuffer()

- Replace WrappedByteBuf and ByteBuf.Unsafe with UnsafeByteBuf to
  simplify overall class hierarchy and to avoid unnecesary instantiation
  of Unsafe instances on an unsafe operation.

- Remove buffer reference counting which is confusing

- Instantiate SwappedByteBuf lazily to avoid instantiation cost

- Rename ChannelFutureFactory to ChannelPropertyAccess and move common
  methods between Channel and ChannelHandlerContext there. Also made it
  package-private to hide it from a user.

- Remove unused unsafe operations such as newBuffer()

- Add DetectionUtil.canFreeDirectBuffer() so that an allocator decides
  which buffer type to use safely
2012-11-22 15:10:59 +09:00
..
DefaultSpdyDataFrame.java SPDY: remove deprecated data compressed flag 2012-08-14 17:58:22 -07:00
DefaultSpdyGoAwayFrame.java ID -> Id (#393 Ensure all fields follow our naming convention) 2012-06-12 20:29:06 +09:00
DefaultSpdyHeaderBlock.java Update license headers 2012-06-04 13:31:44 -07:00
DefaultSpdyHeadersFrame.java StreamID -> StreamId (#393 Ensure all fields follow naming convention) 2012-06-12 21:06:45 +09:00
DefaultSpdyNoOpFrame.java Remove redundant no-arg constructors 2012-11-10 01:08:18 +09:00
DefaultSpdyPingFrame.java ID -> Id (#393 Ensure all fields follow our naming convention) 2012-06-12 20:25:21 +09:00
DefaultSpdyRstStreamFrame.java StreamID -> StreamId (#393 Ensure all fields follow naming convention) 2012-06-12 21:06:45 +09:00
DefaultSpdySettingsFrame.java Fix parameter namings + some more 2012-11-12 12:59:37 +09:00
DefaultSpdySynReplyFrame.java StreamID -> StreamId (#393 Ensure all fields follow naming convention) 2012-06-12 21:06:45 +09:00
DefaultSpdySynStreamFrame.java ID -> Id (#393 Ensure all fields follow our naming convention) 2012-06-12 20:20:24 +09:00
DefaultSpdyWindowUpdateFrame.java StreamID -> StreamId (#393 Ensure all fields follow naming convention) 2012-06-12 21:06:45 +09:00
package-info.java Update license headers 2012-06-04 13:31:44 -07:00
SpdyCodecUtil.java Fix parameter namings + some more 2012-11-12 12:59:37 +09:00
SpdyConstants.java Fix more checkstyle errors 2012-06-07 09:19:14 +09:00
SpdyControlFrame.java SPDY: introduce SpdyControlFrame tag interface 2012-08-14 18:00:39 -07:00
SpdyDataFrame.java SPDY: remove deprecated data compressed flag 2012-08-14 17:58:22 -07:00
SpdyFrameCodec.java Fix checkstyle errors 2012-06-07 22:01:59 +09:00
SpdyFrameDecoder.java [#755] SPDY: fix header block values truncation in decompression 2012-11-20 20:09:59 +01:00
SpdyFrameEncoder.java Fix more inspection warnings + compilation errors 2012-11-12 13:25:00 +09:00
SpdyGoAwayFrame.java SPDY: introduce SpdyControlFrame tag interface 2012-08-14 18:00:39 -07:00
SpdyHeaderBlock.java Update license headers 2012-06-04 13:31:44 -07:00
SpdyHeaderBlockCompressor.java Rename ChannelBuffer to ByteBuf as discussed before 2012-06-10 11:08:43 +09:00
SpdyHeaderBlockDecompressor.java [#755] SPDY: fix header block values truncation in decompression 2012-11-20 20:09:59 +01:00
SpdyHeaderBlockJZlibCompressor.java Rename ChannelBuffer to ByteBuf as discussed before 2012-06-10 11:08:43 +09:00
SpdyHeaderBlockZlibCompressor.java Rename ChannelBuffer to ByteBuf as discussed before 2012-06-10 11:08:43 +09:00
SpdyHeaderBlockZlibDecompressor.java [#755] SPDY: fix header block values truncation in decompression 2012-11-20 20:09:59 +01:00
SpdyHeaders.java SPDY: remove deprecated methods 2012-11-17 19:30:42 +01:00
SpdyHeadersFrame.java SPDY: introduce SpdyControlFrame tag interface 2012-08-14 18:00:39 -07:00
SpdyHttpCodec.java Add back Channel(Inbound|Outbound)(Message|Stream)HandlerAdapter 2012-06-07 17:49:45 +09:00
SpdyHttpDecoder.java Fix visibility warnings from the inspector. 2012-11-12 14:03:43 +09:00
SpdyHttpEncoder.java Use supertype HttpObject instead of HttpMessage + HttpChunk where possible 2012-09-28 14:00:07 +09:00
SpdyHttpHeaders.java Fix SpdyHttpHeaders.setScheme setting the wrong header. See #417 2012-06-28 13:36:21 +02:00
SpdyHttpResponseStreamIdHandler.java Fix more inspection warnings + compilation errors 2012-11-12 13:25:00 +09:00
SpdyNoOpFrame.java SPDY: introduce SpdyControlFrame tag interface 2012-08-14 18:00:39 -07:00
SpdyOrHttpChooser.java ByteBufAllocator API w/ ByteBuf perf improvements 2012-11-22 15:10:59 +09:00
SpdyPingFrame.java SPDY: introduce SpdyControlFrame tag interface 2012-08-14 18:00:39 -07:00
SpdyProtocolException.java Code clean-up based on IntelliJ code analysis 2012-06-11 22:54:28 +09:00
SpdyRstStreamFrame.java SPDY: introduce SpdyControlFrame tag interface 2012-08-14 18:00:39 -07:00
SpdySession.java Fix visibility warnings from the inspector. 2012-11-12 14:03:43 +09:00
SpdySessionHandler.java ByteBufAllocator API w/ ByteBuf perf improvements 2012-11-22 15:10:59 +09:00
SpdySessionStatus.java SPDY: fixed session status (internal error misdocumented) 2012-11-17 19:30:42 +01:00
SpdySettingsFrame.java SPDY: introduce SpdyControlFrame tag interface 2012-08-14 18:00:39 -07:00
SpdyStreamStatus.java Update license headers 2012-06-04 13:31:44 -07:00
SpdySynReplyFrame.java SPDY: introduce SpdyControlFrame tag interface 2012-08-14 18:00:39 -07:00
SpdySynStreamFrame.java SPDY: introduce SpdyControlFrame tag interface 2012-08-14 18:00:39 -07:00
SpdyWindowUpdateFrame.java SPDY: introduce SpdyControlFrame tag interface 2012-08-14 18:00:39 -07:00