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

Side by Side Diff: chrome/plugin/npobject_stub.cc

Issue 375005: When a plugin calls NPN_SetException, pass the exception along to every rende... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/plugin/npobject_stub.h ('k') | chrome/plugin/npobject_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/plugin/npobject_stub.h" 5 #include "chrome/plugin/npobject_stub.h"
6 6
7 #include "chrome/common/child_process_logging.h" 7 #include "chrome/common/child_process_logging.h"
8 #include "chrome/common/plugin_messages.h" 8 #include "chrome/common/plugin_messages.h"
9 #include "chrome/plugin/npobject_util.h" 9 #include "chrome/plugin/npobject_util.h"
10 #include "chrome/plugin/plugin_channel_base.h" 10 #include "chrome/plugin/plugin_channel_base.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 IPC_MESSAGE_HANDLER(NPObjectMsg_HasMethod, OnHasMethod); 74 IPC_MESSAGE_HANDLER(NPObjectMsg_HasMethod, OnHasMethod);
75 IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_Invoke, OnInvoke); 75 IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_Invoke, OnInvoke);
76 IPC_MESSAGE_HANDLER(NPObjectMsg_HasProperty, OnHasProperty); 76 IPC_MESSAGE_HANDLER(NPObjectMsg_HasProperty, OnHasProperty);
77 IPC_MESSAGE_HANDLER(NPObjectMsg_GetProperty, OnGetProperty); 77 IPC_MESSAGE_HANDLER(NPObjectMsg_GetProperty, OnGetProperty);
78 IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_SetProperty, OnSetProperty); 78 IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_SetProperty, OnSetProperty);
79 IPC_MESSAGE_HANDLER(NPObjectMsg_RemoveProperty, OnRemoveProperty); 79 IPC_MESSAGE_HANDLER(NPObjectMsg_RemoveProperty, OnRemoveProperty);
80 IPC_MESSAGE_HANDLER(NPObjectMsg_Invalidate, OnInvalidate); 80 IPC_MESSAGE_HANDLER(NPObjectMsg_Invalidate, OnInvalidate);
81 IPC_MESSAGE_HANDLER(NPObjectMsg_Enumeration, OnEnumeration); 81 IPC_MESSAGE_HANDLER(NPObjectMsg_Enumeration, OnEnumeration);
82 IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_Construct, OnConstruct); 82 IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_Construct, OnConstruct);
83 IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_Evaluate, OnEvaluate); 83 IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_Evaluate, OnEvaluate);
84 IPC_MESSAGE_HANDLER(NPObjectMsg_SetException, OnSetException);
85 IPC_MESSAGE_UNHANDLED_ERROR() 84 IPC_MESSAGE_UNHANDLED_ERROR()
86 IPC_END_MESSAGE_MAP() 85 IPC_END_MESSAGE_MAP()
87 } 86 }
88 87
89 void NPObjectStub::OnChannelError() { 88 void NPObjectStub::OnChannelError() {
90 // If npobject_ is NULLed out, that means a DeleteSoon is happening. 89 // If npobject_ is NULLed out, that means a DeleteSoon is happening.
91 if (npobject_) 90 if (npobject_)
92 delete this; 91 delete this;
93 } 92 }
94 93
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 bool return_value = WebBindings::evaluateHelper(0, popups_allowed, npobject_, 364 bool return_value = WebBindings::evaluateHelper(0, popups_allowed, npobject_,
366 &script_string, &result_var); 365 &script_string, &result_var);
367 366
368 NPVariant_Param result_param; 367 NPVariant_Param result_param;
369 CreateNPVariantParam( 368 CreateNPVariantParam(
370 result_var, local_channel, &result_param, true, containing_window_, 369 result_var, local_channel, &result_param, true, containing_window_,
371 page_url_); 370 page_url_);
372 NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); 371 NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value);
373 local_channel->Send(reply_msg); 372 local_channel->Send(reply_msg);
374 } 373 }
375
376 void NPObjectStub::OnSetException(const std::string& message) {
377 if (IsPluginProcess()) {
378 NOTREACHED() << "Should only be called on NPObjects in the renderer";
379 return;
380 }
381
382 WebBindings::setException(npobject_, message.c_str());
383 }
OLDNEW
« no previous file with comments | « chrome/plugin/npobject_stub.h ('k') | chrome/plugin/npobject_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698