| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/gpu/gpu_channel.h" | 9 #include "chrome/gpu/gpu_channel.h" |
| 10 | 10 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void GpuChannel::OnChannelError() { | 84 void GpuChannel::OnChannelError() { |
| 85 // Destroy channel. This will cause the channel to be recreated if another | 85 // Destroy channel. This will cause the channel to be recreated if another |
| 86 // attempt is made to establish a connection from the corresponding renderer. | 86 // attempt is made to establish a connection from the corresponding renderer. |
| 87 channel_.reset(); | 87 channel_.reset(); |
| 88 | 88 |
| 89 // Close renderer process handle. | 89 // Close renderer process handle. |
| 90 renderer_process_.Close(); | 90 renderer_process_.Close(); |
| 91 | 91 |
| 92 #if defined(ENABLE_GPU) | 92 #if defined(ENABLE_GPU) |
| 93 // Destroy all the stubs on this channel. | 93 // Destroy all the stubs on this channel. |
| 94 for (size_t i = 0; i < stubs_.size(); ++i) { | 94 for (StubMap::const_iterator iter = stubs_.begin(); |
| 95 router_.RemoveRoute(stubs_[i]->route_id()); | 95 iter != stubs_.end(); |
| 96 ++iter) { |
| 97 router_.RemoveRoute(iter->second->route_id()); |
| 96 } | 98 } |
| 97 stubs_.clear(); | 99 stubs_.clear(); |
| 98 #endif | 100 #endif |
| 99 } | 101 } |
| 100 | 102 |
| 101 bool GpuChannel::Send(IPC::Message* message) { | 103 bool GpuChannel::Send(IPC::Message* message) { |
| 102 if (log_messages_) { | 104 if (log_messages_) { |
| 103 LOG(INFO) << "sending message @" << message << " on channel @" << this | 105 LOG(INFO) << "sending message @" << message << " on channel @" << this |
| 104 << " with type " << message->type(); | 106 << " with type " << message->type(); |
| 105 } | 107 } |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 channel_.reset(new IPC::SyncChannel( | 217 channel_.reset(new IPC::SyncChannel( |
| 216 channel_name, IPC::Channel::MODE_SERVER, this, NULL, | 218 channel_name, IPC::Channel::MODE_SERVER, this, NULL, |
| 217 ChildProcess::current()->io_message_loop(), false, | 219 ChildProcess::current()->io_message_loop(), false, |
| 218 ChildProcess::current()->GetShutDownEvent())); | 220 ChildProcess::current()->GetShutDownEvent())); |
| 219 return true; | 221 return true; |
| 220 } | 222 } |
| 221 | 223 |
| 222 std::string GpuChannel::GetChannelName() { | 224 std::string GpuChannel::GetChannelName() { |
| 223 return StringPrintf("%d.r%d", base::GetCurrentProcId(), renderer_id_); | 225 return StringPrintf("%d.r%d", base::GetCurrentProcId(), renderer_id_); |
| 224 } | 226 } |
| OLD | NEW |