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 #include "chrome/renderer/plugin_channel_host.h" | 5 #include "chrome/renderer/plugin_channel_host.h" |
6 | 6 |
7 #include "chrome/common/plugin_messages.h" | 7 #include "chrome/common/plugin_messages.h" |
8 #include "chrome/plugin/npobject_base.h" | 8 #include "chrome/plugin/npobject_base.h" |
9 | 9 |
10 #if defined(OS_POSIX) | 10 #if defined(OS_POSIX) |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 if (!npobject) | 108 if (!npobject) |
109 proxies_[route_id] = listener; | 109 proxies_[route_id] = listener; |
110 } | 110 } |
111 | 111 |
112 void PluginChannelHost::RemoveRoute(int route_id) { | 112 void PluginChannelHost::RemoveRoute(int route_id) { |
113 proxies_.erase(route_id); | 113 proxies_.erase(route_id); |
114 PluginChannelBase::RemoveRoute(route_id); | 114 PluginChannelBase::RemoveRoute(route_id); |
115 } | 115 } |
116 | 116 |
117 void PluginChannelHost::OnControlMessageReceived(const IPC::Message& message) { | 117 bool PluginChannelHost::OnControlMessageReceived(const IPC::Message& message) { |
| 118 bool handled = true; |
118 IPC_BEGIN_MESSAGE_MAP(PluginChannelHost, message) | 119 IPC_BEGIN_MESSAGE_MAP(PluginChannelHost, message) |
119 IPC_MESSAGE_HANDLER(PluginHostMsg_SetException, OnSetException) | 120 IPC_MESSAGE_HANDLER(PluginHostMsg_SetException, OnSetException) |
120 IPC_MESSAGE_HANDLER(PluginHostMsg_PluginShuttingDown, OnPluginShuttingDown) | 121 IPC_MESSAGE_HANDLER(PluginHostMsg_PluginShuttingDown, OnPluginShuttingDown) |
121 IPC_MESSAGE_UNHANDLED_ERROR() | 122 IPC_MESSAGE_UNHANDLED(handled = false) |
122 IPC_END_MESSAGE_MAP() | 123 IPC_END_MESSAGE_MAP() |
| 124 DCHECK(handled); |
| 125 return handled; |
123 } | 126 } |
124 | 127 |
125 void PluginChannelHost::OnSetException(const std::string& message) { | 128 void PluginChannelHost::OnSetException(const std::string& message) { |
126 WebKit::WebBindings::setException(NULL, message.c_str()); | 129 WebKit::WebBindings::setException(NULL, message.c_str()); |
127 } | 130 } |
128 | 131 |
129 void PluginChannelHost::OnPluginShuttingDown(const IPC::Message& message) { | 132 void PluginChannelHost::OnPluginShuttingDown(const IPC::Message& message) { |
130 expecting_shutdown_ = true; | 133 expecting_shutdown_ = true; |
131 } | 134 } |
132 | 135 |
133 void PluginChannelHost::OnChannelError() { | 136 void PluginChannelHost::OnChannelError() { |
134 PluginChannelBase::OnChannelError(); | 137 PluginChannelBase::OnChannelError(); |
135 | 138 |
136 for (ProxyMap::iterator iter = proxies_.begin(); | 139 for (ProxyMap::iterator iter = proxies_.begin(); |
137 iter != proxies_.end(); iter++) { | 140 iter != proxies_.end(); iter++) { |
138 iter->second->OnChannelError(); | 141 iter->second->OnChannelError(); |
139 } | 142 } |
140 | 143 |
141 proxies_.clear(); | 144 proxies_.clear(); |
142 } | 145 } |
OLD | NEW |