| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 | 10 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 279 |
| 280 OnMessageReceived(*message); | 280 OnMessageReceived(*message); |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 | 283 |
| 284 int GpuChannel::GenerateRouteID() { | 284 int GpuChannel::GenerateRouteID() { |
| 285 static int last_id = 0; | 285 static int last_id = 0; |
| 286 return ++last_id; | 286 return ++last_id; |
| 287 } | 287 } |
| 288 | 288 |
| 289 void GpuChannel::AddRoute(int32 route_id, IPC::Channel::Listener* listener) { |
| 290 router_.AddRoute(route_id, listener); |
| 291 } |
| 292 |
| 293 void GpuChannel::RemoveRoute(int32 route_id) { |
| 294 router_.RemoveRoute(route_id); |
| 295 } |
| 296 |
| 289 void GpuChannel::OnInitialize(base::ProcessHandle renderer_process) { | 297 void GpuChannel::OnInitialize(base::ProcessHandle renderer_process) { |
| 290 // Initialize should only happen once. | 298 // Initialize should only happen once. |
| 291 DCHECK(!renderer_process_); | 299 DCHECK(!renderer_process_); |
| 292 | 300 |
| 293 // Verify that the renderer has passed its own process handle. | 301 // Verify that the renderer has passed its own process handle. |
| 294 if (base::GetProcId(renderer_process) == renderer_pid_) | 302 if (base::GetProcId(renderer_process) == renderer_pid_) |
| 295 renderer_process_ = renderer_process; | 303 renderer_process_ = renderer_process; |
| 296 } | 304 } |
| 297 | 305 |
| 298 void GpuChannel::OnCreateOffscreenCommandBuffer( | 306 void GpuChannel::OnCreateOffscreenCommandBuffer( |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 436 |
| 429 #if defined(OS_POSIX) | 437 #if defined(OS_POSIX) |
| 430 int GpuChannel::GetRendererFileDescriptor() { | 438 int GpuChannel::GetRendererFileDescriptor() { |
| 431 int fd = -1; | 439 int fd = -1; |
| 432 if (channel_.get()) { | 440 if (channel_.get()) { |
| 433 fd = channel_->GetClientFileDescriptor(); | 441 fd = channel_->GetClientFileDescriptor(); |
| 434 } | 442 } |
| 435 return fd; | 443 return fd; |
| 436 } | 444 } |
| 437 #endif // defined(OS_POSIX) | 445 #endif // defined(OS_POSIX) |
| OLD | NEW |