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

Unified Diff: remoting/host/plugin/host_script_object.cc

Issue 7265012: Fix buglet calling out to JS from plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « remoting/host/plugin/host_script_object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/plugin/host_script_object.cc
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
index d0c84b7770940ae271d113ab7bc64d3d8e050a57..fdeb568e1cecadbac3cc230ae1e89a16ad1419a4 100644
--- a/remoting/host/plugin/host_script_object.cc
+++ b/remoting/host/plugin/host_script_object.cc
@@ -463,7 +463,7 @@ void HostNPScriptObject::OnStateChanged(State state) {
state_ = state;
if (on_state_changed_func_) {
VLOG(2) << "Calling state changed " << state;
- bool is_good = CallJSFunction(on_state_changed_func_, NULL, 0, NULL);
+ bool is_good = InvokeAndIgnoreResult(on_state_changed_func_, NULL, 0);
LOG_IF(ERROR, !is_good) << "OnStateChanged failed";
}
}
@@ -479,7 +479,7 @@ void HostNPScriptObject::LogDebugInfo(const std::string& message) {
NPVariant* arg = new NPVariant();
LOG(INFO) << "Logging: " << message;
STRINGZ_TO_NPVARIANT(message.c_str(), *arg);
- bool is_good = CallJSFunction(log_debug_info_func_, arg, 1, NULL);
+ bool is_good = InvokeAndIgnoreResult(log_debug_info_func_, arg, 1);
LOG_IF(ERROR, !is_good) << "LogDebugInfo failed";
}
}
@@ -490,19 +490,14 @@ void HostNPScriptObject::SetException(const std::string& exception_string) {
LogDebugInfo(exception_string);
}
-bool HostNPScriptObject::CallJSFunction(NPObject* func,
- const NPVariant* args,
- uint32_t argCount,
- NPVariant* result) {
+bool HostNPScriptObject::InvokeAndIgnoreResult(NPObject* func,
+ const NPVariant* args,
+ uint32_t argCount) {
NPVariant np_result;
- bool is_good = func->_class->invokeDefault(func, args, argCount, &np_result);
- if (is_good) {
- if (result) {
- *result = np_result;
- } else {
+ bool is_good = g_npnetscape_funcs->invokeDefault(plugin_, func, args,
+ argCount, &np_result);
+ if (is_good)
g_npnetscape_funcs->releasevariantvalue(&np_result);
- }
- }
return is_good;
}
« no previous file with comments | « remoting/host/plugin/host_script_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698