diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp | 22 |
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()); } |