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

Side by Side Diff: content/gpu/gpu_child_thread.h

Issue 1859403002: Avoid GpuPreferences exposed in content public gpu interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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_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 <queue> 10 #include <queue>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 // The main thread of the GPU child process. There will only ever be one of 50 // The main thread of the GPU child process. There will only ever be one of
51 // these per process. It does process initialization and shutdown. It forwards 51 // these per process. It does process initialization and shutdown. It forwards
52 // IPC messages to GpuChannelManager, which is responsible for issuing rendering 52 // IPC messages to GpuChannelManager, which is responsible for issuing rendering
53 // commands to the GPU. 53 // commands to the GPU.
54 class GpuChildThread : public ChildThreadImpl, 54 class GpuChildThread : public ChildThreadImpl,
55 public GpuChannelManagerDelegate { 55 public GpuChannelManagerDelegate {
56 public: 56 public:
57 typedef std::queue<IPC::Message*> DeferredMessages; 57 typedef std::queue<IPC::Message*> DeferredMessages;
58 58
59 static GpuChildThread* current();
Owen Lin 2016/04/08 01:31:57 please document it.
kcwu 2016/04/08 03:21:36 Done.
60
59 GpuChildThread(GpuWatchdogThread* gpu_watchdog_thread, 61 GpuChildThread(GpuWatchdogThread* gpu_watchdog_thread,
60 bool dead_on_arrival, 62 bool dead_on_arrival,
61 const gpu::GPUInfo& gpu_info, 63 const gpu::GPUInfo& gpu_info,
62 const DeferredMessages& deferred_messages, 64 const DeferredMessages& deferred_messages,
63 GpuMemoryBufferFactory* gpu_memory_buffer_factory, 65 GpuMemoryBufferFactory* gpu_memory_buffer_factory,
64 gpu::SyncPointManager* sync_point_manager); 66 gpu::SyncPointManager* sync_point_manager);
65 67
66 GpuChildThread(const gpu::GpuPreferences& gpu_preferences, 68 GpuChildThread(const gpu::GpuPreferences& gpu_preferences,
67 const InProcessChildThreadParams& params, 69 const InProcessChildThreadParams& params,
68 GpuMemoryBufferFactory* gpu_memory_buffer_factory, 70 GpuMemoryBufferFactory* gpu_memory_buffer_factory,
69 gpu::SyncPointManager* sync_point_manager); 71 gpu::SyncPointManager* sync_point_manager);
70 72
71 ~GpuChildThread() override; 73 ~GpuChildThread() override;
72 74
73 void Shutdown() override; 75 void Shutdown() override;
74 76
75 void Init(const base::Time& process_start_time); 77 void Init(const base::Time& process_start_time);
76 void StopWatchdog(); 78 void StopWatchdog();
77 79
80 gpu::GpuPreferences gpu_preferences() { return gpu_preferences_; }
81
78 private: 82 private:
79 // ChildThread overrides. 83 // ChildThread overrides.
80 bool Send(IPC::Message* msg) override; 84 bool Send(IPC::Message* msg) override;
81 bool OnControlMessageReceived(const IPC::Message& msg) override; 85 bool OnControlMessageReceived(const IPC::Message& msg) override;
82 bool OnMessageReceived(const IPC::Message& msg) override; 86 bool OnMessageReceived(const IPC::Message& msg) override;
83 87
84 // GpuChannelManagerDelegate implementation. 88 // GpuChannelManagerDelegate implementation.
85 void SetActiveURL(const GURL& url) override; 89 void SetActiveURL(const GURL& url) override;
86 void AddSubscription(int32_t client_id, unsigned int target) override; 90 void AddSubscription(int32_t client_id, unsigned int target) override;
87 void DidCreateOffscreenContext(const GURL& active_url) override; 91 void DidCreateOffscreenContext(const GURL& active_url) override;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 184
181 // Bindings to the mojom::ProcessControl impl. 185 // Bindings to the mojom::ProcessControl impl.
182 mojo::BindingSet<mojom::ProcessControl> process_control_bindings_; 186 mojo::BindingSet<mojom::ProcessControl> process_control_bindings_;
183 187
184 DISALLOW_COPY_AND_ASSIGN(GpuChildThread); 188 DISALLOW_COPY_AND_ASSIGN(GpuChildThread);
185 }; 189 };
186 190
187 } // namespace content 191 } // namespace content
188 192
189 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_ 193 #endif // CONTENT_GPU_GPU_CHILD_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698