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