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

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

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
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 #ifndef NET_SPDY_SPDY_FRAME_BUILDER_H_ 5 #ifndef NET_SPDY_SPDY_FRAME_BUILDER_H_
6 #define NET_SPDY_SPDY_FRAME_BUILDER_H_ 6 #define NET_SPDY_SPDY_FRAME_BUILDER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 SpdyFrame* rv = new SpdyFrame(buffer_.release(), length(), true); 81 SpdyFrame* rv = new SpdyFrame(buffer_.release(), length(), true);
82 capacity_ = 0; 82 capacity_ = 0;
83 length_ = 0; 83 length_ = 0;
84 offset_ = 0; 84 offset_ = 0;
85 return rv; 85 return rv;
86 } 86 }
87 87
88 // Methods for adding to the payload. These values are appended to the end 88 // Methods for adding to the payload. These values are appended to the end
89 // of the SpdyFrameBuilder payload. Note - binary integers are converted from 89 // of the SpdyFrameBuilder payload. Note - binary integers are converted from
90 // host to network form. 90 // host to network form.
91 bool WriteUInt8(uint8 value) { 91 bool WriteUInt8(uint8 value) { return WriteBytes(&value, sizeof(value)); }
92 return WriteBytes(&value, sizeof(value));
93 }
94 bool WriteUInt16(uint16 value) { 92 bool WriteUInt16(uint16 value) {
95 value = htons(value); 93 value = htons(value);
96 return WriteBytes(&value, sizeof(value)); 94 return WriteBytes(&value, sizeof(value));
97 } 95 }
98 bool WriteUInt32(uint32 value) { 96 bool WriteUInt32(uint32 value) {
99 value = htonl(value); 97 value = htonl(value);
100 return WriteBytes(&value, sizeof(value)); 98 return WriteBytes(&value, sizeof(value));
101 } 99 }
102 bool WriteUInt64(uint64 value) { 100 bool WriteUInt64(uint64 value) {
103 uint32 upper = htonl(value >> 32); 101 uint32 upper = htonl(value >> 32);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 size_t capacity_; // Allocation size of payload, set by constructor. 136 size_t capacity_; // Allocation size of payload, set by constructor.
139 size_t length_; // Length of the latest frame in the buffer. 137 size_t length_; // Length of the latest frame in the buffer.
140 size_t offset_; // Position at which the latest frame begins. 138 size_t offset_; // Position at which the latest frame begins.
141 139
142 const SpdyMajorVersion version_; 140 const SpdyMajorVersion version_;
143 }; 141 };
144 142
145 } // namespace net 143 } // namespace net
146 144
147 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ 145 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698