OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/task_scheduler/environment_config.h" |
| 6 |
| 7 namespace base { |
| 8 namespace internal { |
| 9 |
| 10 size_t GetEnvironmentIndexForTraits(const TaskTraits& traits) { |
| 11 const bool is_background = |
| 12 traits.priority() == base::TaskPriority::BACKGROUND; |
| 13 if (traits.may_block() || traits.with_base_sync_primitives()) |
| 14 return is_background ? BACKGROUND_BLOCKING : FOREGROUND_BLOCKING; |
| 15 return is_background ? BACKGROUND : FOREGROUND; |
| 16 } |
| 17 |
| 18 } // namespace internal |
| 19 } // namespace base |
OLD | NEW |