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

Unified Diff: content/common/np_channel_base.cc

Issue 10544075: Remove NPChannelBase from cache on error. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698