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

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

Issue 13710002: Clean up scoped_array<T> construction from NULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « gpu/tools/compositor_model_bench/render_model_utils.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 <algorithm> 5 #include <algorithm>
6 #include <iostream> 6 #include <iostream>
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 SetFrameLength(decompressed_frame, 93 SetFrameLength(decompressed_frame,
94 visitor.size() - framer->GetControlFrameHeaderSize(), 94 visitor.size() - framer->GetControlFrameHeaderSize(),
95 framer->protocol_version()); 95 framer->protocol_version());
96 } 96 }
97 return decompressed_frame; 97 return decompressed_frame;
98 } 98 }
99 99
100 class DecompressionVisitor : public SpdyFramerVisitorInterface { 100 class DecompressionVisitor : public SpdyFramerVisitorInterface {
101 public: 101 public:
102 explicit DecompressionVisitor(int version) 102 explicit DecompressionVisitor(int version)
103 : version_(version), buffer_(NULL), size_(0), finished_(false) { 103 : version_(version), size_(0), finished_(false) {
104 } 104 }
105 105
106 void ResetBuffer() { 106 void ResetBuffer() {
107 CHECK(buffer_.get() == NULL); 107 CHECK(buffer_.get() == NULL);
108 CHECK_EQ(0u, size_); 108 CHECK_EQ(0u, size_);
109 CHECK(!finished_); 109 CHECK(!finished_);
110 buffer_.reset(new char[kMaxDecompressedSize]); 110 buffer_.reset(new char[kMaxDecompressedSize]);
111 } 111 }
112 112
113 virtual void OnSynStream(SpdyStreamId stream_id, 113 virtual void OnSynStream(SpdyStreamId stream_id,
(...skipping 4018 matching lines...) Expand 10 before | Expand all | Expand 10 after
4132 arraysize(kV3FrameData)); 4132 arraysize(kV3FrameData));
4133 } else { 4133 } else {
4134 framer.ProcessInput(reinterpret_cast<const char*>(kV4FrameData), 4134 framer.ProcessInput(reinterpret_cast<const char*>(kV4FrameData),
4135 arraysize(kV4FrameData)); 4135 arraysize(kV4FrameData));
4136 } 4136 }
4137 EXPECT_EQ(SpdyFramer::SPDY_RESET, framer.state()); 4137 EXPECT_EQ(SpdyFramer::SPDY_RESET, framer.state());
4138 EXPECT_EQ(SpdyFramer::SPDY_NO_ERROR, framer.error_code()); 4138 EXPECT_EQ(SpdyFramer::SPDY_NO_ERROR, framer.error_code());
4139 } 4139 }
4140 4140
4141 } // namespace net 4141 } // namespace net
OLDNEW
« no previous file with comments | « gpu/tools/compositor_model_bench/render_model_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698