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

Unified Diff: media/audio/audio_debug_file_writer.h

Issue 2885173002: Make AudioDebugFileWriter create its own file worker thread. (Closed)
Patch Set: Make AudioDebugFileWriter create its own file thread. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: media/audio/audio_debug_file_writer.h
diff --git a/media/audio/audio_debug_file_writer.h b/media/audio/audio_debug_file_writer.h
index 9d8a4c0f9b940e5076520c1a0d1ebf43a7916924..26a21a5fe44d2e3a28e0db817e225629a1439ba2 100644
--- a/media/audio/audio_debug_file_writer.h
+++ b/media/audio/audio_debug_file_writer.h
@@ -14,6 +14,7 @@
#include "base/memory/ref_counted.h"
#include "base/sequence_checker.h"
#include "base/single_thread_task_runner.h"
+#include "base/task_scheduler/post_task.h"
#include "media/base/audio_parameters.h"
#include "media/base/media_export.h"
@@ -29,9 +30,7 @@ class MEDIA_EXPORT AudioDebugFileWriter {
// Number of channels and sample rate are used from |params|, the other
// parameters are ignored. The number of channels in the data passed to
// Write() must match |params|.
- AudioDebugFileWriter(
- const AudioParameters& params,
- scoped_refptr<base::SingleThreadTaskRunner> file_task_runner);
+ AudioDebugFileWriter(const AudioParameters& params);
virtual ~AudioDebugFileWriter();
@@ -84,7 +83,9 @@ class MEDIA_EXPORT AudioDebugFileWriter {
base::SequenceChecker client_sequence_checker_;
// The task runner to do file output operations on.
- scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
+ const scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_ =
+ base::CreateSingleThreadTaskRunnerWithTraits(
gab 2017/05/18 16:10:10 In general we don't want to create SingleThreadTas
Sébastien Marchand 2017/05/18 17:43:06 Thanks for the detailed comment! I'm addressing th
+ {base::MayBlock(), base::TaskPriority::BACKGROUND});
DISALLOW_COPY_AND_ASSIGN(AudioDebugFileWriter);
};

Powered by Google App Engine
This is Rietveld 408576698