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

Unified Diff: components/metrics/call_stack_profile_collector.h

Issue 2362493002: Stack sampling profiler: set process and thread information (Closed)
Patch Set: fix JankTimeBomb unit test 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
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..53a0c4a031ff99f8e0072bad3f6f7bb64b5048b9 100644
--- a/components/metrics/call_stack_profile_collector.h
+++ b/components/metrics/call_stack_profile_collector.h
@@ -14,10 +14,12 @@ class CallStackProfileCollector : public mojom::CallStackProfileCollector {
public:
using CallStackProfile = base::StackSamplingProfiler::CallStackProfile;
- CallStackProfileCollector();
+ CallStackProfileCollector(CallStackProfileParams::Process expected_process);
sky 2016/09/21 22:06:16 explicit
Mike Wittman 2016/09/21 22:26:21 Done.
~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 +27,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.
+ CallStackProfileParams::Process expected_process_;
sky 2016/09/21 22:06:16 const
Mike Wittman 2016/09/21 22:26:21 Done.
+
DISALLOW_COPY_AND_ASSIGN(CallStackProfileCollector);
};

Powered by Google App Engine
This is Rietveld 408576698