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

Side by Side Diff: webkit/child/websocketstreamhandle_impl.cc

Issue 22815034: Introduce webkit_glue bridges for the new WebSocket Implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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 | « webkit/child/webkitplatformsupport_impl.h ('k') | webkit/glue/webkit_glue_unittest.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 // An implementation of WebSocketStreamHandle. 5 // An implementation of WebSocketStreamHandle.
6 6
7 #include "webkit/child/websocketstreamhandle_impl.h" 7 #include "webkit/child/websocketstreamhandle_impl.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 WebSocketStreamHandleImpl::Context::Context(WebSocketStreamHandleImpl* handle) 79 WebSocketStreamHandleImpl::Context::Context(WebSocketStreamHandleImpl* handle)
80 : handle_(handle), 80 : handle_(handle),
81 client_(NULL) { 81 client_(NULL) {
82 } 82 }
83 83
84 void WebSocketStreamHandleImpl::Context::Connect( 84 void WebSocketStreamHandleImpl::Context::Connect(
85 const WebURL& url, 85 const WebURL& url,
86 WebKitPlatformSupportImpl* platform) { 86 WebKitPlatformSupportImpl* platform) {
87 VLOG(1) << "Connect url=" << url; 87 VLOG(1) << "Connect url=" << url;
88 DCHECK(!bridge_.get()); 88 DCHECK(!bridge_.get());
89 bridge_ = platform->CreateWebSocketBridge(handle_, this); 89 bridge_ = platform->CreateWebSocketStreamBridge(handle_, this);
90 AddRef(); // Will be released by DidClose(). 90 AddRef(); // Will be released by DidClose().
91 bridge_->Connect(url); 91 bridge_->Connect(url);
92 } 92 }
93 93
94 bool WebSocketStreamHandleImpl::Context::Send(const WebData& data) { 94 bool WebSocketStreamHandleImpl::Context::Send(const WebData& data) {
95 VLOG(1) << "Send data.size=" << data.size(); 95 VLOG(1) << "Send data.size=" << data.size();
96 DCHECK(bridge_.get()); 96 DCHECK(bridge_.get());
97 return bridge_->Send( 97 return bridge_->Send(
98 std::vector<char>(data.data(), data.data() + data.size())); 98 std::vector<char>(data.data(), data.data() + data.size()));
99 } 99 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 bool WebSocketStreamHandleImpl::send(const WebData& data) { 187 bool WebSocketStreamHandleImpl::send(const WebData& data) {
188 return context_->Send(data); 188 return context_->Send(data);
189 } 189 }
190 190
191 void WebSocketStreamHandleImpl::close() { 191 void WebSocketStreamHandleImpl::close() {
192 context_->Close(); 192 context_->Close();
193 } 193 }
194 194
195 } // namespace webkit_glue 195 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/child/webkitplatformsupport_impl.h ('k') | webkit/glue/webkit_glue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698