Skip to content

Commit

Permalink
Remove AudioWorkletThread::CollectAllGarbage()
Browse files Browse the repository at this point in the history
nhiroki@ found that the method is never called and we decided to
remove the call. AudioWorkletThread is a ref-counted object, so
it does not need help of the blink garbage collector.

Bug: 892006
Change-Id: I5ed17101f94ee68765e471624f599eede491dd03
Reviewed-on: https://chromium-review.googlesource.com/c/1265995
Reviewed-by: Kentaro Hara <[email protected]>
Commit-Queue: Hongchan Choi <[email protected]>
Cr-Commit-Position: refs/heads/master@{#598589}
  • Loading branch information
hoch authored and Commit Bot committed Oct 11, 2018
1 parent ed7a7b4 commit 8c059b0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,6 @@ WorkerBackingThread& AudioWorkletThread::GetWorkerBackingThread() {
return *WorkletThreadHolder<AudioWorkletThread>::GetInstance()->GetThread();
}

void CollectAllGarbageOnAudioWorkletThread(WaitableEvent* done_event) {
blink::ThreadState::Current()->CollectAllGarbage();
done_event->Signal();
}

void AudioWorkletThread::CollectAllGarbage() {
DCHECK(IsMainThread());
WaitableEvent done_event;
WorkletThreadHolder<AudioWorkletThread>* worklet_thread_holder =
WorkletThreadHolder<AudioWorkletThread>::GetInstance();
if (!worklet_thread_holder)
return;
worklet_thread_holder->GetThread()->BackingThread().PostTask(
FROM_HERE, CrossThreadBind(&CollectAllGarbageOnAudioWorkletThread,
CrossThreadUnretained(&done_event)));
done_event.Wait();
}

void AudioWorkletThread::EnsureSharedBackingThread() {
DCHECK(IsMainThread());
WorkletThreadHolder<AudioWorkletThread>::EnsureInstance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ class MODULES_EXPORT AudioWorkletThread final : public WorkerThread {
// The backing thread is cleared by clearSharedBackingThread().
void ClearWorkerBackingThread() override {}

// This may block the main thread.
static void CollectAllGarbage();

static void EnsureSharedBackingThread();
static void ClearSharedBackingThread();

Expand Down

0 comments on commit 8c059b0

Please sign in to comment.