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

Side by Side Diff: gpu/ipc/client/command_buffer_proxy_impl.cc

Issue 1964793002: Revert of [Reland 1] Pepper takes ownership of a mailbox before passing it to the texture layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « gpu/ipc/client/command_buffer_proxy_impl.h ('k') | gpu/ipc/common/gpu_messages.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 "gpu/ipc/client/command_buffer_proxy_impl.h" 5 #include "gpu/ipc/client/command_buffer_proxy_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 // catches upwith the command buffer. 601 // catches upwith the command buffer.
602 // A malicious caller trying to create a collision by making next_signal_id 602 // A malicious caller trying to create a collision by making next_signal_id
603 // would have to make calls at an astounding rate (300B/s) and even if they 603 // would have to make calls at an astounding rate (300B/s) and even if they
604 // could do that, all they would do is to prevent some callbacks from getting 604 // could do that, all they would do is to prevent some callbacks from getting
605 // called, leading to stalled threads and/or memory leaks. 605 // called, leading to stalled threads and/or memory leaks.
606 uint32_t signal_id = next_signal_id_++; 606 uint32_t signal_id = next_signal_id_++;
607 Send(new GpuCommandBufferMsg_SignalQuery(route_id_, query, signal_id)); 607 Send(new GpuCommandBufferMsg_SignalQuery(route_id_, query, signal_id));
608 signal_tasks_.insert(std::make_pair(signal_id, callback)); 608 signal_tasks_.insert(std::make_pair(signal_id, callback));
609 } 609 }
610 610
611 void CommandBufferProxyImpl::TakeFrontBuffer(const gpu::Mailbox& mailbox) { 611 bool CommandBufferProxyImpl::ProduceFrontBuffer(const gpu::Mailbox& mailbox) {
612 CheckLock(); 612 CheckLock();
613 if (last_state_.error != gpu::error::kNoError) 613 if (last_state_.error != gpu::error::kNoError)
614 return; 614 return false;
615 615
616 Send(new GpuCommandBufferMsg_TakeFrontBuffer(route_id_, mailbox)); 616 Send(new GpuCommandBufferMsg_ProduceFrontBuffer(route_id_, mailbox));
617 } 617 return true;
618
619 void CommandBufferProxyImpl::ReturnFrontBuffer(const gpu::Mailbox& mailbox,
620 const gpu::SyncToken& sync_token,
621 bool is_lost) {
622 CheckLock();
623 if (last_state_.error != gpu::error::kNoError)
624 return;
625
626 Send(new GpuCommandBufferMsg_WaitSyncToken(route_id_, sync_token));
627 Send(new GpuCommandBufferMsg_ReturnFrontBuffer(route_id_, mailbox, is_lost));
628 } 618 }
629 619
630 gpu::error::Error CommandBufferProxyImpl::GetLastError() { 620 gpu::error::Error CommandBufferProxyImpl::GetLastError() {
631 return last_state_.error; 621 return last_state_.error;
632 } 622 }
633 623
634 bool CommandBufferProxyImpl::Send(IPC::Message* msg) { 624 bool CommandBufferProxyImpl::Send(IPC::Message* msg) {
635 // Caller should not intentionally send a message if the context is lost. 625 // Caller should not intentionally send a message if the context is lost.
636 DCHECK(last_state_.error == gpu::error::kNoError); 626 DCHECK(last_state_.error == gpu::error::kNoError);
637 DCHECK(channel_); 627 DCHECK(channel_);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 // the client for lost context a single time. 769 // the client for lost context a single time.
780 if (!channel_) 770 if (!channel_)
781 return; 771 return;
782 channel_->DestroyCommandBuffer(this); 772 channel_->DestroyCommandBuffer(this);
783 channel_ = nullptr; 773 channel_ = nullptr;
784 if (gpu_control_client_) 774 if (gpu_control_client_)
785 gpu_control_client_->OnGpuControlLostContext(); 775 gpu_control_client_->OnGpuControlLostContext();
786 } 776 }
787 777
788 } // namespace gpu 778 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/client/command_buffer_proxy_impl.h ('k') | gpu/ipc/common/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698