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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 1656433002: Sample code: IPC Transport object for GPU Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GpuMemoryBufferService + Transport object. TODO: Eliminate ChildThreadImpl dependency Created 4 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
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 58821e72b79f196d7c129b398507f31a751b6d84..809e9afa12ecc70b54296bdc24345c9c6524c5db 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -21,6 +21,8 @@
#include "content/browser/gpu/gpu_surface_tracker.h"
#include "content/browser/gpu/shader_disk_cache.h"
#include "content/common/child_process_host_impl.h"
+#include "content/common/gpu/client/ipc/chrome/chrome_gpu_channel_host_ipc_transport.h"
+#include "content/common/gpu/gpu_create_command_buffer_config.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
@@ -293,7 +295,7 @@ BrowserGpuChannelHostFactory::AllocateSharedMemory(size_t size) {
void BrowserGpuChannelHostFactory::CreateViewCommandBufferOnIO(
CreateRequest* request,
int32_t surface_id,
- const GPUCreateCommandBufferConfig& init_params) {
+ const GpuCreateCommandBufferConfig& init_params) {
GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
if (!host) {
request->event.Signal();
@@ -321,7 +323,7 @@ void BrowserGpuChannelHostFactory::CommandBufferCreatedOnIO(
CreateCommandBufferResult BrowserGpuChannelHostFactory::CreateViewCommandBuffer(
int32_t surface_id,
- const GPUCreateCommandBufferConfig& init_params,
+ const GpuCreateCommandBufferConfig& init_params,
int32_t route_id) {
CreateRequest request(route_id);
GetIOThreadTaskRunner()->PostTask(
@@ -404,10 +406,15 @@ void BrowserGpuChannelHostFactory::GpuChannelEstablished() {
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"466866 BrowserGpuChannelHostFactory::GpuChannelEstablished1"));
GetContentClient()->SetGpuInfo(pending_request_->gpu_info());
- gpu_channel_ = GpuChannelHost::Create(
- this, gpu_client_id_, pending_request_->gpu_info(),
- pending_request_->channel_handle(), shutdown_event_.get(),
- gpu_memory_buffer_manager_.get());
+ scoped_ptr<GpuChannelHostIPCTransport> transport(
+ GpuHostIPCTransportFactory::Get()->CreateGpuChannelHostIPCTransport());
+ static_cast<ChromeGpuChannelHostIPCTransport*>(transport.get())
+ ->BindToService(this, gpu_client_id_,
+ pending_request_->channel_handle(),
+ shutdown_event_.get());
+ gpu_channel_ = GpuChannelHost::Create(std::move(transport),
+ pending_request_->gpu_info(),
+ gpu_memory_buffer_manager_.get());
}
gpu_host_id_ = pending_request_->gpu_host_id();
pending_request_ = NULL;
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698