| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 | 69 |
| 70 RTCDataChannel::RTCDataChannel(ExecutionContext* context, PassOwnPtr<WebRTCDataC
hannelHandler> handler) | 70 RTCDataChannel::RTCDataChannel(ExecutionContext* context, PassOwnPtr<WebRTCDataC
hannelHandler> handler) |
| 71 : m_executionContext(context) | 71 : m_executionContext(context) |
| 72 , m_handler(handler) | 72 , m_handler(handler) |
| 73 , m_readyState(ReadyStateConnecting) | 73 , m_readyState(ReadyStateConnecting) |
| 74 , m_binaryType(BinaryTypeArrayBuffer) | 74 , m_binaryType(BinaryTypeArrayBuffer) |
| 75 , m_scheduledEventTimer(this, &RTCDataChannel::scheduledEventTimerFired) | 75 , m_scheduledEventTimer(this, &RTCDataChannel::scheduledEventTimerFired) |
| 76 , m_bufferedAmountLowThreshold(0U) | 76 , m_bufferedAmountLowThreshold(0U) |
| 77 { | 77 { |
| 78 ThreadState::current()->registerPreFinalizer(this); |
| 78 m_handler->setClient(this); | 79 m_handler->setClient(this); |
| 79 } | 80 } |
| 80 | 81 |
| 81 RTCDataChannel::~RTCDataChannel() | 82 RTCDataChannel::~RTCDataChannel() |
| 82 { | 83 { |
| 83 // Notify the client that the channel is gone. | 84 } |
| 84 m_handler->setClient(0); | 85 |
| 86 void RTCDataChannel::dispose() |
| 87 { |
| 88 // Promptly clears a raw reference from content/ to an on-heap object |
| 89 // so that content/ doesn't access it in a lazy sweeping phase. |
| 90 m_handler->setClient(nullptr); |
| 91 m_handler.clear(); |
| 85 } | 92 } |
| 86 | 93 |
| 87 RTCDataChannel::ReadyState RTCDataChannel::getHandlerState() const | 94 RTCDataChannel::ReadyState RTCDataChannel::getHandlerState() const |
| 88 { | 95 { |
| 89 return m_handler->state(); | 96 return m_handler->state(); |
| 90 } | 97 } |
| 91 | 98 |
| 92 String RTCDataChannel::label() const | 99 String RTCDataChannel::label() const |
| 93 { | 100 { |
| 94 return m_handler->label(); | 101 return m_handler->label(); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 322 } |
| 316 | 323 |
| 317 DEFINE_TRACE(RTCDataChannel) | 324 DEFINE_TRACE(RTCDataChannel) |
| 318 { | 325 { |
| 319 visitor->trace(m_executionContext); | 326 visitor->trace(m_executionContext); |
| 320 visitor->trace(m_scheduledEvents); | 327 visitor->trace(m_scheduledEvents); |
| 321 RefCountedGarbageCollectedEventTargetWithInlineData<RTCDataChannel>::trace(v
isitor); | 328 RefCountedGarbageCollectedEventTargetWithInlineData<RTCDataChannel>::trace(v
isitor); |
| 322 } | 329 } |
| 323 | 330 |
| 324 } // namespace blink | 331 } // namespace blink |
| OLD | NEW |