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

Unified Diff: content/browser/gpu/gpu_process_host.h

Issue 9559013: Refactor GpuProcessHost::GetForClient to GpuProcessHost::Get, which takes a GPU process kind rather… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_process_host.h
===================================================================
--- content/browser/gpu/gpu_process_host.h (revision 123977)
+++ content/browser/gpu/gpu_process_host.h (working copy)
@@ -32,6 +32,11 @@
public IPC::Message::Sender,
public base::NonThreadSafe {
public:
+ enum Kind {
+ kSandboxed,
jam 2012/03/01 01:38:31 nit KIND_SANDBOXED per the chromium style guide. t
Ami GONE FROM CHROMIUM 2012/03/01 02:33:04 If you reversed the order then the old "sandboxed"
apatrick_chromium 2012/03/01 02:57:39 Good idea. Done.
+ kUnsandboxed
+ };
+
typedef base::Callback<void(const IPC::ChannelHandle&,
base::ProcessHandle,
const content::GPUInfo&)>
@@ -41,18 +46,17 @@
static bool gpu_enabled() { return gpu_enabled_; }
- // Creates a new GpuProcessHost or gets one for a particular client, resulting
- // in the launching of a GPU process if required. Returns null on failure. It
+ // Creates a new GpuProcessHost or gets an existing one, resulting in the
+ // launching of a GPU process if required. Returns null on failure. It
// is not safe to store the pointer once control has returned to the message
// loop as it can be destroyed. Instead store the associated GPU host ID.
// This could return NULL if GPU access is not allowed (blacklisted).
- static GpuProcessHost* GetForClient(int client_id,
- content::CauseForGpuLaunch cause);
+ static GpuProcessHost* Get(Kind kind, content::CauseForGpuLaunch cause);
// Helper function to send the given message to the GPU process on the IO
- // thread. Calls GetForClient and if a host is returned, sends it.
- // Can be called from any thread.
- CONTENT_EXPORT static void SendOnIO(int client_id,
+ // thread. Calls Get and if a host is returned, sends it. Can be called from
Ami GONE FROM CHROMIUM 2012/03/01 02:33:04 What a strange contract; Get() returning NULL is s
apatrick_chromium 2012/03/01 02:57:39 It handles Get returning NULL by deleting the mess
+ // any thread.
+ CONTENT_EXPORT static void SendOnIO(Kind kind,
content::CauseForGpuLaunch cause,
IPC::Message* message);
@@ -83,15 +87,15 @@
// Whether this GPU process is set up to use software rendering.
bool software_rendering();
- // Whether this GPU process is sandboxed.
- bool sandboxed();
+ // What kind of GPU process, e.g. sandboxed or unsandboxed.
+ Kind kind();
void ForceShutdown();
private:
static bool HostIsValid(GpuProcessHost* host);
- GpuProcessHost(int host_id, bool sandboxed);
+ GpuProcessHost(int host_id, Kind kind);
virtual ~GpuProcessHost();
bool Init();
@@ -162,7 +166,7 @@
bool in_process_;
bool software_rendering_;
- bool sandboxed_;
+ Kind kind_;
scoped_ptr<GpuMainThread> in_process_gpu_thread_;

Powered by Google App Engine
This is Rietveld 408576698