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

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

Issue 202403002: Land recent SPDY changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase. Back out commits included for trybot benefit, but separately landed upstream. Created 6 years, 8 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_session.cc ('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 "net/spdy/spdy_test_utils.h" 5 #include "net/spdy/spdy_test_utils.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 case 3: 103 case 3:
104 CHECK_EQ(0u, length & ~kLengthMask); 104 CHECK_EQ(0u, length & ~kLengthMask);
105 { 105 {
106 int32 wire_length = base::HostToNet32(length); 106 int32 wire_length = base::HostToNet32(length);
107 // The length field in SPDY 2 and 3 is a 24-bit (3B) integer starting at 107 // The length field in SPDY 2 and 3 is a 24-bit (3B) integer starting at
108 // offset 5. 108 // offset 5.
109 memcpy(frame->data() + 5, reinterpret_cast<char*>(&wire_length) + 1, 3); 109 memcpy(frame->data() + 5, reinterpret_cast<char*>(&wire_length) + 1, 3);
110 } 110 }
111 break; 111 break;
112 case 4: 112 case 4:
113 CHECK_GT(1u<<16, length); 113 CHECK_GT(1u<<14, length);
114 { 114 {
115 int32 wire_length = base::HostToNet16(static_cast<uint16>(length)); 115 int32 wire_length = base::HostToNet16(static_cast<uint16>(length));
116 memcpy(frame->data(), 116 memcpy(frame->data(),
117 reinterpret_cast<char*>(&wire_length), 117 reinterpret_cast<char*>(&wire_length),
118 sizeof(uint16)); 118 sizeof(uint16));
119 } 119 }
120 break; 120 break;
121 default: 121 default:
122 LOG(FATAL) << "Unsupported SPDY version."; 122 LOG(FATAL) << "Unsupported SPDY version.";
123 } 123 }
124 } 124 }
125 125
126 126
127 } // namespace test 127 } // namespace test
128 128
129 } // namespace net 129 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698