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_.reset(new IPC::SyncChannel( | 414 channel_ = IPC::SyncChannel::Create(channel_id_, |
415 channel_id_, | 415 IPC::Channel::MODE_SERVER, |
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)); | |
421 | 420 |
422 filter_ = | 421 filter_ = |
423 new GpuChannelMessageFilter(weak_factory_.GetWeakPtr(), | 422 new GpuChannelMessageFilter(weak_factory_.GetWeakPtr(), |
424 gpu_channel_manager_->sync_point_manager(), | 423 gpu_channel_manager_->sync_point_manager(), |
425 base::MessageLoopProxy::current()); | 424 base::MessageLoopProxy::current()); |
426 io_message_loop_ = io_message_loop; | 425 io_message_loop_ = io_message_loop; |
427 channel_->AddFilter(filter_.get()); | 426 channel_->AddFilter(filter_.get()); |
428 | 427 |
429 devtools_gpu_agent_.reset(new DevToolsGpuAgent(this)); | 428 devtools_gpu_agent_.reset(new DevToolsGpuAgent(this)); |
430 } | 429 } |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 uint64 GpuChannel::GetMemoryUsage() { | 836 uint64 GpuChannel::GetMemoryUsage() { |
838 uint64 size = 0; | 837 uint64 size = 0; |
839 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); | 838 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); |
840 !it.IsAtEnd(); it.Advance()) { | 839 !it.IsAtEnd(); it.Advance()) { |
841 size += it.GetCurrentValue()->GetMemoryUsage(); | 840 size += it.GetCurrentValue()->GetMemoryUsage(); |
842 } | 841 } |
843 return size; | 842 return size; |
844 } | 843 } |
845 | 844 |
846 } // namespace content | 845 } // namespace content |
OLD | NEW |