| OLD | NEW |
| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 channel_ = NULL; | 165 channel_ = NULL; |
| 166 } | 166 } |
| 167 | 167 |
| 168 virtual bool OnMessageReceived(const IPC::Message& message) { | 168 virtual bool OnMessageReceived(const IPC::Message& message) { |
| 169 DCHECK(channel_); | 169 DCHECK(channel_); |
| 170 | 170 |
| 171 bool handled = true; | 171 bool handled = true; |
| 172 IPC_BEGIN_MESSAGE_MAP(MailboxMessageFilter, message) | 172 IPC_BEGIN_MESSAGE_MAP(MailboxMessageFilter, message) |
| 173 IPC_MESSAGE_HANDLER(GpuChannelMsg_GenerateMailboxNames, | 173 IPC_MESSAGE_HANDLER(GpuChannelMsg_GenerateMailboxNames, |
| 174 OnGenerateMailboxNames) | 174 OnGenerateMailboxNames) |
| 175 IPC_MESSAGE_HANDLER(GpuChannelMsg_GenerateMailboxNamesAsync, |
| 176 OnGenerateMailboxNamesAsync) |
| 175 IPC_MESSAGE_UNHANDLED(handled = false) | 177 IPC_MESSAGE_UNHANDLED(handled = false) |
| 176 IPC_END_MESSAGE_MAP() | 178 IPC_END_MESSAGE_MAP() |
| 177 | 179 |
| 178 return handled; | 180 return handled; |
| 179 } | 181 } |
| 180 | 182 |
| 181 bool Send(IPC::Message* message) { | 183 bool Send(IPC::Message* message) { |
| 182 return channel_->Send(message); | 184 return channel_->Send(message); |
| 183 } | 185 } |
| 184 | 186 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 199 bool success = hmac_.Sign( | 201 bool success = hmac_.Sign( |
| 200 base::StringPiece(name, sizeof(name) / 2), | 202 base::StringPiece(name, sizeof(name) / 2), |
| 201 reinterpret_cast<unsigned char*>(name) + sizeof(name) / 2, | 203 reinterpret_cast<unsigned char*>(name) + sizeof(name) / 2, |
| 202 sizeof(name) / 2); | 204 sizeof(name) / 2); |
| 203 DCHECK(success); | 205 DCHECK(success); |
| 204 | 206 |
| 205 (*result)[i].assign(name, sizeof(name)); | 207 (*result)[i].assign(name, sizeof(name)); |
| 206 } | 208 } |
| 207 } | 209 } |
| 208 | 210 |
| 211 void OnGenerateMailboxNamesAsync(unsigned num) { |
| 212 std::vector<std::string> names; |
| 213 OnGenerateMailboxNames(num, &names); |
| 214 Send(new GpuChannelMsg_GenerateMailboxNamesReply(names)); |
| 215 } |
| 216 |
| 209 IPC::Channel* channel_; | 217 IPC::Channel* channel_; |
| 210 crypto::HMAC hmac_; | 218 crypto::HMAC hmac_; |
| 211 }; | 219 }; |
| 212 } // anonymous namespace | 220 } // anonymous namespace |
| 213 | 221 |
| 214 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, | 222 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, |
| 215 GpuWatchdog* watchdog, | 223 GpuWatchdog* watchdog, |
| 216 gfx::GLShareGroup* share_group, | 224 gfx::GLShareGroup* share_group, |
| 217 gpu::gles2::MailboxManager* mailbox, | 225 gpu::gles2::MailboxManager* mailbox, |
| 218 int client_id, | 226 int client_id, |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 } | 672 } |
| 665 } | 673 } |
| 666 | 674 |
| 667 GpuChannelMsg_CollectRenderingStatsForSurface::WriteReplyParams( | 675 GpuChannelMsg_CollectRenderingStatsForSurface::WriteReplyParams( |
| 668 reply_message, | 676 reply_message, |
| 669 stats); | 677 stats); |
| 670 Send(reply_message); | 678 Send(reply_message); |
| 671 } | 679 } |
| 672 | 680 |
| 673 } // namespace content | 681 } // namespace content |
| OLD | NEW |