Commit 67a8e000 authored by Zhuoyu Qian's avatar Zhuoyu Qian Committed by Commit Bot

Rename BackgroundScheduler namepsace to background_scheduler

https://google.github.io/styleguide/cppguide.html#Namespace_Names
> Namespace names are all lower-case.

This CL has no behavior changes.

Bug: 889726
Change-Id: Idbe50cad950947ba8633758dbf7070d2288fa6d0
Reviewed-on: https://chromium-review.googlesource.com/c/1298946Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Cr-Commit-Position: refs/heads/master@{#602973}
parent aa890843
...@@ -424,7 +424,7 @@ void ScriptStreamer::NotifyAppendData(ScriptResource* resource) { ...@@ -424,7 +424,7 @@ void ScriptStreamer::NotifyAppendData(ScriptResource* resource) {
// cancel the task. // cancel the task.
// //
// TODO(leszeks): Decrease the priority of these tasks where possible. // TODO(leszeks): Decrease the priority of these tasks where possible.
BackgroundScheduler::PostOnBackgroundThreadWithTraits( background_scheduler::PostOnBackgroundThreadWithTraits(
FROM_HERE, {base::TaskPriority::USER_BLOCKING, base::MayBlock()}, FROM_HERE, {base::TaskPriority::USER_BLOCKING, base::MayBlock()},
CrossThreadBind(RunBlockingScriptStreamingTask, CrossThreadBind(RunBlockingScriptStreamingTask,
WTF::Passed(std::move(script_streaming_task)), WTF::Passed(std::move(script_streaming_task)),
...@@ -476,7 +476,7 @@ void ScriptStreamer::NotifyFinished() { ...@@ -476,7 +476,7 @@ void ScriptStreamer::NotifyFinished() {
// The task creation shouldn't fail, since it didn't fail before during // The task creation shouldn't fail, since it didn't fail before during
// NotifyAppendData. // NotifyAppendData.
CHECK(script_streaming_task); CHECK(script_streaming_task);
BackgroundScheduler::PostOnBackgroundThreadWithTraits( background_scheduler::PostOnBackgroundThreadWithTraits(
FROM_HERE, {base::TaskPriority::USER_BLOCKING}, FROM_HERE, {base::TaskPriority::USER_BLOCKING},
CrossThreadBind(RunNonBlockingScriptStreamingTask, CrossThreadBind(RunNonBlockingScriptStreamingTask,
WTF::Passed(std::move(script_streaming_task)), WTF::Passed(std::move(script_streaming_task)),
......
...@@ -340,7 +340,7 @@ void CanvasAsyncBlobCreator::ScheduleAsyncBlobCreation(const double& quality) { ...@@ -340,7 +340,7 @@ void CanvasAsyncBlobCreator::ScheduleAsyncBlobCreation(const double& quality) {
WrapPersistent(this))); WrapPersistent(this)));
} else { } else {
BackgroundScheduler::PostOnBackgroundThread( background_scheduler::PostOnBackgroundThread(
FROM_HERE, FROM_HERE,
CrossThreadBind(&CanvasAsyncBlobCreator::EncodeImageOnEncoderThread, CrossThreadBind(&CanvasAsyncBlobCreator::EncodeImageOnEncoderThread,
WrapCrossThreadPersistent(this), quality)); WrapCrossThreadPersistent(this), quality));
......
...@@ -974,7 +974,7 @@ ScriptPromise ImageBitmap::CreateAsync(ImageElementBase* image, ...@@ -974,7 +974,7 @@ ScriptPromise ImageBitmap::CreateAsync(ImageElementBase* image,
draw_dst_rect, parsed_options.flip_y); draw_dst_rect, parsed_options.flip_y);
std::unique_ptr<ParsedOptions> passed_parsed_options = std::unique_ptr<ParsedOptions> passed_parsed_options =
std::make_unique<ParsedOptions>(parsed_options); std::make_unique<ParsedOptions>(parsed_options);
BackgroundScheduler::PostOnBackgroundThread( background_scheduler::PostOnBackgroundThread(
FROM_HERE, FROM_HERE,
CrossThreadBind(&RasterizeImageOnBackgroundThread, CrossThreadBind(&RasterizeImageOnBackgroundThread,
WrapCrossThreadPersistent(resolver), WrapCrossThreadPersistent(resolver),
......
...@@ -296,7 +296,7 @@ void ImageBitmapFactories::ImageBitmapLoader::ScheduleAsyncImageBitmapDecoding( ...@@ -296,7 +296,7 @@ void ImageBitmapFactories::ImageBitmapLoader::ScheduleAsyncImageBitmapDecoding(
DOMArrayBuffer* array_buffer) { DOMArrayBuffer* array_buffer) {
scoped_refptr<base::SingleThreadTaskRunner> task_runner = scoped_refptr<base::SingleThreadTaskRunner> task_runner =
Platform::Current()->CurrentThread()->GetTaskRunner(); Platform::Current()->CurrentThread()->GetTaskRunner();
BackgroundScheduler::PostOnBackgroundThread( background_scheduler::PostOnBackgroundThread(
FROM_HERE, FROM_HERE,
CrossThreadBind( CrossThreadBind(
&ImageBitmapFactories::ImageBitmapLoader::DecodeImageOnDecoderThread, &ImageBitmapFactories::ImageBitmapLoader::DecodeImageOnDecoderThread,
......
...@@ -162,7 +162,7 @@ void BackgroundFetchIconLoader::DidFinishLoading( ...@@ -162,7 +162,7 @@ void BackgroundFetchIconLoader::DidFinishLoading(
scoped_refptr<base::SingleThreadTaskRunner> task_runner = scoped_refptr<base::SingleThreadTaskRunner> task_runner =
Platform::Current()->CurrentThread()->GetTaskRunner(); Platform::Current()->CurrentThread()->GetTaskRunner();
BackgroundScheduler::PostOnBackgroundThread( background_scheduler::PostOnBackgroundThread(
FROM_HERE, FROM_HERE,
CrossThreadBind( CrossThreadBind(
&BackgroundFetchIconLoader::DecodeAndResizeImageOnBackgroundThread, &BackgroundFetchIconLoader::DecodeAndResizeImageOnBackgroundThread,
......
...@@ -55,7 +55,7 @@ void AsyncAudioDecoder::DecodeAsync( ...@@ -55,7 +55,7 @@ void AsyncAudioDecoder::DecodeAsync(
context->GetExecutionContext()->GetTaskRunner( context->GetExecutionContext()->GetTaskRunner(
blink::TaskType::kInternalMedia); blink::TaskType::kInternalMedia);
BackgroundScheduler::PostOnBackgroundThread( background_scheduler::PostOnBackgroundThread(
FROM_HERE, FROM_HERE,
CrossThreadBind(&AsyncAudioDecoder::DecodeOnBackgroundThread, CrossThreadBind(&AsyncAudioDecoder::DecodeOnBackgroundThread,
WrapCrossThreadPersistent(audio_data), sample_rate, WrapCrossThreadPersistent(audio_data), sample_rate,
......
...@@ -9,14 +9,15 @@ ...@@ -9,14 +9,15 @@
namespace blink { namespace blink {
void BackgroundScheduler::PostOnBackgroundThread(const base::Location& location, void background_scheduler::PostOnBackgroundThread(
CrossThreadClosure closure) { const base::Location& location,
CrossThreadClosure closure) {
PostOnBackgroundThreadWithTraits( PostOnBackgroundThreadWithTraits(
location, {base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, location, {base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
std::move(closure)); std::move(closure));
} }
void BackgroundScheduler::PostOnBackgroundThreadWithTraits( void background_scheduler::PostOnBackgroundThreadWithTraits(
const base::Location& location, const base::Location& location,
const base::TaskTraits& traits, const base::TaskTraits& traits,
CrossThreadClosure closure) { CrossThreadClosure closure) {
......
...@@ -24,7 +24,7 @@ void PingPongTask(WaitableEvent* done_event) { ...@@ -24,7 +24,7 @@ void PingPongTask(WaitableEvent* done_event) {
TEST(BackgroundSchedulerTest, RunOnBackgroundThread) { TEST(BackgroundSchedulerTest, RunOnBackgroundThread) {
base::test::ScopedTaskEnvironment scoped_task_environment; base::test::ScopedTaskEnvironment scoped_task_environment;
std::unique_ptr<WaitableEvent> done_event = std::make_unique<WaitableEvent>(); std::unique_ptr<WaitableEvent> done_event = std::make_unique<WaitableEvent>();
BackgroundScheduler::PostOnBackgroundThread( background_scheduler::PostOnBackgroundThread(
FROM_HERE, FROM_HERE,
CrossThreadBind(&PingPongTask, CrossThreadUnretained(done_event.get()))); CrossThreadBind(&PingPongTask, CrossThreadUnretained(done_event.get())));
// Test passes by not hanging on the following wait(). // Test passes by not hanging on the following wait().
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
namespace blink { namespace blink {
namespace BackgroundScheduler { namespace background_scheduler {
// These are a thin wrapper around base::TaskScheduler to accomodate // These are a thin wrapper around base::TaskScheduler to accomodate
// Blink's CrossThreadClosure, which only allows background tasks // Blink's CrossThreadClosure, which only allows background tasks
...@@ -31,7 +31,7 @@ PLATFORM_EXPORT void PostOnBackgroundThreadWithTraits(const base::Location&, ...@@ -31,7 +31,7 @@ PLATFORM_EXPORT void PostOnBackgroundThreadWithTraits(const base::Location&,
// TODO(altimin): Expose CreateBackgroundTaskRunnerWithTraits when the // TODO(altimin): Expose CreateBackgroundTaskRunnerWithTraits when the
// need arises. // need arises.
} // namespace BackgroundScheduler } // namespace background_scheduler
} // namespace blink } // namespace blink
......
...@@ -220,6 +220,7 @@ _CONFIG = [ ...@@ -220,6 +220,7 @@ _CONFIG = [
'url::.+', 'url::.+',
# Nested namespaces under the blink namespace # Nested namespaces under the blink namespace
'background_scheduler::.+',
'canvas_heuristic_parameters::.+', 'canvas_heuristic_parameters::.+',
'cssvalue::.+', 'cssvalue::.+',
'encoding::.+', 'encoding::.+',
......
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