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

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

Issue 2772193006: gpu: Replace GpuMsg_GpuSwitched with mojom api. (Closed)
Patch Set: Created 3 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_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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // has returned to the message loop as it can be destroyed. Instead store the 85 // has returned to the message loop as it can be destroyed. Instead store the
86 // associated GPU host ID. This could return NULL if GPU access is not 86 // associated GPU host ID. This could return NULL if GPU access is not
87 // allowed (blacklisted). 87 // allowed (blacklisted).
88 CONTENT_EXPORT static GpuProcessHost* Get(GpuProcessKind kind, 88 CONTENT_EXPORT static GpuProcessHost* Get(GpuProcessKind kind,
89 bool force_create = true); 89 bool force_create = true);
90 90
91 // Retrieves a list of process handles for all gpu processes. 91 // Retrieves a list of process handles for all gpu processes.
92 static void GetProcessHandles( 92 static void GetProcessHandles(
93 const GpuDataManager::GetGpuProcessHandlesCallback& callback); 93 const GpuDataManager::GetGpuProcessHandlesCallback& callback);
94 94
95 // Helper function to send the given message to the GPU process on the IO
96 // thread. Calls Get and if a host is returned, sends it. |force_create| can
97 // be set to force the creation of GpuProcessHost if one doesn't already
98 // exist. This function can be called from any thread. Deletes the message if
99 // it cannot be sent.
100 CONTENT_EXPORT static void SendOnIO(GpuProcessKind kind,
101 bool force_create,
102 IPC::Message* message);
103
104 // Helper function to run a callback on the IO thread. The callback receives 95 // Helper function to run a callback on the IO thread. The callback receives
105 // the appropriate GpuProcessHost instance. Note that the callback can be 96 // the appropriate GpuProcessHost instance. Note that the callback can be
106 // called with a null host (e.g. when |force_create| is false, and no 97 // called with a null host (e.g. when |force_create| is false, and no
107 // GpuProcessHost instance exists). 98 // GpuProcessHost instance exists).
108 CONTENT_EXPORT static void CallOnIO( 99 CONTENT_EXPORT static void CallOnIO(
109 GpuProcessKind kind, 100 GpuProcessKind kind,
110 bool force_create, 101 bool force_create,
111 const base::Callback<void(GpuProcessHost*)>& callback); 102 const base::Callback<void(GpuProcessHost*)>& callback);
112 103
113 service_manager::InterfaceProvider* GetRemoteInterfaces(); 104 service_manager::InterfaceProvider* GetRemoteInterfaces();
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 gpu::GpuProcessHostActivityFlags activity_flags_; 291 gpu::GpuProcessHostActivityFlags activity_flags_;
301 292
302 base::WeakPtrFactory<GpuProcessHost> weak_ptr_factory_; 293 base::WeakPtrFactory<GpuProcessHost> weak_ptr_factory_;
303 294
304 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); 295 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
305 }; 296 };
306 297
307 } // namespace content 298 } // namespace content
308 299
309 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 300 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698