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

Side by Side Diff: Source/web/WebSocketImpl.cpp

Issue 334873002: [WebSocket] Make subprotocol and extensions live in WebSocket (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 | « Source/web/WebSocketImpl.h ('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 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return true; 78 return true;
79 } 79 }
80 80
81 void WebSocketImpl::connect(const WebURL& url, const WebString& protocol) 81 void WebSocketImpl::connect(const WebURL& url, const WebString& protocol)
82 { 82 {
83 m_private->connect(url, protocol); 83 m_private->connect(url, protocol);
84 } 84 }
85 85
86 WebString WebSocketImpl::subprotocol() 86 WebString WebSocketImpl::subprotocol()
87 { 87 {
88 return m_private->subprotocol(); 88 return m_subprotocol;
89 } 89 }
90 90
91 WebString WebSocketImpl::extensions() 91 WebString WebSocketImpl::extensions()
92 { 92 {
93 return m_private->extensions(); 93 return m_extensions;
94 } 94 }
95 95
96 bool WebSocketImpl::sendText(const WebString& message) 96 bool WebSocketImpl::sendText(const WebString& message)
97 { 97 {
98 return m_private->send(message) == WebSocketChannel::SendSuccess; 98 return m_private->send(message) == WebSocketChannel::SendSuccess;
99 } 99 }
100 100
101 bool WebSocketImpl::sendArrayBuffer(const WebArrayBuffer& webArrayBuffer) 101 bool WebSocketImpl::sendArrayBuffer(const WebArrayBuffer& webArrayBuffer)
102 { 102 {
103 return m_private->send(*PassRefPtr<ArrayBuffer>(webArrayBuffer), 0, webArray Buffer.byteLength()) == WebSocketChannel::SendSuccess; 103 return m_private->send(*PassRefPtr<ArrayBuffer>(webArrayBuffer), 0, webArray Buffer.byteLength()) == WebSocketChannel::SendSuccess;
(...skipping 13 matching lines...) Expand all
117 { 117 {
118 m_private->fail(reason, ErrorMessageLevel, String(), 0); 118 m_private->fail(reason, ErrorMessageLevel, String(), 0);
119 } 119 }
120 120
121 void WebSocketImpl::disconnect() 121 void WebSocketImpl::disconnect()
122 { 122 {
123 m_private->disconnect(); 123 m_private->disconnect();
124 m_client = 0; 124 m_client = 0;
125 } 125 }
126 126
127 void WebSocketImpl::didConnect() 127 void WebSocketImpl::didConnect(const String& subprotocol, const String& extensio ns)
128 { 128 {
129 m_subprotocol = subprotocol;
130 m_extensions = extensions;
129 m_client->didConnect(); 131 m_client->didConnect();
130 } 132 }
131 133
132 void WebSocketImpl::didReceiveMessage(const String& message) 134 void WebSocketImpl::didReceiveMessage(const String& message)
133 { 135 {
134 m_client->didReceiveMessage(WebString(message)); 136 m_client->didReceiveMessage(WebString(message));
135 } 137 }
136 138
137 void WebSocketImpl::didReceiveBinaryData(PassOwnPtr<Vector<char> > binaryData) 139 void WebSocketImpl::didReceiveBinaryData(PassOwnPtr<Vector<char> > binaryData)
138 { 140 {
(...skipping 21 matching lines...) Expand all
160 { 162 {
161 m_client->didStartClosingHandshake(); 163 m_client->didStartClosingHandshake();
162 } 164 }
163 165
164 void WebSocketImpl::didClose(unsigned long bufferedAmount, ClosingHandshakeCompl etionStatus status, unsigned short code, const String& reason) 166 void WebSocketImpl::didClose(unsigned long bufferedAmount, ClosingHandshakeCompl etionStatus status, unsigned short code, const String& reason)
165 { 167 {
166 m_client->didClose(bufferedAmount, static_cast<WebSocketClient::ClosingHands hakeCompletionStatus>(status), code, WebString(reason)); 168 m_client->didClose(bufferedAmount, static_cast<WebSocketClient::ClosingHands hakeCompletionStatus>(status), code, WebString(reason));
167 } 169 }
168 170
169 } // namespace blink 171 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebSocketImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698