| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_GPU_GPU_THREAD_H_ | 5 #ifndef CHROME_GPU_GPU_THREAD_H_ |
| 6 #define CHROME_GPU_GPU_THREAD_H_ | 6 #define CHROME_GPU_GPU_THREAD_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 void RemoveChannel(int renderer_id); | 42 void RemoveChannel(int renderer_id); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 // ChildThread overrides. | 45 // ChildThread overrides. |
| 46 virtual bool OnControlMessageReceived(const IPC::Message& msg); | 46 virtual bool OnControlMessageReceived(const IPC::Message& msg); |
| 47 | 47 |
| 48 // Message handlers. | 48 // Message handlers. |
| 49 void OnInitialize(); | 49 void OnInitialize(); |
| 50 void OnEstablishChannel(int renderer_id); | 50 void OnEstablishChannel(int renderer_id); |
| 51 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); | 51 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); |
| 52 void OnSetTraceEnabled(bool enabled); |
| 52 void OnSynchronize(); | 53 void OnSynchronize(); |
| 53 void OnCollectGraphicsInfo(GPUInfo::Level level); | 54 void OnCollectGraphicsInfo(GPUInfo::Level level); |
| 54 void OnCreateViewCommandBuffer( | 55 void OnCreateViewCommandBuffer( |
| 55 gfx::PluginWindowHandle window, | 56 gfx::PluginWindowHandle window, |
| 56 int32 render_view_id, | 57 int32 render_view_id, |
| 57 int32 renderer_id, | 58 int32 renderer_id, |
| 58 const GPUCreateCommandBufferConfig& init_params); | 59 const GPUCreateCommandBufferConfig& init_params); |
| 59 #if defined(OS_MACOSX) | 60 #if defined(OS_MACOSX) |
| 60 void OnAcceleratedSurfaceBuffersSwappedACK( | 61 void OnAcceleratedSurfaceBuffersSwappedACK( |
| 61 int renderer_id, int32 route_id, uint64 swap_buffers_count); | 62 int renderer_id, int32 route_id, uint64 swap_buffers_count); |
| 62 void OnDidDestroyAcceleratedSurface(int renderer_id, int32 renderer_route_id); | 63 void OnDidDestroyAcceleratedSurface(int renderer_id, int32 renderer_route_id); |
| 63 #endif | 64 #endif |
| 64 void OnCrash(); | 65 void OnCrash(); |
| 65 void OnHang(); | 66 void OnHang(); |
| 66 | 67 |
| 68 void OnTraceDataCollected(const std::string& json_events); |
| 69 |
| 67 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
| 68 static void CollectDxDiagnostics(GpuThread* thread); | 71 static void CollectDxDiagnostics(GpuThread* thread); |
| 69 static void SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node); | 72 static void SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node); |
| 70 #endif | 73 #endif |
| 71 | 74 |
| 72 base::Time process_start_time_; | 75 base::Time process_start_time_; |
| 73 scoped_refptr<GpuWatchdogThread> watchdog_thread_; | 76 scoped_refptr<GpuWatchdogThread> watchdog_thread_; |
| 74 | 77 |
| 75 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; | 78 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; |
| 76 GpuChannelMap gpu_channels_; | 79 GpuChannelMap gpu_channels_; |
| 77 | 80 |
| 78 // Information about the GPU, such as device and vendor ID. | 81 // Information about the GPU, such as device and vendor ID. |
| 79 GPUInfo gpu_info_; | 82 GPUInfo gpu_info_; |
| 80 | 83 |
| 81 DISALLOW_COPY_AND_ASSIGN(GpuThread); | 84 DISALLOW_COPY_AND_ASSIGN(GpuThread); |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 #endif // CHROME_GPU_GPU_THREAD_H_ | 87 #endif // CHROME_GPU_GPU_THREAD_H_ |
| OLD | NEW |