• 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 
24 class DevToolsGpuAgent : public base::NonThreadSafe {
25  public:
26   explicit DevToolsGpuAgent(GpuChannel* gpu_channel);
27   virtual ~DevToolsGpuAgent();
28 
29   void ProcessEvent(TimeTicks timestamp,
30                     GpuEventsDispatcher::EventPhase,
31                     GpuChannel* channel);
32 
33   bool StartEventsRecording(int32 route_id);
34   void StopEventsRecording();
35 
36  private:
37   typedef std::vector<GpuTaskInfo> GpuTaskInfoList;
38 
39   bool Send(IPC::Message* msg);
40 
41   GpuChannel* gpu_channel_;
42   scoped_ptr<GpuTaskInfoList> tasks_;
43   TimeTicks last_flush_time_;
44   int32 route_id_;
45 
46   DISALLOW_COPY_AND_ASSIGN(DevToolsGpuAgent);
47 };
48 
49 }  // namespace content
50 
51 #endif  // CONTENT_COMMON_GPU_DEVTOOLS_GPU_AGENT_H_
52