| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_PROFILER_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_PROFILER_MESSAGE_FILTER_H_ |
| 6 #define CONTENT_BROWSER_PROFILER_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_PROFILER_MESSAGE_FILTER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 | 11 |
| 12 #include "base/macros.h" |
| 10 #include "content/public/browser/browser_message_filter.h" | 13 #include "content/public/browser/browser_message_filter.h" |
| 11 #include "content/public/common/process_type.h" | 14 #include "content/public/common/process_type.h" |
| 12 | 15 |
| 13 namespace tracked_objects { | 16 namespace tracked_objects { |
| 14 struct ProcessDataSnapshot; | 17 struct ProcessDataSnapshot; |
| 15 } | 18 } |
| 16 | 19 |
| 17 namespace content { | 20 namespace content { |
| 18 | 21 |
| 19 // This class sends and receives profiler messages in the browser process. | 22 // This class sends and receives profiler messages in the browser process. |
| 20 class ProfilerMessageFilter : public BrowserMessageFilter { | 23 class ProfilerMessageFilter : public BrowserMessageFilter { |
| 21 public: | 24 public: |
| 22 explicit ProfilerMessageFilter(content::ProcessType process_type); | 25 explicit ProfilerMessageFilter(content::ProcessType process_type); |
| 23 | 26 |
| 24 // BrowserMessageFilter implementation. | 27 // BrowserMessageFilter implementation. |
| 25 void OnChannelConnected(int32 peer_pid) override; | 28 void OnChannelConnected(int32_t peer_pid) override; |
| 26 | 29 |
| 27 // BrowserMessageFilter implementation. | 30 // BrowserMessageFilter implementation. |
| 28 bool OnMessageReceived(const IPC::Message& message) override; | 31 bool OnMessageReceived(const IPC::Message& message) override; |
| 29 | 32 |
| 30 protected: | 33 protected: |
| 31 ~ProfilerMessageFilter() override; | 34 ~ProfilerMessageFilter() override; |
| 32 | 35 |
| 33 private: | 36 private: |
| 34 // Message handlers. | 37 // Message handlers. |
| 35 void OnChildProfilerData( | 38 void OnChildProfilerData( |
| 36 int sequence_number, | 39 int sequence_number, |
| 37 const tracked_objects::ProcessDataSnapshot& profiler_data); | 40 const tracked_objects::ProcessDataSnapshot& profiler_data); |
| 38 | 41 |
| 39 content::ProcessType process_type_; | 42 content::ProcessType process_type_; |
| 40 | 43 |
| 41 DISALLOW_COPY_AND_ASSIGN(ProfilerMessageFilter); | 44 DISALLOW_COPY_AND_ASSIGN(ProfilerMessageFilter); |
| 42 }; | 45 }; |
| 43 | 46 |
| 44 } // namespace content | 47 } // namespace content |
| 45 | 48 |
| 46 #endif // CONTENT_BROWSER_PROFILER_MESSAGE_FILTER_H_ | 49 #endif // CONTENT_BROWSER_PROFILER_MESSAGE_FILTER_H_ |
| OLD | NEW |