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

Side by Side Diff: content/common/gpu/gpu_channel.cc

Issue 621613002: Refactoring: Make IPC::Channel::TakeClientFileDescriptor() a ScopedFD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing Mac build Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 channel_->AddFilter(filter_.get()); 449 channel_->AddFilter(filter_.get());
450 450
451 devtools_gpu_agent_.reset(new DevToolsGpuAgent(this)); 451 devtools_gpu_agent_.reset(new DevToolsGpuAgent(this));
452 } 452 }
453 453
454 std::string GpuChannel::GetChannelName() { 454 std::string GpuChannel::GetChannelName() {
455 return channel_id_; 455 return channel_id_;
456 } 456 }
457 457
458 #if defined(OS_POSIX) 458 #if defined(OS_POSIX)
459 int GpuChannel::TakeRendererFileDescriptor() { 459 base::ScopedFD GpuChannel::TakeRendererFileDescriptor() {
460 if (!channel_) { 460 if (!channel_) {
461 NOTREACHED(); 461 NOTREACHED();
462 return -1; 462 return base::ScopedFD();
463 } 463 }
464 return channel_->TakeClientFileDescriptor(); 464 return channel_->TakeClientFileDescriptor();
465 } 465 }
466 #endif // defined(OS_POSIX) 466 #endif // defined(OS_POSIX)
467 467
468 bool GpuChannel::OnMessageReceived(const IPC::Message& message) { 468 bool GpuChannel::OnMessageReceived(const IPC::Message& message) {
469 if (log_messages_) { 469 if (log_messages_) {
470 DVLOG(1) << "received message @" << &message << " on channel @" << this 470 DVLOG(1) << "received message @" << &message << " on channel @" << this
471 << " with type " << message.type(); 471 << " with type " << message.type();
472 } 472 }
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 uint64 GpuChannel::GetMemoryUsage() { 812 uint64 GpuChannel::GetMemoryUsage() {
813 uint64 size = 0; 813 uint64 size = 0;
814 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); 814 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_);
815 !it.IsAtEnd(); it.Advance()) { 815 !it.IsAtEnd(); it.Advance()) {
816 size += it.GetCurrentValue()->GetMemoryUsage(); 816 size += it.GetCurrentValue()->GetMemoryUsage();
817 } 817 }
818 return size; 818 return size;
819 } 819 }
820 820
821 } // namespace content 821 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698