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

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

Issue 485833002: HTTP2 draft 14 support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ignore_result(). Created 6 years, 4 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
« no previous file with comments | « net/spdy/mock_spdy_framer_visitor.h ('k') | net/spdy/spdy_frame_builder.cc » ('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 #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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) {
92 return WriteBytes(&value, sizeof(value)); 92 return WriteBytes(&value, sizeof(value));
93 } 93 }
94 bool WriteUInt16(uint16 value) { 94 bool WriteUInt16(uint16 value) {
95 value = htons(value); 95 value = htons(value);
96 return WriteBytes(&value, sizeof(value)); 96 return WriteBytes(&value, sizeof(value));
97 } 97 }
98 bool WriteUInt24(uint32 value) {
99 value = htonl(value);
100 return WriteBytes(reinterpret_cast<char*>(&value) + 1,
101 sizeof(value) - 1);
102 }
98 bool WriteUInt32(uint32 value) { 103 bool WriteUInt32(uint32 value) {
99 value = htonl(value); 104 value = htonl(value);
100 return WriteBytes(&value, sizeof(value)); 105 return WriteBytes(&value, sizeof(value));
101 } 106 }
102 bool WriteUInt64(uint64 value) { 107 bool WriteUInt64(uint64 value) {
103 uint32 upper = htonl(value >> 32); 108 uint32 upper = htonl(value >> 32);
104 uint32 lower = htonl(value); 109 uint32 lower = htonl(value);
105 return (WriteBytes(&upper, sizeof(upper)) && 110 return (WriteBytes(&upper, sizeof(upper)) &&
106 WriteBytes(&lower, sizeof(lower))); 111 WriteBytes(&lower, sizeof(lower)));
107 } 112 }
(...skipping 30 matching lines...) Expand all
138 size_t capacity_; // Allocation size of payload, set by constructor. 143 size_t capacity_; // Allocation size of payload, set by constructor.
139 size_t length_; // Length of the latest frame in the buffer. 144 size_t length_; // Length of the latest frame in the buffer.
140 size_t offset_; // Position at which the latest frame begins. 145 size_t offset_; // Position at which the latest frame begins.
141 146
142 const SpdyMajorVersion version_; 147 const SpdyMajorVersion version_;
143 }; 148 };
144 149
145 } // namespace net 150 } // namespace net
146 151
147 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ 152 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_
OLDNEW
« no previous file with comments | « net/spdy/mock_spdy_framer_visitor.h ('k') | net/spdy/spdy_frame_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698