| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 STLDeleteElements(&deferred_messages_); | 404 STLDeleteElements(&deferred_messages_); |
| 405 if (preempting_flag_.get()) | 405 if (preempting_flag_.get()) |
| 406 preempting_flag_->Reset(); | 406 preempting_flag_->Reset(); |
| 407 } | 407 } |
| 408 | 408 |
| 409 void GpuChannel::Init(base::MessageLoopProxy* io_message_loop, | 409 void GpuChannel::Init(base::MessageLoopProxy* io_message_loop, |
| 410 base::WaitableEvent* shutdown_event) { | 410 base::WaitableEvent* shutdown_event) { |
| 411 DCHECK(!channel_.get()); | 411 DCHECK(!channel_.get()); |
| 412 | 412 |
| 413 // Map renderer ID to a (single) channel to that process. | 413 // Map renderer ID to a (single) channel to that process. |
| 414 channel_ = IPC::SyncChannel::CreateServer( | 414 channel_.reset(new IPC::SyncChannel( |
| 415 channel_id_, | 415 channel_id_, |
| 416 IPC::Channel::MODE_SERVER, |
| 416 this, | 417 this, |
| 417 io_message_loop, | 418 io_message_loop, |
| 418 false, | 419 false, |
| 419 shutdown_event); | 420 shutdown_event)); |
| 420 | 421 |
| 421 filter_ = | 422 filter_ = |
| 422 new GpuChannelMessageFilter(weak_factory_.GetWeakPtr(), | 423 new GpuChannelMessageFilter(weak_factory_.GetWeakPtr(), |
| 423 gpu_channel_manager_->sync_point_manager(), | 424 gpu_channel_manager_->sync_point_manager(), |
| 424 base::MessageLoopProxy::current()); | 425 base::MessageLoopProxy::current()); |
| 425 io_message_loop_ = io_message_loop; | 426 io_message_loop_ = io_message_loop; |
| 426 channel_->AddFilter(filter_.get()); | 427 channel_->AddFilter(filter_.get()); |
| 427 | 428 |
| 428 devtools_gpu_agent_.reset(new DevToolsGpuAgent(this)); | 429 devtools_gpu_agent_.reset(new DevToolsGpuAgent(this)); |
| 429 } | 430 } |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 uint64 GpuChannel::GetMemoryUsage() { | 837 uint64 GpuChannel::GetMemoryUsage() { |
| 837 uint64 size = 0; | 838 uint64 size = 0; |
| 838 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); | 839 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); |
| 839 !it.IsAtEnd(); it.Advance()) { | 840 !it.IsAtEnd(); it.Advance()) { |
| 840 size += it.GetCurrentValue()->GetMemoryUsage(); | 841 size += it.GetCurrentValue()->GetMemoryUsage(); |
| 841 } | 842 } |
| 842 return size; | 843 return size; |
| 843 } | 844 } |
| 844 | 845 |
| 845 } // namespace content | 846 } // namespace content |
| OLD | NEW |