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

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

Issue 11782024: Remove unused methods from SpdyFrameBuilder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments Created 7 years, 11 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/spdy_frame_builder.h ('k') | no next file » | 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 <limits> 5 #include <limits>
6 6
7 #include "net/spdy/spdy_frame_builder.h" 7 #include "net/spdy/spdy_frame_builder.h"
8 #include "net/spdy/spdy_protocol.h" 8 #include "net/spdy/spdy_protocol.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 size_t length = size - SpdyFrame::kHeaderSize; 54 size_t length = size - SpdyFrame::kHeaderSize;
55 DCHECK_EQ(0u, length & ~static_cast<size_t>(kLengthMask)); 55 DCHECK_EQ(0u, length & ~static_cast<size_t>(kLengthMask));
56 FlagsAndLength flags_length; 56 FlagsAndLength flags_length;
57 flags_length.length_ = htonl(length); 57 flags_length.length_ = htonl(length);
58 DCHECK_EQ(0, flags & ~kDataFlagsMask); 58 DCHECK_EQ(0, flags & ~kDataFlagsMask);
59 flags_length.flags_[0] = flags; 59 flags_length.flags_[0] = flags;
60 WriteBytes(&flags_length, sizeof(flags_length)); 60 WriteBytes(&flags_length, sizeof(flags_length));
61 } 61 }
62 62
63 SpdyFrameBuilder::~SpdyFrameBuilder() { 63 SpdyFrameBuilder::~SpdyFrameBuilder() {
64 delete[] buffer_;
65 } 64 }
66 65
67 char* SpdyFrameBuilder::BeginWrite(size_t length) { 66 char* SpdyFrameBuilder::BeginWrite(size_t length) {
68 size_t offset = length_; 67 size_t offset = length_;
69 size_t needed_size = length_ + length; 68 size_t needed_size = length_ + length;
70 if (needed_size > capacity_) 69 if (needed_size > capacity_)
71 return NULL; 70 return NULL;
72 71
73 #ifdef ARCH_CPU_64_BITS 72 #ifdef ARCH_CPU_64_BITS
74 DCHECK_LE(length, std::numeric_limits<uint32>::max()); 73 DCHECK_LE(length, std::numeric_limits<uint32>::max());
75 #endif 74 #endif
76 75
77 return buffer_ + offset; 76 return buffer_.get() + offset;
78 } 77 }
79 78
80 void SpdyFrameBuilder::EndWrite(char* dest, int length) { 79 void SpdyFrameBuilder::EndWrite(char* dest, int length) {
81 } 80 }
82 81
83 bool SpdyFrameBuilder::WriteBytes(const void* data, uint32 data_len) { 82 bool SpdyFrameBuilder::WriteBytes(const void* data, uint32 data_len) {
84 if (data_len > kLengthMask) { 83 if (data_len > kLengthMask) {
85 return false; 84 return false;
86 } 85 }
87 86
(...skipping 20 matching lines...) Expand all
108 107
109 bool SpdyFrameBuilder::WriteStringPiece32(const base::StringPiece& value) { 108 bool SpdyFrameBuilder::WriteStringPiece32(const base::StringPiece& value) {
110 if (!WriteUInt32(value.size())) { 109 if (!WriteUInt32(value.size())) {
111 return false; 110 return false;
112 } 111 }
113 112
114 return WriteBytes(value.data(), value.size()); 113 return WriteBytes(value.data(), value.size());
115 } 114 }
116 115
117 } // namespace net 116 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_frame_builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698