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); |
}; |