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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 | 397 |
398 channel_id_ = IPC::Channel::GenerateVerifiedChannelID("gpu"); | 398 channel_id_ = IPC::Channel::GenerateVerifiedChannelID("gpu"); |
399 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 399 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
400 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); | 400 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); |
401 } | 401 } |
402 | 402 |
403 GpuChannel::~GpuChannel() { | 403 GpuChannel::~GpuChannel() { |
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 | |
408 bool lost_context = false; | |
409 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); !it.IsAtEnd(); | |
410 it.Advance()) { | |
411 lost_context = it.GetCurrentValue()->CheckContextLost(); | |
reveman
2014/06/04 15:29:35
This will set lost_context to whatever is returned
sohanjg
2014/06/05 02:57:57
Can you please suggest how we should get the have_
sohanjg
2014/06/05 06:33:57
When i checked, the stubmap size is 1, how about w
reveman
2014/06/05 15:58:01
We'll have one image manager per stub once we've C
sohanjg
2014/06/06 02:30:03
I see. Is waiting for the refactor the only option
| |
412 } | |
413 if (image_manager_) | |
414 image_manager_->Destroy(!lost_context); | |
407 } | 415 } |
408 | 416 |
409 void GpuChannel::Init(base::MessageLoopProxy* io_message_loop, | 417 void GpuChannel::Init(base::MessageLoopProxy* io_message_loop, |
410 base::WaitableEvent* shutdown_event) { | 418 base::WaitableEvent* shutdown_event) { |
411 DCHECK(!channel_.get()); | 419 DCHECK(!channel_.get()); |
412 | 420 |
413 // Map renderer ID to a (single) channel to that process. | 421 // Map renderer ID to a (single) channel to that process. |
414 channel_.reset(new IPC::SyncChannel( | 422 channel_.reset(new IPC::SyncChannel( |
415 channel_id_, | 423 channel_id_, |
416 IPC::Channel::MODE_SERVER, | 424 IPC::Channel::MODE_SERVER, |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 uint64 GpuChannel::GetMemoryUsage() { | 845 uint64 GpuChannel::GetMemoryUsage() { |
838 uint64 size = 0; | 846 uint64 size = 0; |
839 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); | 847 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); |
840 !it.IsAtEnd(); it.Advance()) { | 848 !it.IsAtEnd(); it.Advance()) { |
841 size += it.GetCurrentValue()->GetMemoryUsage(); | 849 size += it.GetCurrentValue()->GetMemoryUsage(); |
842 } | 850 } |
843 return size; | 851 return size; |
844 } | 852 } |
845 | 853 |
846 } // namespace content | 854 } // namespace content |
OLD | NEW |