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

Side by Side Diff: net/websockets/websocket_frame_parser.cc

Issue 1157403005: Subsituting pattern ScopedVector push_back.(ptr.release()) with push_back(ptr.Pass()) in net/websoc… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/websockets/websocket_deflate_stream.cc ('k') | net/websockets/websocket_stream_test.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 #include "net/websockets/websocket_frame_parser.h" 5 #include "net/websockets/websocket_frame_parser.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // If frame header is incomplete, then carry over the remaining 65 // If frame header is incomplete, then carry over the remaining
66 // data to the next round of Decode(). 66 // data to the next round of Decode().
67 if (!current_frame_header_.get()) 67 if (!current_frame_header_.get())
68 break; 68 break;
69 first_chunk = true; 69 first_chunk = true;
70 } 70 }
71 71
72 scoped_ptr<WebSocketFrameChunk> frame_chunk = 72 scoped_ptr<WebSocketFrameChunk> frame_chunk =
73 DecodeFramePayload(first_chunk); 73 DecodeFramePayload(first_chunk);
74 DCHECK(frame_chunk.get()); 74 DCHECK(frame_chunk.get());
75 frame_chunks->push_back(frame_chunk.release()); 75 frame_chunks->push_back(frame_chunk.Pass());
76 76
77 if (current_frame_header_.get()) { 77 if (current_frame_header_.get()) {
78 DCHECK(current_read_pos_ == buffer_.size()); 78 DCHECK(current_read_pos_ == buffer_.size());
79 break; 79 break;
80 } 80 }
81 } 81 }
82 82
83 // Drain unnecessary data. TODO(yutak): Remove copy. (but how?) 83 // Drain unnecessary data. TODO(yutak): Remove copy. (but how?)
84 buffer_.erase(buffer_.begin(), buffer_.begin() + current_read_pos_); 84 buffer_.erase(buffer_.begin(), buffer_.begin() + current_read_pos_);
85 current_read_pos_ = 0; 85 current_read_pos_ = 0;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 if (frame_offset_ == current_frame_header_->payload_length) { 201 if (frame_offset_ == current_frame_header_->payload_length) {
202 frame_chunk->final_chunk = true; 202 frame_chunk->final_chunk = true;
203 current_frame_header_.reset(); 203 current_frame_header_.reset();
204 frame_offset_ = 0; 204 frame_offset_ = 0;
205 } 205 }
206 206
207 return frame_chunk.Pass(); 207 return frame_chunk.Pass();
208 } 208 }
209 209
210 } // namespace net 210 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_deflate_stream.cc ('k') | net/websockets/websocket_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698