summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu/gpu_process_host.h
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 19:08:18 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 19:08:18 +0000
commit7854d043f3302087ae6acc9cd4221bf2013e42e2 (patch)
treea4173c4fca32d6d1c07b54c0d2d4269b3fb0850d /content/browser/gpu/gpu_process_host.h
parent734600a59c33f5ce78186b49d4d2ebdc113ee754 (diff)
downloadchromium_src-7854d043f3302087ae6acc9cd4221bf2013e42e2.zip
chromium_src-7854d043f3302087ae6acc9cd4221bf2013e42e2.tar.gz
chromium_src-7854d043f3302087ae6acc9cd4221bf2013e42e2.tar.bz2
Refactor GpuProcessHost::GetForClient to GpuProcessHost::Get, which takes a GPU process kind rather than a client ID.
There is no longer a plan to have a GPU process for each client to identify the GPU process by its kind (sandboxed or unsandboxed) rather than client ID. I checked about:gpu still works and that the limit on the number of times the sandboxed GPU is relaunched is still limitted. Review URL: https://chromiumcodereview.appspot.com/9559013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu/gpu_process_host.h')
-rw-r--r--content/browser/gpu/gpu_process_host.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h
index 68b9c6f..6bc4a65 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -32,6 +32,11 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate,
public IPC::Message::Sender,
public base::NonThreadSafe {
public:
+ enum GpuProcessKind {
+ GPU_PROCESS_KIND_UNSANDBOXED,
+ GPU_PROCESS_KIND_SANDBOXED
+ };
+
typedef base::Callback<void(const IPC::ChannelHandle&,
base::ProcessHandle,
const content::GPUInfo&)>
@@ -41,18 +46,18 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate,
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(GpuProcessKind 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
+ // any thread.
+ CONTENT_EXPORT static void SendOnIO(GpuProcessKind kind,
content::CauseForGpuLaunch cause,
IPC::Message* message);
@@ -83,15 +88,15 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate,
// 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.
+ GpuProcessKind kind();
void ForceShutdown();
private:
static bool HostIsValid(GpuProcessHost* host);
- GpuProcessHost(int host_id, bool sandboxed);
+ GpuProcessHost(int host_id, GpuProcessKind kind);
virtual ~GpuProcessHost();
bool Init();
@@ -163,7 +168,7 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate,
bool in_process_;
bool software_rendering_;
- bool sandboxed_;
+ GpuProcessKind kind_;
scoped_ptr<GpuMainThread> in_process_gpu_thread_;