| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 return; | 220 return; |
| 221 | 221 |
| 222 if (!m_handler->sendRawData(static_cast<const char*>((data->data())), | 222 if (!m_handler->sendRawData(static_cast<const char*>((data->data())), |
| 223 dataLength)) { | 223 dataLength)) { |
| 224 // FIXME: This should not throw an exception but instead forcefully close | 224 // FIXME: This should not throw an exception but instead forcefully close |
| 225 // the data channel. | 225 // the data channel. |
| 226 throwCouldNotSendDataException(exceptionState); | 226 throwCouldNotSendDataException(exceptionState); |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 void RTCDataChannel::send(DOMArrayBufferView* data, | 230 void RTCDataChannel::send(const NotShared<DOMArrayBufferView>& data, |
| 231 ExceptionState& exceptionState) { | 231 ExceptionState& exceptionState) { |
| 232 if (!m_handler->sendRawData(static_cast<const char*>(data->baseAddress()), | 232 if (!m_handler->sendRawData( |
| 233 data->byteLength())) { | 233 static_cast<const char*>(data.view()->baseAddress()), |
| 234 data.view()->byteLength())) { |
| 234 // FIXME: This should not throw an exception but instead forcefully close | 235 // FIXME: This should not throw an exception but instead forcefully close |
| 235 // the data channel. | 236 // the data channel. |
| 236 throwCouldNotSendDataException(exceptionState); | 237 throwCouldNotSendDataException(exceptionState); |
| 237 } | 238 } |
| 238 } | 239 } |
| 239 | 240 |
| 240 void RTCDataChannel::send(Blob* data, ExceptionState& exceptionState) { | 241 void RTCDataChannel::send(Blob* data, ExceptionState& exceptionState) { |
| 241 // FIXME: implement | 242 // FIXME: implement |
| 242 throwNoBlobSupportException(exceptionState); | 243 throwNoBlobSupportException(exceptionState); |
| 243 } | 244 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 events.clear(); | 375 events.clear(); |
| 375 } | 376 } |
| 376 | 377 |
| 377 DEFINE_TRACE(RTCDataChannel) { | 378 DEFINE_TRACE(RTCDataChannel) { |
| 378 visitor->trace(m_scheduledEvents); | 379 visitor->trace(m_scheduledEvents); |
| 379 EventTargetWithInlineData::trace(visitor); | 380 EventTargetWithInlineData::trace(visitor); |
| 380 SuspendableObject::trace(visitor); | 381 SuspendableObject::trace(visitor); |
| 381 } | 382 } |
| 382 | 383 |
| 383 } // namespace blink | 384 } // namespace blink |
| OLD | NEW |