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 (!handler_->SendRawData(static_cast<const char*>((data->Data())), | 222 if (!handler_->SendRawData(static_cast<const char*>((data->Data())), |
223 data_length)) { | 223 data_length)) { |
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(exception_state); | 226 ThrowCouldNotSendDataException(exception_state); |
227 } | 227 } |
228 } | 228 } |
229 | 229 |
230 void RTCDataChannel::send(DOMArrayBufferView* data, | 230 void RTCDataChannel::send(NotShared<DOMArrayBufferView> data, |
231 ExceptionState& exception_state) { | 231 ExceptionState& exception_state) { |
232 if (!handler_->SendRawData(static_cast<const char*>(data->BaseAddress()), | 232 if (!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(exception_state); | 237 ThrowCouldNotSendDataException(exception_state); |
237 } | 238 } |
238 } | 239 } |
239 | 240 |
240 void RTCDataChannel::send(Blob* data, ExceptionState& exception_state) { | 241 void RTCDataChannel::send(Blob* data, ExceptionState& exception_state) { |
241 // FIXME: implement | 242 // FIXME: implement |
242 ThrowNoBlobSupportException(exception_state); | 243 ThrowNoBlobSupportException(exception_state); |
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(scheduled_events_); | 379 visitor->Trace(scheduled_events_); |
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 |