• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef CONTENT_COMMON_GPU_DEVTOOLS_GPU_AGENT_H_
6 #define CONTENT_COMMON_GPU_DEVTOOLS_GPU_AGENT_H_
7 
8 #include "base/memory/scoped_ptr.h"
9 #include "base/threading/non_thread_safe.h"
10 #include "base/time/time.h"
11 #include "content/common/gpu/devtools_gpu_instrumentation.h"
12 
13 using base::TimeTicks;
14 struct GpuTaskInfo;
15 
16 namespace IPC {
17 class Message;
18 }
19 
20 namespace content {
21 
22 class GpuChannel;
23 class GpuCommandBufferStub;
24 
25 class DevToolsGpuAgent : public base::NonThreadSafe {
26  public:
27   explicit DevToolsGpuAgent(GpuChannel* gpu_channel);
28   virtual ~DevToolsGpuAgent();
29 
30   void ProcessEvent(TimeTicks timestamp,
31                     GpuEventsDispatcher::EventPhase,
32                     GpuCommandBufferStub* stub);
33 
34   void StartEventsRecording(int32* route_id);
35   void StopEventsRecording();
36 
37  private:
38   typedef std::vector<GpuTaskInfo> GpuTaskInfoList;
39 
40   bool Send(IPC::Message* msg);
41 
42   GpuChannel* gpu_channel_;
43   scoped_ptr<GpuTaskInfoList> tasks_;
44   TimeTicks last_flush_time_;
45   int32 route_id_;
46 
47   DISALLOW_COPY_AND_ASSIGN(DevToolsGpuAgent);
48 };
49 
50 }  // namespace content
51 
52 #endif  // CONTENT_COMMON_GPU_DEVTOOLS_GPU_AGENT_H_
53