Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: content/browser/gpu/gpu_process_host.h

Issue 383303004: Added more detailed result codes for CreateViewCommandBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Deleted commented-out code from test. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_GPU_GPU_PROCESS_HOST_H_ 5 #ifndef CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/containers/hash_tables.h" 14 #include "base/containers/hash_tables.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/threading/non_thread_safe.h" 16 #include "base/threading/non_thread_safe.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #include "content/browser/gpu/gpu_surface_tracker.h" 18 #include "content/browser/gpu/gpu_surface_tracker.h"
19 #include "content/common/content_export.h" 19 #include "content/common/content_export.h"
20 #include "content/common/gpu/gpu_memory_uma_stats.h" 20 #include "content/common/gpu/gpu_memory_uma_stats.h"
21 #include "content/common/gpu/gpu_process_launch_causes.h" 21 #include "content/common/gpu/gpu_process_launch_causes.h"
22 #include "content/common/gpu/gpu_result_codes.h"
22 #include "content/public/browser/browser_child_process_host_delegate.h" 23 #include "content/public/browser/browser_child_process_host_delegate.h"
23 #include "content/public/browser/gpu_data_manager.h" 24 #include "content/public/browser/gpu_data_manager.h"
24 #include "gpu/command_buffer/common/constants.h" 25 #include "gpu/command_buffer/common/constants.h"
25 #include "gpu/config/gpu_info.h" 26 #include "gpu/config/gpu_info.h"
26 #include "ipc/ipc_sender.h" 27 #include "ipc/ipc_sender.h"
27 #include "ipc/message_filter.h" 28 #include "ipc/message_filter.h"
28 #include "ui/gfx/native_widget_types.h" 29 #include "ui/gfx/native_widget_types.h"
29 #include "ui/gfx/size.h" 30 #include "ui/gfx/size.h"
30 #include "url/gurl.h" 31 #include "url/gurl.h"
31 32
(...skipping 24 matching lines...) Expand all
56 public: 57 public:
57 enum GpuProcessKind { 58 enum GpuProcessKind {
58 GPU_PROCESS_KIND_UNSANDBOXED, 59 GPU_PROCESS_KIND_UNSANDBOXED,
59 GPU_PROCESS_KIND_SANDBOXED, 60 GPU_PROCESS_KIND_SANDBOXED,
60 GPU_PROCESS_KIND_COUNT 61 GPU_PROCESS_KIND_COUNT
61 }; 62 };
62 63
63 typedef base::Callback<void(const IPC::ChannelHandle&, const gpu::GPUInfo&)> 64 typedef base::Callback<void(const IPC::ChannelHandle&, const gpu::GPUInfo&)>
64 EstablishChannelCallback; 65 EstablishChannelCallback;
65 66
66 typedef base::Callback<void(bool)> CreateCommandBufferCallback; 67 typedef base::Callback<void(CreateCommandBufferResult)>
68 CreateCommandBufferCallback;
67 69
68 typedef base::Callback<void(const gfx::Size)> CreateImageCallback; 70 typedef base::Callback<void(const gfx::Size)> CreateImageCallback;
69 71
70 typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)> 72 typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)>
71 CreateGpuMemoryBufferCallback; 73 CreateGpuMemoryBufferCallback;
72 74
73 static bool gpu_enabled() { return gpu_enabled_; } 75 static bool gpu_enabled() { return gpu_enabled_; }
74 76
75 // Creates a new GpuProcessHost or gets an existing one, resulting in the 77 // Creates a new GpuProcessHost or gets an existing one, resulting in the
76 // launching of a GPU process if required. Returns null on failure. It 78 // launching of a GPU process if required. Returns null on failure. It
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 167
166 // BrowserChildProcessHostDelegate implementation. 168 // BrowserChildProcessHostDelegate implementation.
167 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 169 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
168 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; 170 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
169 virtual void OnProcessLaunched() OVERRIDE; 171 virtual void OnProcessLaunched() OVERRIDE;
170 virtual void OnProcessCrashed(int exit_code) OVERRIDE; 172 virtual void OnProcessCrashed(int exit_code) OVERRIDE;
171 173
172 // Message handlers. 174 // Message handlers.
173 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info); 175 void OnInitialized(bool result, const gpu::GPUInfo& gpu_info);
174 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle); 176 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle);
175 void OnCommandBufferCreated(bool succeeded); 177 void OnCommandBufferCreated(CreateCommandBufferResult result);
176 void OnDestroyCommandBuffer(int32 surface_id); 178 void OnDestroyCommandBuffer(int32 surface_id);
177 void OnImageCreated(const gfx::Size size); 179 void OnImageCreated(const gfx::Size size);
178 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle); 180 void OnGpuMemoryBufferCreated(const gfx::GpuMemoryBufferHandle& handle);
179 void OnDidCreateOffscreenContext(const GURL& url); 181 void OnDidCreateOffscreenContext(const GURL& url);
180 void OnDidLoseContext(bool offscreen, 182 void OnDidLoseContext(bool offscreen,
181 gpu::error::ContextLostReason reason, 183 gpu::error::ContextLostReason reason,
182 const GURL& url); 184 const GURL& url);
183 void OnDidDestroyOffscreenContext(const GURL& url); 185 void OnDidDestroyOffscreenContext(const GURL& url);
184 void OnGpuMemoryUmaStatsReceived(const GPUMemoryUmaStats& stats); 186 void OnGpuMemoryUmaStatsReceived(const GPUMemoryUmaStats& stats);
185 #if defined(OS_MACOSX) 187 #if defined(OS_MACOSX)
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 typedef std::multimap<int, scoped_refptr<GpuSurfaceTracker::SurfaceRef> > 281 typedef std::multimap<int, scoped_refptr<GpuSurfaceTracker::SurfaceRef> >
280 SurfaceRefMap; 282 SurfaceRefMap;
281 SurfaceRefMap surface_refs_; 283 SurfaceRefMap surface_refs_;
282 284
283 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); 285 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
284 }; 286 };
285 287
286 } // namespace content 288 } // namespace content
287 289
288 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 290 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698