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

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

Issue 1292263003: ipc: Use a global for the process's attachment broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_message2
Patch Set: Comments from avi. Created 5 years, 3 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
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_channel_manager.h » ('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 "content/common/gpu/gpu_channel.h" 5 #include "content/common/gpu/gpu_channel.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 // Clear stubs first because of dependencies. 641 // Clear stubs first because of dependencies.
642 stubs_.clear(); 642 stubs_.clear();
643 643
644 message_queue_->DeleteAndDisableMessages(gpu_channel_manager_); 644 message_queue_->DeleteAndDisableMessages(gpu_channel_manager_);
645 645
646 subscription_ref_set_->RemoveObserver(this); 646 subscription_ref_set_->RemoveObserver(this);
647 if (preempting_flag_.get()) 647 if (preempting_flag_.get())
648 preempting_flag_->Reset(); 648 preempting_flag_->Reset();
649 } 649 }
650 650
651 IPC::ChannelHandle GpuChannel::Init(base::WaitableEvent* shutdown_event, 651 IPC::ChannelHandle GpuChannel::Init(base::WaitableEvent* shutdown_event) {
652 IPC::AttachmentBroker* attachment_broker) {
653 DCHECK(shutdown_event); 652 DCHECK(shutdown_event);
654 DCHECK(!channel_); 653 DCHECK(!channel_);
655 654
656 IPC::ChannelHandle channel_handle(channel_id_); 655 IPC::ChannelHandle channel_handle(channel_id_);
657 656
658 channel_ = IPC::SyncChannel::Create(channel_handle, IPC::Channel::MODE_SERVER, 657 channel_ =
659 this, io_task_runner_, false, 658 IPC::SyncChannel::Create(channel_handle, IPC::Channel::MODE_SERVER, this,
660 shutdown_event, attachment_broker); 659 io_task_runner_, false, shutdown_event);
661 660
662 #if defined(OS_POSIX) 661 #if defined(OS_POSIX)
663 // On POSIX, pass the renderer-side FD. Also mark it as auto-close so 662 // On POSIX, pass the renderer-side FD. Also mark it as auto-close so
664 // that it gets closed after it has been sent. 663 // that it gets closed after it has been sent.
665 base::ScopedFD renderer_fd = channel_->TakeClientFileDescriptor(); 664 base::ScopedFD renderer_fd = channel_->TakeClientFileDescriptor();
666 DCHECK(renderer_fd.is_valid()); 665 DCHECK(renderer_fd.is_valid());
667 channel_handle.socket = base::FileDescriptor(renderer_fd.Pass()); 666 channel_handle.socket = base::FileDescriptor(renderer_fd.Pass());
668 #endif 667 #endif
669 668
670 channel_->AddFilter(filter_.get()); 669 channel_->AddFilter(filter_.get());
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 void GpuChannel::HandleUpdateValueState( 1157 void GpuChannel::HandleUpdateValueState(
1159 unsigned int target, const gpu::ValueState& state) { 1158 unsigned int target, const gpu::ValueState& state) {
1160 pending_valuebuffer_state_->UpdateState(target, state); 1159 pending_valuebuffer_state_->UpdateState(target, state);
1161 } 1160 }
1162 1161
1163 uint32_t GpuChannel::GetUnprocessedOrderNum() const { 1162 uint32_t GpuChannel::GetUnprocessedOrderNum() const {
1164 return message_queue_->GetUnprocessedOrderNum(); 1163 return message_queue_->GetUnprocessedOrderNum();
1165 } 1164 }
1166 1165
1167 } // namespace content 1166 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_channel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698