Chromium Code Reviews| Index: components/metrics/call_stack_profile_metrics_provider_unittest.cc |
| diff --git a/components/metrics/call_stack_profile_metrics_provider_unittest.cc b/components/metrics/call_stack_profile_metrics_provider_unittest.cc |
| index a974b2d39770b1a4a98a2c4d08ad2b14e8599ded..377f57c446afd6cf4fe65d19baa96a9a017b2660 100644 |
| --- a/components/metrics/call_stack_profile_metrics_provider_unittest.cc |
| +++ b/components/metrics/call_stack_profile_metrics_provider_unittest.cc |
| @@ -66,7 +66,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) { |
| const Module profile_modules[][2] = { |
| { |
| Module( |
| - reinterpret_cast<const void*>(module1_base_address), |
| + module1_base_address, |
| "ABCD", |
| #if defined(OS_WIN) |
| base::FilePath(L"c:\\some\\path\\to\\chrome.exe") |
| @@ -75,7 +75,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) { |
| #endif |
| ), |
| Module( |
| - reinterpret_cast<const void*>(module2_base_address), |
| + module2_base_address, |
| "EFGH", |
| #if defined(OS_WIN) |
| base::FilePath(L"c:\\some\\path\\to\\third_party.dll") |
| @@ -86,7 +86,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) { |
| }, |
| { |
| Module( |
| - reinterpret_cast<const void*>(module3_base_address), |
| + module3_base_address, |
| "MNOP", |
| #if defined(OS_WIN) |
| base::FilePath(L"c:\\some\\path\\to\\third_party2.dll") |
| @@ -95,7 +95,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) { |
| #endif |
| ), |
| Module( // Repeated from the first profile. |
| - reinterpret_cast<const void*>(module1_base_address), |
| + module1_base_address, |
| "ABCD", |
| #if defined(OS_WIN) |
| base::FilePath(L"c:\\some\\path\\to\\chrome.exe") |
| @@ -148,26 +148,26 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) { |
| const Frame profile_sample_frames[][2][3] = { |
| { |
| { |
| - Frame(reinterpret_cast<const void*>(module1_base_address + 0x10), 0), |
| - Frame(reinterpret_cast<const void*>(module2_base_address + 0x20), 1), |
| - Frame(reinterpret_cast<const void*>(module1_base_address + 0x30), 0) |
| + Frame(module1_base_address + 0x10, 0), |
| + Frame(module2_base_address + 0x20, 1), |
| + Frame(module1_base_address + 0x30, 0) |
| }, |
| { |
| - Frame(reinterpret_cast<const void*>(module2_base_address + 0x10), 1), |
| - Frame(reinterpret_cast<const void*>(module1_base_address + 0x20), 0), |
| - Frame(reinterpret_cast<const void*>(module2_base_address + 0x30), 1) |
| + Frame(module2_base_address + 0x10, 1), |
| + Frame(module1_base_address + 0x20, 0), |
| + Frame(module2_base_address + 0x30, 1) |
| } |
| }, |
| { |
| { |
| - Frame(reinterpret_cast<const void*>(module3_base_address + 0x10), 0), |
| - Frame(reinterpret_cast<const void*>(module1_base_address + 0x20), 1), |
| - Frame(reinterpret_cast<const void*>(module3_base_address + 0x30), 0) |
| + Frame(module3_base_address + 0x10, 0), |
| + Frame(module1_base_address + 0x20, 1), |
| + Frame(module3_base_address + 0x30, 0) |
| }, |
| { |
| - Frame(reinterpret_cast<const void*>(module1_base_address + 0x10), 1), |
| - Frame(reinterpret_cast<const void*>(module3_base_address + 0x20), 0), |
| - Frame(reinterpret_cast<const void*>(module1_base_address + 0x30), 1) |
| + Frame(module1_base_address + 0x10, 1), |
| + Frame(module3_base_address + 0x20, 0), |
| + Frame(module1_base_address + 0x30, 1) |
| } |
| } |
| }; |
| @@ -276,7 +276,7 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksUnordered) { |
| const Module modules[] = { |
| Module( |
| - reinterpret_cast<const void*>(module_base_address), |
| + module_base_address, |
| "ABCD", |
| #if defined(OS_WIN) |
| base::FilePath(L"c:\\some\\path\\to\\chrome.exe") |
| @@ -288,10 +288,10 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksUnordered) { |
| // Duplicate samples in slots 0, 2, and 3. |
| const Frame sample_frames[][1] = { |
| - { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), }, |
| - { Frame(reinterpret_cast<const void*>(module_base_address + 0x20), 0), }, |
| - { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), }, |
| - { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0) } |
| + { Frame(module_base_address + 0x10, 0), }, |
| + { Frame(module_base_address + 0x20, 0), }, |
| + { Frame(module_base_address + 0x10, 0), }, |
| + { Frame(module_base_address + 0x10, 0) } |
| }; |
| Profile profile; |
| @@ -354,7 +354,7 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksOrdered) { |
| const Module modules[] = { |
| Module( |
| - reinterpret_cast<const void*>(module_base_address), |
| + module_base_address, |
| "ABCD", |
| #if defined(OS_WIN) |
| base::FilePath(L"c:\\some\\path\\to\\chrome.exe") |
| @@ -366,10 +366,10 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksOrdered) { |
| // Duplicate samples in slots 0, 2, and 3. |
| const Frame sample_frames[][1] = { |
| - { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), }, |
| - { Frame(reinterpret_cast<const void*>(module_base_address + 0x20), 0), }, |
| - { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), }, |
| - { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0) } |
| + { Frame(module_base_address + 0x10, 0), }, |
| + { Frame(module_base_address + 0x20, 0), }, |
| + { Frame(module_base_address + 0x10, 0), }, |
| + { Frame(module_base_address + 0x10, 0) } |
| }; |
| Profile profile; |
| @@ -427,8 +427,7 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksOrdered) { |
| // Checks that unknown modules produce an empty Entry. |
| TEST_F(CallStackProfileMetricsProviderTest, UnknownModule) { |
| - const Frame frame(reinterpret_cast<const void*>(0x1000), |
| - Frame::kUnknownModuleIndex); |
| + const Frame frame(0x1000, Frame::kUnknownModuleIndex); |
| Profile profile; |
| @@ -468,7 +467,7 @@ TEST_F(CallStackProfileMetricsProviderTest, ProfilesProvidedOnlyOnce) { |
| for (int i = 0; i < 2; ++i) { |
| Profile profile; |
| profile.samples.push_back(Sample(1, Frame( |
| - reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex))); |
| + 0x1000, Frame::kUnknownModuleIndex))); |
|
Mike Wittman
2015/09/01 01:42:15
nit: move first arg to previous line (and second,
sydli
2015/09/03 16:21:15
Ran git cl format.
Mike Wittman
2015/09/03 16:58:03
This is fine for this change and below, but has in
|
| profile.profile_duration = base::TimeDelta::FromMilliseconds(100); |
| // Use the sampling period to distinguish the two profiles. |
| @@ -496,7 +495,7 @@ TEST_F(CallStackProfileMetricsProviderTest, |
| ProfilesProvidedWhenCollectedBeforeInstantiation) { |
| Profile profile; |
| profile.samples.push_back(Sample(1, Frame( |
| - reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex))); |
| + 0x1000, Frame::kUnknownModuleIndex))); |
| profile.profile_duration = base::TimeDelta::FromMilliseconds(100); |
| profile.sampling_period = base::TimeDelta::FromMilliseconds(10); |
| @@ -517,7 +516,7 @@ TEST_F(CallStackProfileMetricsProviderTest, |
| TEST_F(CallStackProfileMetricsProviderTest, ProfilesNotProvidedWhileDisabled) { |
| Profile profile; |
| profile.samples.push_back(Sample(1, Frame( |
| - reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex))); |
| + 0x1000, Frame::kUnknownModuleIndex))); |
| profile.profile_duration = base::TimeDelta::FromMilliseconds(100); |
| profile.sampling_period = base::TimeDelta::FromMilliseconds(10); |
| @@ -538,7 +537,7 @@ TEST_F(CallStackProfileMetricsProviderTest, |
| ProfilesNotProvidedAfterChangeToDisabled) { |
| Profile profile; |
| profile.samples.push_back(Sample(1, Frame( |
| - reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex))); |
| + 0x1000, Frame::kUnknownModuleIndex))); |
| profile.profile_duration = base::TimeDelta::FromMilliseconds(100); |
| profile.sampling_period = base::TimeDelta::FromMilliseconds(10); |
| @@ -563,7 +562,7 @@ TEST_F(CallStackProfileMetricsProviderTest, |
| ProfilesNotProvidedAfterChangeToDisabledThenEnabled) { |
| Profile profile; |
| profile.samples.push_back(Sample(1, Frame( |
| - reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex))); |
| + 0x1000, Frame::kUnknownModuleIndex))); |
| profile.profile_duration = base::TimeDelta::FromMilliseconds(100); |
| profile.sampling_period = base::TimeDelta::FromMilliseconds(10); |
| @@ -589,7 +588,7 @@ TEST_F(CallStackProfileMetricsProviderTest, |
| ProfilesNotProvidedAfterChangeFromDisabled) { |
| Profile profile; |
| profile.samples.push_back(Sample(1, Frame( |
| - reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex))); |
| + 0x1000, Frame::kUnknownModuleIndex))); |
| profile.profile_duration = base::TimeDelta::FromMilliseconds(100); |
| profile.sampling_period = base::TimeDelta::FromMilliseconds(10); |