OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/metrics/profiler/content/content_tracking_synchronizer_dele
gate.h" | 5 #include "components/metrics/profiler/content/content_tracking_synchronizer_dele
gate.h" |
6 | 6 |
7 #include "components/metrics/profiler/tracking_synchronizer.h" | 7 #include "components/metrics/profiler/tracking_synchronizer.h" |
8 #include "components/nacl/common/nacl_process_type.h" | 8 #include "components/nacl/common/nacl_process_type.h" |
9 #include "content/public/browser/profiler_controller.h" | 9 #include "content/public/browser/profiler_controller.h" |
10 #include "content/public/common/process_type.h" | 10 #include "content/public/common/process_type.h" |
11 | 11 |
12 namespace metrics { | 12 namespace metrics { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 ProfilerEventProto::TrackedObject::ProcessType AsProtobufProcessType( | 16 ProfilerEventProto::TrackedObject::ProcessType AsProtobufProcessType( |
17 int process_type) { | 17 int process_type) { |
18 switch (process_type) { | 18 switch (process_type) { |
19 case content::PROCESS_TYPE_BROWSER: | 19 case content::PROCESS_TYPE_BROWSER: |
20 return ProfilerEventProto::TrackedObject::BROWSER; | 20 return ProfilerEventProto::TrackedObject::BROWSER; |
21 case content::PROCESS_TYPE_RENDERER: | 21 case content::PROCESS_TYPE_RENDERER: |
22 return ProfilerEventProto::TrackedObject::RENDERER; | 22 return ProfilerEventProto::TrackedObject::RENDERER; |
23 case content::PROCESS_TYPE_PLUGIN: | |
24 return ProfilerEventProto::TrackedObject::PLUGIN; | |
25 case content::PROCESS_TYPE_UTILITY: | 23 case content::PROCESS_TYPE_UTILITY: |
26 return ProfilerEventProto::TrackedObject::UTILITY; | 24 return ProfilerEventProto::TrackedObject::UTILITY; |
27 case content::PROCESS_TYPE_ZYGOTE: | 25 case content::PROCESS_TYPE_ZYGOTE: |
28 return ProfilerEventProto::TrackedObject::ZYGOTE; | 26 return ProfilerEventProto::TrackedObject::ZYGOTE; |
29 case content::PROCESS_TYPE_SANDBOX_HELPER: | 27 case content::PROCESS_TYPE_SANDBOX_HELPER: |
30 return ProfilerEventProto::TrackedObject::SANDBOX_HELPER; | 28 return ProfilerEventProto::TrackedObject::SANDBOX_HELPER; |
31 case content::PROCESS_TYPE_GPU: | 29 case content::PROCESS_TYPE_GPU: |
32 return ProfilerEventProto::TrackedObject::GPU; | 30 return ProfilerEventProto::TrackedObject::GPU; |
33 case content::PROCESS_TYPE_PPAPI_PLUGIN: | 31 case content::PROCESS_TYPE_PPAPI_PLUGIN: |
34 return ProfilerEventProto::TrackedObject::PPAPI_PLUGIN; | 32 return ProfilerEventProto::TrackedObject::PPAPI_PLUGIN; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void ContentTrackingSynchronizerDelegate::OnProfilerDataCollected( | 88 void ContentTrackingSynchronizerDelegate::OnProfilerDataCollected( |
91 int sequence_number, | 89 int sequence_number, |
92 const tracked_objects::ProcessDataSnapshot& profiler_data, | 90 const tracked_objects::ProcessDataSnapshot& profiler_data, |
93 content::ProcessType process_type) { | 91 content::ProcessType process_type) { |
94 // Notify |synchronizer_|. | 92 // Notify |synchronizer_|. |
95 synchronizer_->OnProfilerDataCollected(sequence_number, profiler_data, | 93 synchronizer_->OnProfilerDataCollected(sequence_number, profiler_data, |
96 AsProtobufProcessType(process_type)); | 94 AsProtobufProcessType(process_type)); |
97 } | 95 } |
98 | 96 |
99 } // namespace metrics | 97 } // namespace metrics |
OLD | NEW |