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

Unified Diff: content/common/npobject_util.cc

Issue 8576001: Chromium does not throw the exception message by calling NPN_SetException from NPAPI plugin Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | « content/common/npobject_proxy.cc ('k') | content/common/plugin_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/npobject_util.cc
===================================================================
--- content/common/npobject_util.cc (revision 109161)
+++ content/common/npobject_util.cc (working copy)
@@ -87,8 +87,19 @@
std::string message_str(message);
if (IsPluginProcess()) {
NPChannelBase* renderer_channel = NPChannelBase::GetCurrentChannel();
- if (renderer_channel)
- renderer_channel->Send(new PluginHostMsg_SetException(message_str));
+ if (renderer_channel) {
+ if (obj->_class != NPObjectProxy::npclass()) {
+ int route_id = MSG_ROUTING_NONE;
+ // Determine the route id of NPObjectProxy instance in renderer process
+ // It is the same as the route id of NPObjectStub instance in plugin
+ // process.
+ route_id = renderer_channel->GetExistingRouteForNPObjectStub(obj);
+ renderer_channel->Send(new NPObjectMsg_SetException(route_id,
+ message_str));
+ } else {
+ renderer_channel->Send(new PluginHostMsg_SetException(message_str));
+ }
+ }
} else {
WebBindings::setException(obj, message_str.c_str());
}
« no previous file with comments | « content/common/npobject_proxy.cc ('k') | content/common/plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698