Commit 72086dc9 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

webaudio: Remove unnecessary use of volatile and atomic operations in AudioHandler.

volatile does not add atomicity or thread safety, and is unnecessary here.

connection_ref_count_ is already accessed only while the graph mutex is held, so
there is no added benefit of atomic operations.

Change-Id: I69ecb8293360631872f8914b9bb013d06f49717d
Reviewed-on: https://chromium-review.googlesource.com/c/1348854Reviewed-by: default avatarHongchan Choi <hongchan@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610511}
parent 11dc014b
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "third_party/blink/renderer/platform/bindings/exception_messages.h" #include "third_party/blink/renderer/platform/bindings/exception_messages.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/instance_counters.h" #include "third_party/blink/renderer/platform/instance_counters.h"
#include "third_party/blink/renderer/platform/wtf/atomics.h"
#if DEBUG_AUDIONODE_REFERENCES #if DEBUG_AUDIONODE_REFERENCES
#include <stdio.h> #include <stdio.h>
...@@ -466,7 +465,8 @@ void AudioHandler::DisableOutputs() { ...@@ -466,7 +465,8 @@ void AudioHandler::DisableOutputs() {
} }
void AudioHandler::MakeConnection() { void AudioHandler::MakeConnection() {
AtomicIncrement(&connection_ref_count_); Context()->AssertGraphOwner();
connection_ref_count_++;
#if DEBUG_AUDIONODE_REFERENCES #if DEBUG_AUDIONODE_REFERENCES
fprintf( fprintf(
...@@ -508,8 +508,7 @@ void AudioHandler::BreakConnection() { ...@@ -508,8 +508,7 @@ void AudioHandler::BreakConnection() {
void AudioHandler::BreakConnectionWithLock() { void AudioHandler::BreakConnectionWithLock() {
Context()->AssertGraphOwner(); Context()->AssertGraphOwner();
connection_ref_count_--;
AtomicDecrement(&connection_ref_count_);
#if DEBUG_AUDIONODE_REFERENCES #if DEBUG_AUDIONODE_REFERENCES
fprintf(stderr, fprintf(stderr,
......
...@@ -263,7 +263,7 @@ class MODULES_EXPORT AudioHandler : public ThreadSafeRefCounted<AudioHandler> { ...@@ -263,7 +263,7 @@ class MODULES_EXPORT AudioHandler : public ThreadSafeRefCounted<AudioHandler> {
private: private:
void SetNodeType(NodeType); void SetNodeType(NodeType);
volatile bool is_initialized_; bool is_initialized_;
NodeType node_type_; NodeType node_type_;
// The owner AudioNode. Accessed only on the main thread. // The owner AudioNode. Accessed only on the main thread.
...@@ -281,7 +281,7 @@ class MODULES_EXPORT AudioHandler : public ThreadSafeRefCounted<AudioHandler> { ...@@ -281,7 +281,7 @@ class MODULES_EXPORT AudioHandler : public ThreadSafeRefCounted<AudioHandler> {
double last_processing_time_; double last_processing_time_;
double last_non_silent_time_; double last_non_silent_time_;
volatile int connection_ref_count_; int connection_ref_count_;
bool is_disabled_; bool is_disabled_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment