summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-09 03:20:48 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-09 03:20:48 +0000
commite2cc7d4f7efde5ee4351af5ce5e92035d52941e0 (patch)
treea05199d17fb1dee55fe8c6d26717303141ea1eeb
parenta5bc2ab22a6772684276b5e3a443f94f251485b1 (diff)
downloadchromium_src-e2cc7d4f7efde5ee4351af5ce5e92035d52941e0.zip
chromium_src-e2cc7d4f7efde5ee4351af5ce5e92035d52941e0.tar.gz
chromium_src-e2cc7d4f7efde5ee4351af5ce5e92035d52941e0.tar.bz2
Revert r3074 due to Mac build bustage
Review URL: http://codereview.chromium.org/6378 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3088 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/plugin_messages_internal.h3
-rw-r--r--chrome/plugin/npobject_proxy.cc10
-rw-r--r--chrome/plugin/npobject_stub.cc4
-rw-r--r--chrome/plugin/npobject_stub.h3
-rw-r--r--third_party/npapi/bindings/npruntime.h16
-rw-r--r--webkit/port/bindings/v8/np_v8object.cpp23
6 files changed, 4 insertions, 55 deletions
diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h
index 1059418..146cd9c 100644
--- a/chrome/common/plugin_messages_internal.h
+++ b/chrome/common/plugin_messages_internal.h
@@ -301,9 +301,8 @@ IPC_BEGIN_MESSAGES(NPObject, 7)
std::vector<NPIdentifier_Param> /* value */,
bool /* result */)
- IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate,
+ IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Evaluate,
std::string /* script */,
- bool /* popups_allowed */,
NPVariant_Param /* result_param */,
bool /* result */)
diff --git a/chrome/plugin/npobject_proxy.cc b/chrome/plugin/npobject_proxy.cc
index 9acde3d..1b464e0 100644
--- a/chrome/plugin/npobject_proxy.cc
+++ b/chrome/plugin/npobject_proxy.cc
@@ -324,22 +324,12 @@ bool NPObjectProxy::NPNEvaluate(NPP npp,
return false;
}
- bool popups_allowed = false;
-
- if (npp) {
- NPAPI::PluginInstance* plugin_instance =
- reinterpret_cast<NPAPI::PluginInstance*>(npp->ndata);
- if (plugin_instance)
- popups_allowed = plugin_instance->popups_allowed();
- }
-
NPVariant_Param result_param;
std::string script_str = std::string(
script->UTF8Characters, script->UTF8Length);
NPObjectMsg_Evaluate* msg = new NPObjectMsg_Evaluate(proxy->route_id(),
script_str,
- popups_allowed,
&result_param,
&result);
diff --git a/chrome/plugin/npobject_stub.cc b/chrome/plugin/npobject_stub.cc
index ec276b0..80f6356 100644
--- a/chrome/plugin/npobject_stub.cc
+++ b/chrome/plugin/npobject_stub.cc
@@ -260,7 +260,6 @@ void NPObjectStub::OnEnumeration(std::vector<NPIdentifier_Param>* value,
}
void NPObjectStub::OnEvaluate(const std::string& script,
- bool popups_allowed,
IPC::Message* reply_msg) {
if (IsPluginProcess()) {
NOTREACHED() << "Should only be called on NPObjects in the renderer";
@@ -278,8 +277,7 @@ void NPObjectStub::OnEvaluate(const std::string& script,
script_string.UTF8Characters = script.c_str();
script_string.UTF8Length = static_cast<unsigned int>(script.length());
- bool return_value = NPN_EvaluateHelper(0, popups_allowed, npobject_,
- &script_string, &result_var);
+ bool return_value = NPN_Evaluate(0, npobject_, &script_string, &result_var);
NPVariant_Param result_param;
CreateNPVariantParam(result_var, local_channel, &result_param, true);
diff --git a/chrome/plugin/npobject_stub.h b/chrome/plugin/npobject_stub.h
index a309750..e5f1743 100644
--- a/chrome/plugin/npobject_stub.h
+++ b/chrome/plugin/npobject_stub.h
@@ -63,8 +63,7 @@ class NPObjectStub : public IPC::Channel::Listener,
void OnInvalidate();
void OnEnumeration(std::vector<NPIdentifier_Param>* value,
bool* result);
- void OnEvaluate(const std::string& script, bool popups_allowed,
- IPC::Message* reply_msg);
+ void OnEvaluate(const std::string& script, IPC::Message* reply_msg);
void OnSetException(const std::string& message);
private:
diff --git a/third_party/npapi/bindings/npruntime.h b/third_party/npapi/bindings/npruntime.h
index 47d8fbb..f1160b7 100644
--- a/third_party/npapi/bindings/npruntime.h
+++ b/third_party/npapi/bindings/npruntime.h
@@ -352,22 +352,6 @@ bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName);
bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count);
-// Helper function for evaluating a script in the scope of the NPObject passed in.
-// Parameters
-// npp
-// The plugin's opaque instance handle (Can be NULL)
-// popups_allowed
-// Indicates if popups created in the context of the script being executed are
-// blocked or not.
-// npobj
-// The NPObject.
-// npscript
-// The script being executed.
-// result
-// On return contains the value returned by the script.
-// Returns true on success.
-bool NPN_EvaluateHelper(NPP npp, bool popups_allowed, NPObject *npobj, NPString *npscript, NPVariant *result);
-
// BEGIN GOOGLE MODIFICATIONS
void* NPP_GetJavaClass(void);
diff --git a/webkit/port/bindings/v8/np_v8object.cpp b/webkit/port/bindings/v8/np_v8object.cpp
index 3cb9de1..4387180 100644
--- a/webkit/port/bindings/v8/np_v8object.cpp
+++ b/webkit/port/bindings/v8/np_v8object.cpp
@@ -41,7 +41,6 @@
#include "v8_np_utils.h"
#include "v8_proxy.h"
#include "DOMWindow.h"
-#include "glue/plugins/plugin_instance.h"
using WebCore::V8ClassIndex;
using WebCore::V8Proxy;
@@ -243,20 +242,6 @@ bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args,
bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *npscript,
NPVariant *result) {
- bool popups_allowed = false;
-
- if (npp) {
- NPAPI::PluginInstance* plugin_instance =
- reinterpret_cast<NPAPI::PluginInstance*>(npp->ndata);
- if (plugin_instance)
- popups_allowed = plugin_instance->popups_allowed();
- }
-
- return NPN_EvaluateHelper(npp, popups_allowed, npobj, npscript, result);
-}
-
-bool NPN_EvaluateHelper(NPP npp, bool popups_allowed, NPObject *npobj,
- NPString *npscript, NPVariant *result) {
VOID_TO_NPVARIANT(*result);
if (npobj == NULL)
return false;
@@ -272,13 +257,7 @@ bool NPN_EvaluateHelper(NPP npp, bool popups_allowed, NPObject *npobj,
v8::Context::Scope scope(context);
- // Passing in a NULL filename is the trick used in V8 to indicate
- // user gesture. See the inline_code/setInlineCode functions in V8Proxy
- // for more information.
- WebCore::String filename;
- if (!popups_allowed)
- filename = "npscript";
-
+ WebCore::String filename("npscript");
// Convert UTF-8 stream to WebCore::String.
WebCore::String script = WebCore::String::fromUTF8(
npscript->UTF8Characters, npscript->UTF8Length);