Commit ada604eb authored by Greg Kraynov's avatar Greg Kraynov Committed by Commit Bot

Blink Scheduler: Move common converter to tracing helper.

Follow-up for that CL:
https://chromium-review.googlesource.com/803797

So we shouldn't re-declare common function in different places
since it breaks jumbo build (where multiple .cc files get merged).

Change-Id: I68a3a75ca31a373557f3bb8106140828eae23da6
Reviewed-on: https://chromium-review.googlesource.com/811084Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Greg Kraynov <kraynov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522135}
parent 8a80410c
...@@ -19,11 +19,10 @@ CPUTimeBudgetPool::CPUTimeBudgetPool( ...@@ -19,11 +19,10 @@ CPUTimeBudgetPool::CPUTimeBudgetPool(
BudgetPoolController* budget_pool_controller, BudgetPoolController* budget_pool_controller,
base::TimeTicks now) base::TimeTicks now)
: BudgetPool(name, budget_pool_controller), : BudgetPool(name, budget_pool_controller),
current_budget_level_( current_budget_level_(base::TimeDelta(),
base::TimeDelta(), "RendererScheduler.BackgroundBudgetMs",
"RendererScheduler.BackgroundBudgetMs", budget_pool_controller,
budget_pool_controller, TimeDeltaToMilliseconds),
[](const base::TimeDelta& value) { return value.InMillisecondsF(); }),
last_checkpoint_(now), last_checkpoint_(now),
cpu_percentage_(1) {} cpu_percentage_(1) {}
......
...@@ -93,10 +93,6 @@ const char* YesNoStateToString(bool is_yes) { ...@@ -93,10 +93,6 @@ const char* YesNoStateToString(bool is_yes) {
} }
} }
double TimeDeltaToMilliseconds(const base::TimeDelta& value) {
return value.InMillisecondsF();
}
} // namespace } // namespace
RendererSchedulerImpl::RendererSchedulerImpl( RendererSchedulerImpl::RendererSchedulerImpl(
......
...@@ -57,5 +57,9 @@ std::string PointerToString(const void* pointer) { ...@@ -57,5 +57,9 @@ std::string PointerToString(const void* pointer) {
static_cast<uint64_t>(reinterpret_cast<uintptr_t>(pointer))); static_cast<uint64_t>(reinterpret_cast<uintptr_t>(pointer)));
} }
double TimeDeltaToMilliseconds(const base::TimeDelta& value) {
return value.InMillisecondsF();
}
} // namespace scheduler } // namespace scheduler
} // namespace blink } // namespace blink
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <string> #include <string>
#include "base/macros.h" #include "base/macros.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "platform/PlatformExport.h" #include "platform/PlatformExport.h"
...@@ -32,6 +33,8 @@ PLATFORM_EXPORT bool AreVerboseSnapshotsEnabled(); ...@@ -32,6 +33,8 @@ PLATFORM_EXPORT bool AreVerboseSnapshotsEnabled();
PLATFORM_EXPORT std::string PointerToString(const void* pointer); PLATFORM_EXPORT std::string PointerToString(const void* pointer);
PLATFORM_EXPORT double TimeDeltaToMilliseconds(const base::TimeDelta& value);
// TRACE_EVENT macros define static variable to cache a pointer to the state // TRACE_EVENT macros define static variable to cache a pointer to the state
// of category. Hence, we need distinct version for each category in order to // of category. Hence, we need distinct version for each category in order to
// prevent unintended leak of state. // prevent unintended leak of state.
......
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