| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/gpu/chrome_content_gpu_client.h" | 5 #include "chrome/gpu/chrome_content_gpu_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 g_call_stack_profile_collector = LAZY_INSTANCE_INITIALIZER; | 54 g_call_stack_profile_collector = LAZY_INSTANCE_INITIALIZER; |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| 57 | 57 |
| 58 ChromeContentGpuClient::ChromeContentGpuClient() | 58 ChromeContentGpuClient::ChromeContentGpuClient() |
| 59 : stack_sampling_profiler_( | 59 : stack_sampling_profiler_( |
| 60 base::PlatformThread::CurrentId(), | 60 base::PlatformThread::CurrentId(), |
| 61 GetStartupSamplingParams(), | 61 GetStartupSamplingParams(), |
| 62 g_call_stack_profile_collector.Get().GetProfilerCallback( | 62 g_call_stack_profile_collector.Get().GetProfilerCallback( |
| 63 metrics::CallStackProfileParams( | 63 metrics::CallStackProfileParams( |
| 64 metrics::CallStackProfileParams::GPU_PROCESS, |
| 65 metrics::CallStackProfileParams::GPU_MAIN_THREAD, |
| 64 metrics::CallStackProfileParams::PROCESS_STARTUP, | 66 metrics::CallStackProfileParams::PROCESS_STARTUP, |
| 65 metrics::CallStackProfileParams::MAY_SHUFFLE))) { | 67 metrics::CallStackProfileParams::MAY_SHUFFLE))) { |
| 66 } | 68 } |
| 67 | 69 |
| 68 ChromeContentGpuClient::~ChromeContentGpuClient() {} | 70 ChromeContentGpuClient::~ChromeContentGpuClient() {} |
| 69 | 71 |
| 70 void ChromeContentGpuClient::Initialize( | 72 void ChromeContentGpuClient::Initialize( |
| 71 base::FieldTrialList::Observer* observer) { | 73 base::FieldTrialList::Observer* observer) { |
| 72 DCHECK(!field_trial_syncer_); | 74 DCHECK(!field_trial_syncer_); |
| 73 field_trial_syncer_.reset( | 75 field_trial_syncer_.reset( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 88 #endif | 90 #endif |
| 89 } | 91 } |
| 90 | 92 |
| 91 void ChromeContentGpuClient::ConsumeInterfacesFromBrowser( | 93 void ChromeContentGpuClient::ConsumeInterfacesFromBrowser( |
| 92 shell::InterfaceProvider* provider) { | 94 shell::InterfaceProvider* provider) { |
| 93 metrics::mojom::CallStackProfileCollectorPtr browser_interface; | 95 metrics::mojom::CallStackProfileCollectorPtr browser_interface; |
| 94 provider->GetInterface(&browser_interface); | 96 provider->GetInterface(&browser_interface); |
| 95 g_call_stack_profile_collector.Get().SetParentProfileCollector( | 97 g_call_stack_profile_collector.Get().SetParentProfileCollector( |
| 96 std::move(browser_interface)); | 98 std::move(browser_interface)); |
| 97 } | 99 } |
| OLD | NEW |