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

Unified Diff: third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc

Issue 2837323002: Merged all PointerToId functions into TraceHelper::PointerToString. (Closed)
Patch Set: Converted TraceHelper the class to trace_helper the namespace. 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: third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
index 1c3cd00bfe7a0303b2cde56241e11283888b371b..9223bb9625cb6ceb4305e8b195473e39fe554c9e 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
@@ -6,13 +6,12 @@
#include <cstdint>
-#include "base/format_macros.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/optional.h"
-#include "base/strings/stringprintf.h"
#include "platform/WebFrameScheduler.h"
#include "platform/scheduler/base/real_time_domain.h"
+#include "platform/scheduler/base/trace_helper.h"
#include "platform/scheduler/child/scheduler_tqm_delegate.h"
#include "platform/scheduler/renderer/budget_pool.h"
#include "platform/scheduler/renderer/renderer_scheduler_impl.h"
@@ -64,12 +63,6 @@ base::Optional<T> Max(const base::Optional<T>& a, const base::Optional<T>& b) {
return std::max(a.value(), b.value());
}
-std::string PointerToId(void* pointer) {
- return base::StringPrintf(
- "0x%" PRIx64,
- static_cast<uint64_t>(reinterpret_cast<uintptr_t>(pointer)));
-}
-
} // namespace
TaskQueueThrottler::TaskQueueThrottler(
@@ -441,7 +434,8 @@ void TaskQueueThrottler::AsValueInto(base::trace_event::TracedValue* state,
state->BeginDictionary("queue_details");
for (const auto& map_entry : queue_details_) {
- state->BeginDictionaryWithCopiedName(PointerToId(map_entry.first));
+ state->BeginDictionaryWithCopiedName(
+ trace_helper::PointerToString(map_entry.first));
state->SetInteger("throttling_ref_count",
map_entry.second.throttling_ref_count);

Powered by Google App Engine
This is Rietveld 408576698