Index: content/common/np_channel_base.cc |
diff --git a/content/common/np_channel_base.cc b/content/common/np_channel_base.cc |
index 2db501f126b2735a1fd3113b371d515dec335898..c4335021ca3083b418154f2ae226ec35303798f7 100644 |
--- a/content/common/np_channel_base.cc |
+++ b/content/common/np_channel_base.cc |
@@ -253,6 +253,20 @@ bool NPChannelBase::OnControlMessageReceived(const IPC::Message& msg) { |
void NPChannelBase::OnChannelError() { |
channel_valid_ = false; |
+ |
+ // TODO(shess): http://crbug.com/97285 |
+ // Once an error is seen on a channel, remap the channel to prevent |
+ // it from being vended again. Keep the channel in the map so |
+ // RemoveRoute() can clean things up correctly. |
+ for (ChannelMap::iterator iter = g_channels.Get().begin(); |
+ iter != g_channels.Get().end(); ++iter) { |
+ if (iter->second == this) { |
+ // Insert new element before invalidating |iter|. |
+ g_channels.Get()[iter->first + "-error"] = iter->second; |
+ g_channels.Get().erase(iter); |
+ break; |
+ } |
+ } |
} |
NPObject* NPChannelBase::GetExistingNPObjectProxy(int route_id) { |