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

Side by Side Diff: net/websockets/websocket_channel.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_basic_stream_test.cc ('k') | net/websockets/websocket_channel_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_channel.h" 5 #include "net/websockets/websocket_channel.h"
6 6
7 #include <limits.h> // for INT_MAX 7 #include <limits.h> // for INT_MAX
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <deque> 10 #include <deque>
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 ScopedVector<WebSocketFrame> frames_; 143 ScopedVector<WebSocketFrame> frames_;
144 144
145 // The total size of the payload data in |frames_|. This will be used to 145 // The total size of the payload data in |frames_|. This will be used to
146 // measure the throughput of the link. 146 // measure the throughput of the link.
147 // TODO(ricea): Measure the throughput of the link. 147 // TODO(ricea): Measure the throughput of the link.
148 uint64 total_bytes_; 148 uint64 total_bytes_;
149 }; 149 };
150 150
151 void WebSocketChannel::SendBuffer::AddFrame(scoped_ptr<WebSocketFrame> frame) { 151 void WebSocketChannel::SendBuffer::AddFrame(scoped_ptr<WebSocketFrame> frame) {
152 total_bytes_ += frame->header.payload_length; 152 total_bytes_ += frame->header.payload_length;
153 frames_.push_back(frame.release()); 153 frames_.push_back(frame.Pass());
154 } 154 }
155 155
156 // Implementation of WebSocketStream::ConnectDelegate that simply forwards the 156 // Implementation of WebSocketStream::ConnectDelegate that simply forwards the
157 // calls on to the WebSocketChannel that created it. 157 // calls on to the WebSocketChannel that created it.
158 class WebSocketChannel::ConnectDelegate 158 class WebSocketChannel::ConnectDelegate
159 : public WebSocketStream::ConnectDelegate { 159 : public WebSocketStream::ConnectDelegate {
160 public: 160 public:
161 explicit ConnectDelegate(WebSocketChannel* creator) : creator_(creator) {} 161 explicit ConnectDelegate(WebSocketChannel* creator) : creator_(creator) {}
162 162
163 void OnSuccess(scoped_ptr<WebSocketStream> stream) override { 163 void OnSuccess(scoped_ptr<WebSocketStream> stream) override {
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 } 1144 }
1145 1145
1146 void WebSocketChannel::CloseTimeout() { 1146 void WebSocketChannel::CloseTimeout() {
1147 stream_->Close(); 1147 stream_->Close();
1148 SetState(CLOSED); 1148 SetState(CLOSED);
1149 DoDropChannel(false, kWebSocketErrorAbnormalClosure, ""); 1149 DoDropChannel(false, kWebSocketErrorAbnormalClosure, "");
1150 // |this| has been deleted. 1150 // |this| has been deleted.
1151 } 1151 }
1152 1152
1153 } // namespace net 1153 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_basic_stream_test.cc ('k') | net/websockets/websocket_channel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698