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

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

Issue 2414153005: Remove usage of FOR_EACH_OBSERVER macro in gpu (Closed)
Patch Set: Created 4 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 #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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 std::unique_ptr<CommandBufferProxyImpl> command_buffer = base::WrapUnique( 93 std::unique_ptr<CommandBufferProxyImpl> command_buffer = base::WrapUnique(
94 new CommandBufferProxyImpl(host->channel_id(), route_id, stream_id)); 94 new CommandBufferProxyImpl(host->channel_id(), route_id, stream_id));
95 if (!command_buffer->Initialize(std::move(host), std::move(init_params), 95 if (!command_buffer->Initialize(std::move(host), std::move(init_params),
96 std::move(task_runner))) 96 std::move(task_runner)))
97 return nullptr; 97 return nullptr;
98 98
99 return command_buffer; 99 return command_buffer;
100 } 100 }
101 101
102 CommandBufferProxyImpl::~CommandBufferProxyImpl() { 102 CommandBufferProxyImpl::~CommandBufferProxyImpl() {
103 FOR_EACH_OBSERVER(DeletionObserver, deletion_observers_, OnWillDeleteImpl()); 103 for (auto& observer : deletion_observers_)
104 observer.OnWillDeleteImpl();
104 DisconnectChannel(); 105 DisconnectChannel();
105 } 106 }
106 107
107 bool CommandBufferProxyImpl::OnMessageReceived(const IPC::Message& message) { 108 bool CommandBufferProxyImpl::OnMessageReceived(const IPC::Message& message) {
108 std::unique_ptr<base::AutoLock> lock; 109 std::unique_ptr<base::AutoLock> lock;
109 if (lock_) 110 if (lock_)
110 lock.reset(new base::AutoLock(*lock_)); 111 lock.reset(new base::AutoLock(*lock_));
111 bool handled = true; 112 bool handled = true;
112 IPC_BEGIN_MESSAGE_MAP(CommandBufferProxyImpl, message) 113 IPC_BEGIN_MESSAGE_MAP(CommandBufferProxyImpl, message)
113 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Destroyed, OnDestroyed); 114 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Destroyed, OnDestroyed);
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 return; 866 return;
866 channel_->FlushPendingStream(stream_id_); 867 channel_->FlushPendingStream(stream_id_);
867 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); 868 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_));
868 channel_->RemoveRoute(route_id_); 869 channel_->RemoveRoute(route_id_);
869 channel_ = nullptr; 870 channel_ = nullptr;
870 if (gpu_control_client_) 871 if (gpu_control_client_)
871 gpu_control_client_->OnGpuControlLostContext(); 872 gpu_control_client_->OnGpuControlLostContext();
872 } 873 }
873 874
874 } // namespace gpu 875 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/shader_translator.cc ('k') | gpu/ipc/service/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698