OLD | NEW |
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_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/common/gpu/gpu_memory_allocation.h" | 17 #include "content/common/gpu/gpu_memory_allocation.h" |
18 #include "content/common/gpu/gpu_memory_allocation.h" | 18 #include "content/common/gpu/gpu_memory_allocation.h" |
| 19 #include "googleurl/src/gurl.h" |
19 #include "gpu/command_buffer/common/constants.h" | 20 #include "gpu/command_buffer/common/constants.h" |
20 #include "gpu/command_buffer/service/command_buffer_service.h" | 21 #include "gpu/command_buffer/service/command_buffer_service.h" |
21 #include "gpu/command_buffer/service/context_group.h" | 22 #include "gpu/command_buffer/service/context_group.h" |
22 #include "gpu/command_buffer/service/gpu_scheduler.h" | 23 #include "gpu/command_buffer/service/gpu_scheduler.h" |
23 #include "ipc/ipc_listener.h" | 24 #include "ipc/ipc_listener.h" |
24 #include "ipc/ipc_sender.h" | 25 #include "ipc/ipc_sender.h" |
25 #include "media/base/video_decoder_config.h" | 26 #include "media/base/video_decoder_config.h" |
26 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
27 #include "ui/gfx/size.h" | 28 #include "ui/gfx/size.h" |
28 #include "ui/gl/gl_context.h" | 29 #include "ui/gl/gl_context.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 const gfx::GLSurfaceHandle& handle, | 98 const gfx::GLSurfaceHandle& handle, |
98 gpu::gles2::MailboxManager* mailbox_manager, | 99 gpu::gles2::MailboxManager* mailbox_manager, |
99 const gfx::Size& size, | 100 const gfx::Size& size, |
100 const gpu::gles2::DisallowedFeatures& disallowed_features, | 101 const gpu::gles2::DisallowedFeatures& disallowed_features, |
101 const std::string& allowed_extensions, | 102 const std::string& allowed_extensions, |
102 const std::vector<int32>& attribs, | 103 const std::vector<int32>& attribs, |
103 gfx::GpuPreference gpu_preference, | 104 gfx::GpuPreference gpu_preference, |
104 int32 route_id, | 105 int32 route_id, |
105 int32 surface_id, | 106 int32 surface_id, |
106 GpuWatchdog* watchdog, | 107 GpuWatchdog* watchdog, |
107 bool software); | 108 bool software, |
| 109 const GURL& active_url); |
108 | 110 |
109 virtual ~GpuCommandBufferStub(); | 111 virtual ~GpuCommandBufferStub(); |
110 | 112 |
111 // IPC::Listener implementation: | 113 // IPC::Listener implementation: |
112 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 114 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
113 | 115 |
114 // IPC::Sender implementation: | 116 // IPC::Sender implementation: |
115 virtual bool Send(IPC::Message* msg) OVERRIDE; | 117 virtual bool Send(IPC::Message* msg) OVERRIDE; |
116 | 118 |
117 // GpuCommandBufferStubBase implementation: | 119 // GpuCommandBufferStubBase implementation: |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 224 |
223 void OnSetClientHasMemoryAllocationChangedCallback(bool); | 225 void OnSetClientHasMemoryAllocationChangedCallback(bool); |
224 | 226 |
225 void OnReschedule(); | 227 void OnReschedule(); |
226 | 228 |
227 void OnCommandProcessed(); | 229 void OnCommandProcessed(); |
228 void OnParseError(); | 230 void OnParseError(); |
229 | 231 |
230 void ReportState(); | 232 void ReportState(); |
231 | 233 |
| 234 // Wrapper for GpuScheduler::PutChanged that sets the crash report URL. |
| 235 void PutChanged(); |
| 236 |
232 // The lifetime of objects of this class is managed by a GpuChannel. The | 237 // The lifetime of objects of this class is managed by a GpuChannel. The |
233 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they | 238 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they |
234 // are destroyed. So a raw pointer is safe. | 239 // are destroyed. So a raw pointer is safe. |
235 GpuChannel* channel_; | 240 GpuChannel* channel_; |
236 | 241 |
237 // The group of contexts that share namespaces with this context. | 242 // The group of contexts that share namespaces with this context. |
238 scoped_refptr<gpu::gles2::ContextGroup> context_group_; | 243 scoped_refptr<gpu::gles2::ContextGroup> context_group_; |
239 | 244 |
240 gfx::GLSurfaceHandle handle_; | 245 gfx::GLSurfaceHandle handle_; |
241 gfx::Size initial_size_; | 246 gfx::Size initial_size_; |
(...skipping 27 matching lines...) Expand all Loading... |
269 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; | 274 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; |
270 | 275 |
271 ObserverList<DestructionObserver> destruction_observers_; | 276 ObserverList<DestructionObserver> destruction_observers_; |
272 | 277 |
273 // A queue of sync points associated with this stub. | 278 // A queue of sync points associated with this stub. |
274 std::deque<uint32> sync_points_; | 279 std::deque<uint32> sync_points_; |
275 int sync_point_wait_count_; | 280 int sync_point_wait_count_; |
276 | 281 |
277 scoped_refptr<gpu::RefCountedCounter> preempt_by_counter_; | 282 scoped_refptr<gpu::RefCountedCounter> preempt_by_counter_; |
278 | 283 |
| 284 GURL active_url_; |
| 285 size_t active_url_hash_; |
| 286 |
279 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 287 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
280 }; | 288 }; |
281 | 289 |
282 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 290 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |