Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioNode.cpp

Issue 2909613002: Replaced usage of RefPtr::Release with std::move wraps. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698