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

Side by Side Diff: mojo/services/network/web_socket_impl.cc

Issue 1139673003: Make Mandoline shut down cleanly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 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 | « mojo/services/network/web_socket_impl.h ('k') | ui/platform_window/win/win_window.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/services/network/web_socket_impl.h" 5 #include "mojo/services/network/web_socket_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "mojo/common/handle_watcher.h" 9 #include "mojo/common/handle_watcher.h"
10 #include "mojo/services/network/network_context.h" 10 #include "mojo/services/network/network_context.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 bool fin, 170 bool fin,
171 net::WebSocketFrameHeader::OpCode type, 171 net::WebSocketFrameHeader::OpCode type,
172 uint32_t num_bytes, 172 uint32_t num_bytes,
173 const char* buffer) { 173 const char* buffer) {
174 client_->DidReceiveData( 174 client_->DidReceiveData(
175 fin, ConvertTo<WebSocket::MessageType>(type), num_bytes); 175 fin, ConvertTo<WebSocket::MessageType>(type), num_bytes);
176 } 176 }
177 177
178 } // namespace mojo 178 } // namespace mojo
179 179
180 WebSocketImpl::WebSocketImpl(NetworkContext* context) : context_(context) { 180 WebSocketImpl::WebSocketImpl(
181 NetworkContext* context,
182 scoped_ptr<mojo::AppRefCount> app_refcount)
183 : context_(context), app_refcount_(app_refcount.Pass()) {
181 } 184 }
182 185
183 WebSocketImpl::~WebSocketImpl() { 186 WebSocketImpl::~WebSocketImpl() {
184 } 187 }
185 188
186 void WebSocketImpl::Connect(const String& url, 189 void WebSocketImpl::Connect(const String& url,
187 Array<String> protocols, 190 Array<String> protocols,
188 const String& origin, 191 const String& origin,
189 ScopedDataPipeConsumerHandle send_stream, 192 ScopedDataPipeConsumerHandle send_stream,
190 WebSocketClientPtr client) { 193 WebSocketClientPtr client) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 uint32_t num_bytes, 228 uint32_t num_bytes,
226 const char* data) { 229 const char* data) {
227 std::vector<char> buffer(num_bytes); 230 std::vector<char> buffer(num_bytes);
228 memcpy(&buffer[0], data, num_bytes); 231 memcpy(&buffer[0], data, num_bytes);
229 DCHECK(channel_); 232 DCHECK(channel_);
230 channel_->SendFrame( 233 channel_->SendFrame(
231 fin, ConvertTo<net::WebSocketFrameHeader::OpCode>(type), buffer); 234 fin, ConvertTo<net::WebSocketFrameHeader::OpCode>(type), buffer);
232 } 235 }
233 236
234 } // namespace mojo 237 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/network/web_socket_impl.h ('k') | ui/platform_window/win/win_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698