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

Side by Side Diff: gpu/ipc/service/gpu_channel.cc

Issue 2448973003: Remove use of ChannelHandle::name from gpu/ipc/service. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « gpu/ipc/service/gpu_channel.h ('k') | gpu/ipc/service/gpu_channel_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "gpu/ipc/service/gpu_channel.h" 5 #include "gpu/ipc/service/gpu_channel.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 kv.second->Disable(); 621 kv.second->Disable();
622 622
623 if (preempting_flag_.get()) 623 if (preempting_flag_.get())
624 preempting_flag_->Reset(); 624 preempting_flag_->Reset();
625 } 625 }
626 626
627 IPC::ChannelHandle GpuChannel::Init(base::WaitableEvent* shutdown_event) { 627 IPC::ChannelHandle GpuChannel::Init(base::WaitableEvent* shutdown_event) {
628 DCHECK(shutdown_event); 628 DCHECK(shutdown_event);
629 DCHECK(!channel_); 629 DCHECK(!channel_);
630 630
631 IPC::ChannelHandle client_handle; 631 mojo::MessagePipe pipe;
632 IPC::ChannelHandle server_handle; 632 channel_ = IPC::SyncChannel::Create(pipe.handle0.release(),
633 IPC::Channel::GenerateMojoChannelHandlePair( 633 IPC::Channel::MODE_SERVER, this,
634 "gpu", &client_handle, &server_handle); 634 io_task_runner_, false, shutdown_event);
635 channel_id_ = client_handle.name;
636
637 channel_ =
638 IPC::SyncChannel::Create(server_handle, IPC::Channel::MODE_SERVER,
639 this, io_task_runner_, false, shutdown_event);
640 635
641 channel_->AddFilter(filter_.get()); 636 channel_->AddFilter(filter_.get());
642 637
643 return client_handle; 638 return pipe.handle1.release();
644 } 639 }
645 640
646 void GpuChannel::SetUnhandledMessageListener(IPC::Listener* listener) { 641 void GpuChannel::SetUnhandledMessageListener(IPC::Listener* listener) {
647 unhandled_message_listener_ = listener; 642 unhandled_message_listener_ = listener;
648 } 643 }
649 644
650 base::WeakPtr<GpuChannel> GpuChannel::AsWeakPtr() { 645 base::WeakPtr<GpuChannel> GpuChannel::AsWeakPtr() {
651 return weak_factory_.GetWeakPtr(); 646 return weak_factory_.GetWeakPtr();
652 } 647 }
653 648
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 1057
1063 return manager->gpu_memory_buffer_factory() 1058 return manager->gpu_memory_buffer_factory()
1064 ->AsImageFactory() 1059 ->AsImageFactory()
1065 ->CreateImageForGpuMemoryBuffer(handle, size, format, internalformat, 1060 ->CreateImageForGpuMemoryBuffer(handle, size, format, internalformat,
1066 client_id_, surface_handle); 1061 client_id_, surface_handle);
1067 } 1062 }
1068 } 1063 }
1069 } 1064 }
1070 1065
1071 } // namespace gpu 1066 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_channel.h ('k') | gpu/ipc/service/gpu_channel_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698