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

Side by Side Diff: net/spdy/buffered_spdy_framer.cc

Issue 10874087: Merge 151720 - net: workaround compression leaks (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/buffered_spdy_framer.h ('k') | net/spdy/spdy_framer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/buffered_spdy_framer.h" 5 #include "net/spdy/buffered_spdy_framer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace { 9 namespace {
10 10
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 246
247 SpdyPriority BufferedSpdyFramer::GetHighestPriority() const { 247 SpdyPriority BufferedSpdyFramer::GetHighestPriority() const {
248 return spdy_framer_.GetHighestPriority(); 248 return spdy_framer_.GetHighestPriority();
249 } 249 }
250 250
251 bool BufferedSpdyFramer::IsCompressible(const SpdyFrame& frame) const { 251 bool BufferedSpdyFramer::IsCompressible(const SpdyFrame& frame) const {
252 return spdy_framer_.IsCompressible(frame); 252 return spdy_framer_.IsCompressible(frame);
253 } 253 }
254 254
255 SpdyControlFrame* BufferedSpdyFramer::CompressControlFrame(
256 const SpdyControlFrame& frame) {
257 return spdy_framer_.CompressControlFrame(frame);
258 }
259
260 // static 255 // static
261 void BufferedSpdyFramer::set_enable_compression_default(bool value) { 256 void BufferedSpdyFramer::set_enable_compression_default(bool value) {
262 g_enable_compression_default = value; 257 g_enable_compression_default = value;
263 } 258 }
264 259
265 void BufferedSpdyFramer::InitHeaderStreaming(const SpdyControlFrame* frame) { 260 void BufferedSpdyFramer::InitHeaderStreaming(const SpdyControlFrame* frame) {
266 memset(header_buffer_, 0, kHeaderBufferSize); 261 memset(header_buffer_, 0, kHeaderBufferSize);
267 header_buffer_used_ = 0; 262 header_buffer_used_ = 0;
268 header_buffer_valid_ = true; 263 header_buffer_valid_ = true;
269 header_stream_id_ = SpdyFramer::GetControlFrameStreamId(frame); 264 header_stream_id_ = SpdyFramer::GetControlFrameStreamId(frame);
(...skipping 13 matching lines...) Expand all
283 default: 278 default:
284 DCHECK(false); // Error! 279 DCHECK(false); // Error!
285 break; 280 break;
286 } 281 }
287 control_frame_.reset(new SpdyFrame(frame_size_without_header_block)); 282 control_frame_.reset(new SpdyFrame(frame_size_without_header_block));
288 memcpy(control_frame_.get()->data(), frame->data(), 283 memcpy(control_frame_.get()->data(), frame->data(),
289 frame_size_without_header_block); 284 frame_size_without_header_block);
290 } 285 }
291 286
292 } // namespace net 287 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/buffered_spdy_framer.h ('k') | net/spdy/spdy_framer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698