| 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_GPU_GPU_CHILD_THREAD_H_ | 5 #ifndef CONTENT_GPU_GPU_CHILD_THREAD_H_ |
| 6 #define CONTENT_GPU_GPU_CHILD_THREAD_H_ | 6 #define CONTENT_GPU_GPU_CHILD_THREAD_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 public base::FieldTrialList::Observer { | 57 public base::FieldTrialList::Observer { |
| 58 public: | 58 public: |
| 59 typedef std::queue<IPC::Message*> DeferredMessages; | 59 typedef std::queue<IPC::Message*> DeferredMessages; |
| 60 | 60 |
| 61 GpuChildThread(gpu::GpuWatchdogThread* gpu_watchdog_thread, | 61 GpuChildThread(gpu::GpuWatchdogThread* gpu_watchdog_thread, |
| 62 bool dead_on_arrival, | 62 bool dead_on_arrival, |
| 63 const gpu::GPUInfo& gpu_info, | 63 const gpu::GPUInfo& gpu_info, |
| 64 const DeferredMessages& deferred_messages, | 64 const DeferredMessages& deferred_messages, |
| 65 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); | 65 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); |
| 66 | 66 |
| 67 GpuChildThread(const gpu::GpuPreferences& gpu_preferences, | 67 GpuChildThread(const InProcessChildThreadParams& params, |
| 68 const InProcessChildThreadParams& params, | |
| 69 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); | 68 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); |
| 70 | 69 |
| 71 ~GpuChildThread() override; | 70 ~GpuChildThread() override; |
| 72 | 71 |
| 73 void Shutdown() override; | 72 void Shutdown() override; |
| 74 | 73 |
| 75 void Init(const base::Time& process_start_time); | 74 void Init(const base::Time& process_start_time); |
| 76 void StopWatchdog(); | 75 void StopWatchdog(); |
| 77 | 76 |
| 78 gpu::GpuPreferences gpu_preferences() { return gpu_preferences_; } | |
| 79 | |
| 80 private: | 77 private: |
| 81 // ChildThreadImpl:. | 78 // ChildThreadImpl:. |
| 82 bool Send(IPC::Message* msg) override; | 79 bool Send(IPC::Message* msg) override; |
| 83 bool OnControlMessageReceived(const IPC::Message& msg) override; | 80 bool OnControlMessageReceived(const IPC::Message& msg) override; |
| 84 bool OnMessageReceived(const IPC::Message& msg) override; | 81 bool OnMessageReceived(const IPC::Message& msg) override; |
| 85 | 82 |
| 86 // gpu::GpuChannelManagerDelegate: | 83 // gpu::GpuChannelManagerDelegate: |
| 87 void SetActiveURL(const GURL& url) override; | 84 void SetActiveURL(const GURL& url) override; |
| 88 void DidCreateOffscreenContext(const GURL& active_url) override; | 85 void DidCreateOffscreenContext(const GURL& active_url) override; |
| 89 void DidDestroyChannel(int client_id) override; | 86 void DidDestroyChannel(int client_id) override; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 int client_id, | 122 int client_id, |
| 126 const gpu::SyncToken& sync_token); | 123 const gpu::SyncToken& sync_token); |
| 127 #if defined(OS_ANDROID) | 124 #if defined(OS_ANDROID) |
| 128 void OnWakeUpGpu(); | 125 void OnWakeUpGpu(); |
| 129 void OnDestroyingVideoSurface(int surface_id); | 126 void OnDestroyingVideoSurface(int surface_id); |
| 130 #endif | 127 #endif |
| 131 void OnLoseAllContexts(); | 128 void OnLoseAllContexts(); |
| 132 | 129 |
| 133 void BindServiceFactoryRequest(shell::mojom::ServiceFactoryRequest request); | 130 void BindServiceFactoryRequest(shell::mojom::ServiceFactoryRequest request); |
| 134 | 131 |
| 135 gpu::GpuPreferences gpu_preferences_; | |
| 136 | |
| 137 // Set this flag to true if a fatal error occurred before we receive the | 132 // Set this flag to true if a fatal error occurred before we receive the |
| 138 // OnInitialize message, in which case we just declare ourselves DOA. | 133 // OnInitialize message, in which case we just declare ourselves DOA. |
| 139 bool dead_on_arrival_; | 134 bool dead_on_arrival_; |
| 140 base::Time process_start_time_; | 135 base::Time process_start_time_; |
| 141 scoped_refptr<gpu::GpuWatchdogThread> watchdog_thread_; | 136 scoped_refptr<gpu::GpuWatchdogThread> watchdog_thread_; |
| 142 | 137 |
| 143 #if defined(OS_WIN) | 138 #if defined(OS_WIN) |
| 144 // Windows specific client sandbox interface. | 139 // Windows specific client sandbox interface. |
| 145 sandbox::TargetServices* target_services_; | 140 sandbox::TargetServices* target_services_; |
| 146 #endif | 141 #endif |
| (...skipping 22 matching lines...) Expand all Loading... |
| 169 | 164 |
| 170 // Bindings to the shell::mojom::ServiceFactory impl. | 165 // Bindings to the shell::mojom::ServiceFactory impl. |
| 171 mojo::BindingSet<shell::mojom::ServiceFactory> service_factory_bindings_; | 166 mojo::BindingSet<shell::mojom::ServiceFactory> service_factory_bindings_; |
| 172 | 167 |
| 173 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); | 168 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); |
| 174 }; | 169 }; |
| 175 | 170 |
| 176 } // namespace content | 171 } // namespace content |
| 177 | 172 |
| 178 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ | 173 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ |
| OLD | NEW |