summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp')
-rw-r--r--Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
index 8b16ca528..2db8bb446 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -41,8 +41,6 @@
#include <JavaScriptCore/StrongInlines.h>
#include <WebCore/DOMWrapperWorld.h>
#include <WebCore/Frame.h>
-#include <WebCore/Page.h>
-#include <WebCore/PageThrottler.h>
#include <WebCore/ScriptController.h>
#include <wtf/NeverDestroyed.h>
@@ -72,7 +70,7 @@ NPRuntimeObjectMap::PluginProtector::~PluginProtector()
NPObject* NPRuntimeObjectMap::getOrCreateNPObject(VM& vm, JSObject* jsObject)
{
// If this is a JSNPObject, we can just get its underlying NPObject.
- if (jsObject->classInfo() == JSNPObject::info()) {
+ if (jsObject->classInfo(vm) == JSNPObject::info()) {
JSNPObject* jsNPObject = jsCast<JSNPObject*>(jsObject);
NPObject* npObject = jsNPObject->npObject();
@@ -189,17 +187,12 @@ bool NPRuntimeObjectMap::evaluate(NPObject* npObject, const String& scriptString
if (!globalObject)
return false;
- if (m_pluginView && !m_pluginView->isBeingDestroyed()) {
- if (Page* page = m_pluginView->frame()->page())
- page->pageThrottler().reportInterestingEvent();
- }
-
ExecState* exec = globalObject->globalExec();
JSLockHolder lock(exec);
JSValue thisValue = getOrCreateJSObject(globalObject.get(), npObject);
- JSValue resultValue = JSC::evaluate(exec, makeSource(scriptString), thisValue);
+ JSValue resultValue = JSC::evaluate(exec, makeSource(scriptString, { }), thisValue);
convertJSValueToNPVariant(exec, resultValue, *result);
return true;
@@ -270,12 +263,15 @@ void NPRuntimeObjectMap::setGlobalException(const String& exceptionString)
void NPRuntimeObjectMap::moveGlobalExceptionToExecState(ExecState* exec)
{
+ VM& vm = exec->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
if (globalExceptionString().isNull())
return;
{
- JSLockHolder lock(exec);
- exec->vm().throwException(exec, createError(exec, globalExceptionString()));
+ JSLockHolder lock(vm);
+ throwException(exec, scope, createError(exec, globalExceptionString()));
}
globalExceptionString() = String();
@@ -303,7 +299,7 @@ void NPRuntimeObjectMap::addToInvalidationQueue(NPObject* npObject)
void NPRuntimeObjectMap::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
- JSNPObject* object = jsCast<JSNPObject*>(handle.get().asCell());
+ JSNPObject* object = static_cast<JSNPObject*>(handle.get().asCell());
weakRemove(m_jsNPObjects, static_cast<NPObject*>(context), object);
addToInvalidationQueue(object->leakNPObject());
}