| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 void RTCDataChannel::dispose() | 94 void RTCDataChannel::dispose() |
| 95 { | 95 { |
| 96 if (m_stopped) | 96 if (m_stopped) |
| 97 return; | 97 return; |
| 98 | 98 |
| 99 // Promptly clears a raw reference from content/ to an on-heap object | 99 // Promptly clears a raw reference from content/ to an on-heap object |
| 100 // so that content/ doesn't access it in a lazy sweeping phase. | 100 // so that content/ doesn't access it in a lazy sweeping phase. |
| 101 m_handler->setClient(nullptr); | 101 m_handler->setClient(nullptr); |
| 102 m_handler.clear(); | 102 m_handler.reset(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 RTCDataChannel::ReadyState RTCDataChannel::getHandlerState() const | 105 RTCDataChannel::ReadyState RTCDataChannel::getHandlerState() const |
| 106 { | 106 { |
| 107 return m_handler->state(); | 107 return m_handler->state(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 String RTCDataChannel::label() const | 110 String RTCDataChannel::label() const |
| 111 { | 111 { |
| 112 return m_handler->label(); | 112 return m_handler->label(); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 m_scheduledEventTimer.startOneShot(0, BLINK_FROM_HERE); | 322 m_scheduledEventTimer.startOneShot(0, BLINK_FROM_HERE); |
| 323 } | 323 } |
| 324 | 324 |
| 325 void RTCDataChannel::stop() | 325 void RTCDataChannel::stop() |
| 326 { | 326 { |
| 327 if (m_stopped) | 327 if (m_stopped) |
| 328 return; | 328 return; |
| 329 | 329 |
| 330 m_stopped = true; | 330 m_stopped = true; |
| 331 m_handler->setClient(nullptr); | 331 m_handler->setClient(nullptr); |
| 332 m_handler.clear(); | 332 m_handler.reset(); |
| 333 } | 333 } |
| 334 | 334 |
| 335 // ActiveScriptWrappable | 335 // ActiveScriptWrappable |
| 336 bool RTCDataChannel::hasPendingActivity() const | 336 bool RTCDataChannel::hasPendingActivity() const |
| 337 { | 337 { |
| 338 if (m_stopped) | 338 if (m_stopped) |
| 339 return false; | 339 return false; |
| 340 | 340 |
| 341 // A RTCDataChannel object must not be garbage collected if its | 341 // A RTCDataChannel object must not be garbage collected if its |
| 342 // * readyState is connecting and at least one event listener is registered | 342 // * readyState is connecting and at least one event listener is registered |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 } | 389 } |
| 390 | 390 |
| 391 DEFINE_TRACE(RTCDataChannel) | 391 DEFINE_TRACE(RTCDataChannel) |
| 392 { | 392 { |
| 393 visitor->trace(m_scheduledEvents); | 393 visitor->trace(m_scheduledEvents); |
| 394 EventTargetWithInlineData::trace(visitor); | 394 EventTargetWithInlineData::trace(visitor); |
| 395 ActiveDOMObject::trace(visitor); | 395 ActiveDOMObject::trace(visitor); |
| 396 } | 396 } |
| 397 | 397 |
| 398 } // namespace blink | 398 } // namespace blink |
| OLD | NEW |