Commit 733de146 authored by Xi Cheng's avatar Xi Cheng Committed by Commit Bot

Remove redundant function param in GetProfilerCallback()

Bug: 851163
Change-Id: I93d7ea84b7a3b99058a4a619782501aba2e0f21f
Reviewed-on: https://chromium-review.googlesource.com/1174976Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Commit-Queue: Xi Cheng <chengx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583122}
parent 03ea533a
...@@ -235,13 +235,12 @@ ThreadProfiler::GetReceiverCallback() { ...@@ -235,13 +235,12 @@ ThreadProfiler::GetReceiverCallback() {
// metrics::SampledProfile profile); // metrics::SampledProfile profile);
// //
// and this function should bind base::TimeTicks::Now() to those functions. // and this function should bind base::TimeTicks::Now() to those functions.
base::TimeTicks profile_start_time = base::TimeTicks::Now();
if (GetProcess() == CallStackProfileParams::BROWSER_PROCESS) { if (GetProcess() == CallStackProfileParams::BROWSER_PROCESS) {
return metrics::CallStackProfileMetricsProvider:: return metrics::CallStackProfileMetricsProvider::
GetProfilerCallbackForBrowserProcess(); GetProfilerCallbackForBrowserProcess();
} }
return g_child_call_stack_profile_collector.Get() return g_child_call_stack_profile_collector.Get()
.ChildCallStackProfileCollector::GetProfilerCallback(profile_start_time); .ChildCallStackProfileCollector::GetProfilerCallback();
} }
// static // static
......
...@@ -35,11 +35,10 @@ ChildCallStackProfileCollector::ChildCallStackProfileCollector() {} ...@@ -35,11 +35,10 @@ ChildCallStackProfileCollector::ChildCallStackProfileCollector() {}
ChildCallStackProfileCollector::~ChildCallStackProfileCollector() {} ChildCallStackProfileCollector::~ChildCallStackProfileCollector() {}
CallStackProfileBuilder::CompletedCallback CallStackProfileBuilder::CompletedCallback
ChildCallStackProfileCollector::GetProfilerCallback( ChildCallStackProfileCollector::GetProfilerCallback() {
base::TimeTicks profile_start_time) {
return base::Bind(&ChildCallStackProfileCollector::Collect, return base::Bind(&ChildCallStackProfileCollector::Collect,
// This class has lazy instance lifetime. // This class has lazy instance lifetime.
base::Unretained(this), profile_start_time); base::Unretained(this), base::TimeTicks::Now());
} }
void ChildCallStackProfileCollector::SetParentProfileCollector( void ChildCallStackProfileCollector::SetParentProfileCollector(
......
...@@ -56,8 +56,7 @@ class ChildCallStackProfileCollector { ...@@ -56,8 +56,7 @@ class ChildCallStackProfileCollector {
// completed profile to this object. The callback should be immediately passed // completed profile to this object. The callback should be immediately passed
// to the CallStackProfileBuilder, and should not be reused between // to the CallStackProfileBuilder, and should not be reused between
// CallStackProfileBuilders. This function may be called on any thread. // CallStackProfileBuilders. This function may be called on any thread.
CallStackProfileBuilder::CompletedCallback GetProfilerCallback( CallStackProfileBuilder::CompletedCallback GetProfilerCallback();
base::TimeTicks profile_start_time);
// Sets the CallStackProfileCollector interface from |parent_collector|. This // Sets the CallStackProfileCollector interface from |parent_collector|. This
// function MUST be invoked exactly once, regardless of whether // function MUST be invoked exactly once, regardless of whether
......
...@@ -42,8 +42,7 @@ class ChildCallStackProfileCollectorTest : public testing::Test { ...@@ -42,8 +42,7 @@ class ChildCallStackProfileCollectorTest : public testing::Test {
: receiver_impl_(new Receiver(MakeRequest(&receiver_))) {} : receiver_impl_(new Receiver(MakeRequest(&receiver_))) {}
void CollectEmptyProfile() { void CollectEmptyProfile() {
child_collector_.GetProfilerCallback(base::TimeTicks::Now()) child_collector_.GetProfilerCallback().Run(SampledProfile());
.Run(SampledProfile());
} }
const std::vector<ChildCallStackProfileCollector::ProfileState>& profiles() const std::vector<ChildCallStackProfileCollector::ProfileState>& profiles()
......
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