| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } | 261 } |
| 262 | 262 |
| 263 DOMWebSocket* webSocket = new DOMWebSocket(context); | 263 DOMWebSocket* webSocket = new DOMWebSocket(context); |
| 264 webSocket->suspendIfNeeded(); | 264 webSocket->suspendIfNeeded(); |
| 265 | 265 |
| 266 if (protocols.isNull()) { | 266 if (protocols.isNull()) { |
| 267 Vector<String> protocolsVector; | 267 Vector<String> protocolsVector; |
| 268 webSocket->connect(url, protocolsVector, exceptionState); | 268 webSocket->connect(url, protocolsVector, exceptionState); |
| 269 } else if (protocols.isString()) { | 269 } else if (protocols.isString()) { |
| 270 Vector<String> protocolsVector; | 270 Vector<String> protocolsVector; |
| 271 protocolsVector.append(protocols.getAsString()); | 271 protocolsVector.push_back(protocols.getAsString()); |
| 272 webSocket->connect(url, protocolsVector, exceptionState); | 272 webSocket->connect(url, protocolsVector, exceptionState); |
| 273 } else { | 273 } else { |
| 274 DCHECK(protocols.isStringSequence()); | 274 DCHECK(protocols.isStringSequence()); |
| 275 webSocket->connect(url, protocols.getAsStringSequence(), exceptionState); | 275 webSocket->connect(url, protocols.getAsStringSequence(), exceptionState); |
| 276 } | 276 } |
| 277 | 277 |
| 278 if (exceptionState.hadException()) | 278 if (exceptionState.hadException()) |
| 279 return nullptr; | 279 return nullptr; |
| 280 | 280 |
| 281 return webSocket; | 281 return webSocket; |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 | 859 |
| 860 DEFINE_TRACE(DOMWebSocket) { | 860 DEFINE_TRACE(DOMWebSocket) { |
| 861 visitor->trace(m_channel); | 861 visitor->trace(m_channel); |
| 862 visitor->trace(m_eventQueue); | 862 visitor->trace(m_eventQueue); |
| 863 WebSocketChannelClient::trace(visitor); | 863 WebSocketChannelClient::trace(visitor); |
| 864 EventTargetWithInlineData::trace(visitor); | 864 EventTargetWithInlineData::trace(visitor); |
| 865 SuspendableObject::trace(visitor); | 865 SuspendableObject::trace(visitor); |
| 866 } | 866 } |
| 867 | 867 |
| 868 } // namespace blink | 868 } // namespace blink |
| OLD | NEW |