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

Unified Diff: components/metrics/call_stack_profile_collector.h

Issue 2362493002: Stack sampling profiler: set process and thread information (Closed)
Patch Set: address comments Created 4 years, 3 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
« no previous file with comments | « chrome/gpu/chrome_content_gpu_client.cc ('k') | components/metrics/call_stack_profile_collector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/call_stack_profile_collector.h
diff --git a/components/metrics/call_stack_profile_collector.h b/components/metrics/call_stack_profile_collector.h
index cfae8c8f9e05351a09e877029141faf18305c52b..f6a2ca1ce53925053a1e89ccbb4fb29cefa3486a 100644
--- a/components/metrics/call_stack_profile_collector.h
+++ b/components/metrics/call_stack_profile_collector.h
@@ -14,10 +14,13 @@ class CallStackProfileCollector : public mojom::CallStackProfileCollector {
public:
using CallStackProfile = base::StackSamplingProfiler::CallStackProfile;
- CallStackProfileCollector();
+ explicit CallStackProfileCollector(
+ CallStackProfileParams::Process expected_process);
~CallStackProfileCollector() override;
- static void Create(mojom::CallStackProfileCollectorRequest request);
+ // Create a collector to receive profiles from |expected_process|.
+ static void Create(CallStackProfileParams::Process expected_process,
+ mojom::CallStackProfileCollectorRequest request);
// mojom::CallStackProfileCollector:
void Collect(const CallStackProfileParams& params,
@@ -25,6 +28,11 @@ class CallStackProfileCollector : public mojom::CallStackProfileCollector {
const std::vector<CallStackProfile>& profiles) override;
private:
+ // Profile params are validated to come from this process. Profiles with a
+ // different process declared in the params are considered untrustworthy and
+ // ignored.
+ const CallStackProfileParams::Process expected_process_;
+
DISALLOW_COPY_AND_ASSIGN(CallStackProfileCollector);
};
« no previous file with comments | « chrome/gpu/chrome_content_gpu_client.cc ('k') | components/metrics/call_stack_profile_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698