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

Unified Diff: net/quic/quic_spdy_compressor.cc

Issue 185203003: Killing off QUICv12, including cleaning out all of the code for handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Deleted unused StripUint32 Created 6 years, 10 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/quic/quic_spdy_compressor.h ('k') | net/quic/quic_spdy_compressor_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_spdy_compressor.cc
diff --git a/net/quic/quic_spdy_compressor.cc b/net/quic/quic_spdy_compressor.cc
deleted file mode 100644
index fe4834b3b837b0329c56bdf7b3a288fc6c5d6c5e..0000000000000000000000000000000000000000
--- a/net/quic/quic_spdy_compressor.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// 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.
-
-#include "net/quic/quic_spdy_compressor.h"
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-
-using std::string;
-
-namespace net {
-
-QuicSpdyCompressor::QuicSpdyCompressor()
- : spdy_framer_(SPDY3),
- header_sequence_id_(1) {
- spdy_framer_.set_enable_compression(true);
-}
-
-QuicSpdyCompressor::~QuicSpdyCompressor() {
-}
-
-string QuicSpdyCompressor::CompressHeadersWithPriority(
- QuicPriority priority,
- const SpdyHeaderBlock& headers) {
- return CompressHeadersInternal(priority, headers, true);
-}
-
-string QuicSpdyCompressor::CompressHeaders(
- const SpdyHeaderBlock& headers) {
- // CompressHeadersInternal ignores priority when write_priority is false.
- return CompressHeadersInternal(0 /* ignored */, headers, false);
-}
-
-string QuicSpdyCompressor::CompressHeadersInternal(
- QuicPriority priority,
- const SpdyHeaderBlock& headers,
- bool write_priority) {
- // TODO(rch): Modify the SpdyFramer to expose a
- // CreateCompressedHeaderBlock method, or some such.
- SpdyStreamId stream_id = 3; // unused.
-
- SpdyHeadersIR headers_ir(stream_id);
- headers_ir.set_name_value_block(headers);
- scoped_ptr<SpdyFrame> frame(spdy_framer_.SerializeHeaders(headers_ir));
-
- // The size of the spdy HEADER frame's fixed prefix which
- // needs to be stripped off from the resulting frame.
- const size_t header_frame_prefix_len = 12;
- string serialized = string(frame->data() + header_frame_prefix_len,
- frame->size() - header_frame_prefix_len);
- uint32 serialized_len = serialized.length();
- char priority_str[sizeof(priority)];
- memcpy(&priority_str, &priority, sizeof(priority));
- char id_str[sizeof(header_sequence_id_)];
- memcpy(&id_str, &header_sequence_id_, sizeof(header_sequence_id_));
- char len_str[sizeof(serialized_len)];
- memcpy(&len_str, &serialized_len, sizeof(serialized_len));
- string compressed;
- int priority_len = write_priority ? arraysize(priority_str) : 0;
- compressed.reserve(
- priority_len + arraysize(id_str) + arraysize(len_str) + serialized_len);
- if (write_priority) {
- compressed.append(priority_str, arraysize(priority_str));
- }
- compressed.append(id_str, arraysize(id_str));
- compressed.append(len_str, arraysize(len_str));
- compressed.append(serialized);
- ++header_sequence_id_;
- return compressed;
-}
-
-} // namespace net
« no previous file with comments | « net/quic/quic_spdy_compressor.h ('k') | net/quic/quic_spdy_compressor_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698