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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 ExecutionContext* context, | 85 ExecutionContext* context, |
86 std::unique_ptr<WebRTCDataChannelHandler> handler) | 86 std::unique_ptr<WebRTCDataChannelHandler> handler) |
87 : ActiveScriptWrappable(this), | 87 : ActiveScriptWrappable(this), |
88 SuspendableObject(context), | 88 SuspendableObject(context), |
89 m_handler(std::move(handler)), | 89 m_handler(std::move(handler)), |
90 m_readyState(ReadyStateConnecting), | 90 m_readyState(ReadyStateConnecting), |
91 m_binaryType(BinaryTypeArrayBuffer), | 91 m_binaryType(BinaryTypeArrayBuffer), |
92 m_scheduledEventTimer(this, &RTCDataChannel::scheduledEventTimerFired), | 92 m_scheduledEventTimer(this, &RTCDataChannel::scheduledEventTimerFired), |
93 m_bufferedAmountLowThreshold(0U), | 93 m_bufferedAmountLowThreshold(0U), |
94 m_stopped(false) { | 94 m_stopped(false) { |
95 ThreadState::current()->registerPreFinalizer(this); | |
96 m_handler->setClient(this); | 95 m_handler->setClient(this); |
97 } | 96 } |
98 | 97 |
99 RTCDataChannel::~RTCDataChannel() {} | 98 RTCDataChannel::~RTCDataChannel() {} |
100 | 99 |
101 void RTCDataChannel::dispose() { | 100 void RTCDataChannel::dispose() { |
102 if (m_stopped) | 101 if (m_stopped) |
103 return; | 102 return; |
104 | 103 |
105 // Promptly clears a raw reference from content/ to an on-heap object | 104 // Promptly clears a raw reference from content/ to an on-heap object |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 events.clear(); | 371 events.clear(); |
373 } | 372 } |
374 | 373 |
375 DEFINE_TRACE(RTCDataChannel) { | 374 DEFINE_TRACE(RTCDataChannel) { |
376 visitor->trace(m_scheduledEvents); | 375 visitor->trace(m_scheduledEvents); |
377 EventTargetWithInlineData::trace(visitor); | 376 EventTargetWithInlineData::trace(visitor); |
378 SuspendableObject::trace(visitor); | 377 SuspendableObject::trace(visitor); |
379 } | 378 } |
380 | 379 |
381 } // namespace blink | 380 } // namespace blink |
OLD | NEW |