| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 : context_(context), handler_(nullptr) {} | 543 : context_(context), handler_(nullptr) {} |
| 544 | 544 |
| 545 void AudioNode::Dispose() { | 545 void AudioNode::Dispose() { |
| 546 DCHECK(IsMainThread()); | 546 DCHECK(IsMainThread()); |
| 547 #if DEBUG_AUDIONODE_REFERENCES | 547 #if DEBUG_AUDIONODE_REFERENCES |
| 548 fprintf(stderr, "[%16p]: %16p: %2d: AudioNode::dispose %16p\n", context(), | 548 fprintf(stderr, "[%16p]: %16p: %2d: AudioNode::dispose %16p\n", context(), |
| 549 this, Handler().GetNodeType(), handler_.Get()); | 549 this, Handler().GetNodeType(), handler_.Get()); |
| 550 #endif | 550 #endif |
| 551 BaseAudioContext::AutoLocker locker(context()); | 551 BaseAudioContext::AutoLocker locker(context()); |
| 552 Handler().Dispose(); | 552 Handler().Dispose(); |
| 553 if (context()->ContextState() == BaseAudioContext::kRunning) | 553 if (context()->ContextState() == BaseAudioContext::kRunning) { |
| 554 context()->GetDeferredTaskHandler().AddRenderingOrphanHandler( | 554 context()->GetDeferredTaskHandler().AddRenderingOrphanHandler( |
| 555 handler_.Release()); | 555 std::move(handler_)); |
| 556 } |
| 556 } | 557 } |
| 557 | 558 |
| 558 void AudioNode::SetHandler(PassRefPtr<AudioHandler> handler) { | 559 void AudioNode::SetHandler(PassRefPtr<AudioHandler> handler) { |
| 559 DCHECK(handler); | 560 DCHECK(handler); |
| 560 handler_ = std::move(handler); | 561 handler_ = std::move(handler); |
| 561 | 562 |
| 562 #if DEBUG_AUDIONODE_REFERENCES | 563 #if DEBUG_AUDIONODE_REFERENCES |
| 563 fprintf(stderr, "[%16p]: %16p: %2d: AudioNode::AudioNode %16p\n", context(), | 564 fprintf(stderr, "[%16p]: %16p: %2d: AudioNode::AudioNode %16p\n", context(), |
| 564 this, handler_->GetNodeType(), handler_.Get()); | 565 this, handler_->GetNodeType(), handler_.Get()); |
| 565 #endif | 566 #endif |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 } | 969 } |
| 969 | 970 |
| 970 void AudioNode::DidAddOutput(unsigned number_of_outputs) { | 971 void AudioNode::DidAddOutput(unsigned number_of_outputs) { |
| 971 connected_nodes_.push_back(nullptr); | 972 connected_nodes_.push_back(nullptr); |
| 972 DCHECK_EQ(number_of_outputs, connected_nodes_.size()); | 973 DCHECK_EQ(number_of_outputs, connected_nodes_.size()); |
| 973 connected_params_.push_back(nullptr); | 974 connected_params_.push_back(nullptr); |
| 974 DCHECK_EQ(number_of_outputs, connected_params_.size()); | 975 DCHECK_EQ(number_of_outputs, connected_params_.size()); |
| 975 } | 976 } |
| 976 | 977 |
| 977 } // namespace blink | 978 } // namespace blink |
| OLD | NEW |