| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COMMON_GPU_DEVTOOLS_GPU_AGENT_H_ | 5 #ifndef CONTENT_COMMON_GPU_DEVTOOLS_GPU_AGENT_H_ |
| 6 #define CONTENT_COMMON_GPU_DEVTOOLS_GPU_AGENT_H_ | 6 #define CONTENT_COMMON_GPU_DEVTOOLS_GPU_AGENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/process/process.h" |
| 9 #include "base/threading/non_thread_safe.h" | 10 #include "base/threading/non_thread_safe.h" |
| 10 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 11 #include "content/common/gpu/devtools_gpu_instrumentation.h" | 12 #include "content/common/gpu/devtools_gpu_instrumentation.h" |
| 12 | 13 |
| 13 using base::TimeTicks; | 14 using base::TimeTicks; |
| 14 struct GpuTaskInfo; | 15 struct GpuTaskInfo; |
| 15 | 16 |
| 16 namespace IPC { | 17 namespace IPC { |
| 17 class Message; | 18 class Message; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 | 22 |
| 22 class GpuChannel; | 23 class GpuChannel; |
| 23 | 24 |
| 24 class DevToolsGpuAgent : public base::NonThreadSafe { | 25 class DevToolsGpuAgent : public base::NonThreadSafe { |
| 25 public: | 26 public: |
| 26 explicit DevToolsGpuAgent(GpuChannel* gpu_channel); | 27 explicit DevToolsGpuAgent(GpuChannel* gpu_channel); |
| 27 virtual ~DevToolsGpuAgent(); | 28 virtual ~DevToolsGpuAgent(); |
| 28 | 29 |
| 29 void ProcessEvent(TimeTicks timestamp, | 30 void ProcessEvent(TimeTicks timestamp, |
| 30 GpuEventsDispatcher::EventPhase, | 31 GpuEventsDispatcher::EventPhase, |
| 31 int owner_pid); | 32 base::ProcessId owner_pid); |
| 32 | 33 |
| 33 void StartEventsRecording(int32* route_id); | 34 void StartEventsRecording(int32* route_id); |
| 34 void StopEventsRecording(); | 35 void StopEventsRecording(); |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 typedef std::vector<GpuTaskInfo> GpuTaskInfoList; | 38 typedef std::vector<GpuTaskInfo> GpuTaskInfoList; |
| 38 | 39 |
| 39 bool Send(IPC::Message* msg); | 40 bool Send(IPC::Message* msg); |
| 40 | 41 |
| 41 GpuChannel* gpu_channel_; | 42 GpuChannel* gpu_channel_; |
| 42 scoped_ptr<GpuTaskInfoList> tasks_; | 43 scoped_ptr<GpuTaskInfoList> tasks_; |
| 43 TimeTicks last_flush_time_; | 44 TimeTicks last_flush_time_; |
| 44 int32 route_id_; | 45 int32 route_id_; |
| 45 | 46 |
| 46 DISALLOW_COPY_AND_ASSIGN(DevToolsGpuAgent); | 47 DISALLOW_COPY_AND_ASSIGN(DevToolsGpuAgent); |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 } // namespace content | 50 } // namespace content |
| 50 | 51 |
| 51 #endif // CONTENT_COMMON_GPU_DEVTOOLS_GPU_AGENT_H_ | 52 #endif // CONTENT_COMMON_GPU_DEVTOOLS_GPU_AGENT_H_ |
| OLD | NEW |