Convert plugin and GPU process to brokered handle duplication.

BUG=119250
Review URL: https://chromiumcodereview.appspot.com/9958034

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132303 0039d316-1c4b-4281-b951-d872f2087c98
void BrowserGpuChannelHostFactory::EstablishGpuChannelOnIO(
    EstablishRequest* request,
    CauseForGpuLaunch cause_for_gpu_launch) {
  GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
  if (!host) {
    host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
                               cause_for_gpu_launch);
    if (!host) {
      request->event.Signal();
      return;
    }
    gpu_host_id_ = host->host_id();
  }

  host->EstablishGpuChannel(
      gpu_client_id_,
      true,
      base::Bind(&BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO,
                 request));
}

void BrowserGpuChannelHostFactory::EstablishGpuChannelOnIO(
    EstablishRequest* request,
    CauseForGpuLaunch cause_for_gpu_launch) {
  GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
  if (!host) {
    host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
                               cause_for_gpu_launch);
    if (!host) {
      request->event.Signal();
      return;
    }
    gpu_host_id_ = host->host_id();
  }

  host->EstablishGpuChannel(
      gpu_client_id_,
      true,
      base::Bind(&BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO,
                 request));
}
