Commit 492a49a2 authored by haraken@chromium.org's avatar haraken@chromium.org

Remove unused Isolate* parameters from toV8Context()

TBR=jochen

Review URL: https://codereview.chromium.org/304353015

git-svn-id: svn://svn.chromium.org/blink/trunk@175266 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7b77d7cf
......@@ -77,14 +77,14 @@ static NPClass V8NPObjectClass = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
static v8::Local<v8::Context> mainWorldContext(v8::Isolate* isolate, NPP npp, NPObject* npObject)
static v8::Local<v8::Context> mainWorldContext(NPP npp, NPObject* npObject)
{
ASSERT(npObject->_class == &V8NPObjectClass);
V8NPObject* object = reinterpret_cast<V8NPObject*>(npObject);
DOMWindow* window = object->rootObject;
if (!window || !window->isCurrentlyDisplayedInFrame())
return v8::Local<v8::Context>();
return toV8Context(isolate, object->rootObject->frame(), DOMWrapperWorld::mainWorld());
return toV8Context(object->rootObject->frame(), DOMWrapperWorld::mainWorld());
}
static PassOwnPtr<v8::Handle<v8::Value>[]> createValueListFromVariantArgs(const NPVariant* arguments, uint32_t argumentCount, NPObject* owner, v8::Isolate* isolate)
......@@ -232,7 +232,7 @@ bool _NPN_Invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPV
v8::HandleScope handleScope(isolate);
// FIXME: should use the plugin's owner frame as the security context.
v8::Handle<v8::Context> context = mainWorldContext(isolate, npp, npObject);
v8::Handle<v8::Context> context = mainWorldContext(npp, npObject);
if (context.IsEmpty())
return false;
......@@ -287,7 +287,7 @@ bool _NPN_InvokeDefault(NPP npp, NPObject* npObject, const NPVariant* arguments,
VOID_TO_NPVARIANT(*result);
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> context = mainWorldContext(isolate, npp, npObject);
v8::Handle<v8::Context> context = mainWorldContext(npp, npObject);
if (context.IsEmpty())
return false;
......@@ -336,7 +336,7 @@ bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> context = mainWorldContext(isolate, npp, npObject);
v8::Handle<v8::Context> context = mainWorldContext(npp, npObject);
if (context.IsEmpty())
return false;
......@@ -372,7 +372,7 @@ bool _NPN_GetProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName, NP
if (V8NPObject* object = npObjectToV8NPObject(npObject)) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> context = mainWorldContext(isolate, npp, npObject);
v8::Handle<v8::Context> context = mainWorldContext(npp, npObject);
if (context.IsEmpty())
return false;
......@@ -406,7 +406,7 @@ bool _NPN_SetProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName, co
if (V8NPObject* object = npObjectToV8NPObject(npObject)) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> context = mainWorldContext(isolate, npp, npObject);
v8::Handle<v8::Context> context = mainWorldContext(npp, npObject);
if (context.IsEmpty())
return false;
......@@ -435,7 +435,7 @@ bool _NPN_RemoveProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName)
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> context = mainWorldContext(isolate, npp, npObject);
v8::Handle<v8::Context> context = mainWorldContext(npp, npObject);
if (context.IsEmpty())
return false;
v8::Context::Scope scope(context);
......@@ -455,7 +455,7 @@ bool _NPN_HasProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName)
if (V8NPObject* object = npObjectToV8NPObject(npObject)) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> context = mainWorldContext(isolate, npp, npObject);
v8::Handle<v8::Context> context = mainWorldContext(npp, npObject);
if (context.IsEmpty())
return false;
v8::Context::Scope scope(context);
......@@ -478,7 +478,7 @@ bool _NPN_HasMethod(NPP npp, NPObject* npObject, NPIdentifier methodName)
if (V8NPObject* object = npObjectToV8NPObject(npObject)) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> context = mainWorldContext(isolate, npp, npObject);
v8::Handle<v8::Context> context = mainWorldContext(npp, npObject);
if (context.IsEmpty())
return false;
v8::Context::Scope scope(context);
......@@ -505,7 +505,7 @@ void _NPN_SetException(NPObject* npObject, const NPUTF8 *message)
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> context = mainWorldContext(isolate, 0, npObject);
v8::Handle<v8::Context> context = mainWorldContext(0, npObject);
if (context.IsEmpty())
return;
......@@ -523,7 +523,7 @@ bool _NPN_Enumerate(NPP npp, NPObject* npObject, NPIdentifier** identifier, uint
if (V8NPObject* object = npObjectToV8NPObject(npObject)) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
v8::Local<v8::Context> context = mainWorldContext(isolate, npp, npObject);
v8::Local<v8::Context> context = mainWorldContext(npp, npObject);
if (context.IsEmpty())
return false;
v8::Context::Scope scope(context);
......@@ -579,7 +579,7 @@ bool _NPN_Construct(NPP npp, NPObject* npObject, const NPVariant* arguments, uin
if (V8NPObject* object = npObjectToV8NPObject(npObject)) {
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> context = mainWorldContext(isolate, npp, npObject);
v8::Handle<v8::Context> context = mainWorldContext(npp, npObject);
if (context.IsEmpty())
return false;
v8::Context::Scope scope(context);
......
......@@ -254,7 +254,7 @@ void ScriptController::bindToWindowObject(LocalFrame* frame, const String& key,
{
v8::HandleScope handleScope(m_isolate);
v8::Handle<v8::Context> v8Context = toV8Context(m_isolate, frame, DOMWrapperWorld::mainWorld());
v8::Handle<v8::Context> v8Context = toV8Context(frame, DOMWrapperWorld::mainWorld());
if (v8Context.IsEmpty())
return;
......@@ -364,7 +364,7 @@ static NPObject* createNoScriptObject()
static NPObject* createScriptObject(LocalFrame* frame, v8::Isolate* isolate)
{
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> v8Context = toV8Context(isolate, frame, DOMWrapperWorld::mainWorld());
v8::Handle<v8::Context> v8Context = toV8Context(frame, DOMWrapperWorld::mainWorld());
if (v8Context.IsEmpty())
return createNoScriptObject();
......@@ -402,7 +402,7 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement
return createNoScriptObject();
v8::HandleScope handleScope(m_isolate);
v8::Handle<v8::Context> v8Context = toV8Context(m_isolate, m_frame, DOMWrapperWorld::mainWorld());
v8::Handle<v8::Context> v8Context = toV8Context(m_frame, DOMWrapperWorld::mainWorld());
if (v8Context.IsEmpty())
return createNoScriptObject();
v8::Context::Scope scope(v8Context);
......@@ -574,7 +574,7 @@ ScriptValue ScriptController::evaluateScriptInMainWorld(const ScriptSourceCode&
m_sourceURL = &sourceURL;
v8::HandleScope handleScope(m_isolate);
v8::Handle<v8::Context> v8Context = toV8Context(m_isolate, m_frame, DOMWrapperWorld::mainWorld());
v8::Handle<v8::Context> v8Context = toV8Context(m_frame, DOMWrapperWorld::mainWorld());
if (v8Context.IsEmpty())
return ScriptValue();
v8::Context::Scope scope(v8Context);
......
......@@ -47,7 +47,7 @@ ScriptPreprocessor::ScriptPreprocessor(const ScriptSourceCode& preprocessorSourc
: m_isPreprocessing(false)
{
RefPtr<DOMWrapperWorld> world = DOMWrapperWorld::ensureIsolatedWorld(ScriptPreprocessorIsolatedWorldId, DOMWrapperWorld::mainWorldExtensionGroup);
m_scriptState = ScriptState::from(toV8Context(toIsolate(frame), frame, *world));
m_scriptState = ScriptState::from(toV8Context(frame, *world));
ASSERT(frame);
v8::TryCatch tryCatch;
......
......@@ -84,7 +84,7 @@ ScriptState* ScriptState::forMainWorld(LocalFrame* frame)
{
v8::Isolate* isolate = toIsolate(frame);
v8::HandleScope handleScope(isolate);
return ScriptState::from(toV8Context(isolate, frame, DOMWrapperWorld::mainWorld()));
return ScriptState::from(toV8Context(frame, DOMWrapperWorld::mainWorld()));
}
PassRefPtr<ScriptStateForTesting> ScriptStateForTesting::create(v8::Handle<v8::Context> context, PassRefPtr<DOMWrapperWorld> world)
......
......@@ -604,7 +604,7 @@ v8::Local<v8::Context> toV8Context(ExecutionContext* context, DOMWrapperWorld& w
return v8::Local<v8::Context>();
}
v8::Local<v8::Context> toV8Context(v8::Isolate* isolate, LocalFrame* frame, DOMWrapperWorld& world)
v8::Local<v8::Context> toV8Context(LocalFrame* frame, DOMWrapperWorld& world)
{
if (!frame)
return v8::Local<v8::Context>();
......
......@@ -770,7 +770,7 @@ ExecutionContext* callingExecutionContext(v8::Isolate*);
v8::Local<v8::Context> toV8Context(ExecutionContext*, DOMWrapperWorld&);
// Returns a V8 context associated with a LocalFrame and a DOMWrapperWorld.
// This method returns an empty context if the frame is already detached.
v8::Local<v8::Context> toV8Context(v8::Isolate*, LocalFrame*, DOMWrapperWorld&);
v8::Local<v8::Context> toV8Context(LocalFrame*, DOMWrapperWorld&);
// Returns the frame object of the window object associated with
// a context, if the window is currently being displayed in the LocalFrame.
......
......@@ -58,7 +58,7 @@ void V8HTMLDocument::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
if (info.Length() > 2) {
if (RefPtr<LocalFrame> frame = htmlDocument->frame()) {
// Fetch the global object for the frame.
v8::Local<v8::Context> context = toV8Context(info.GetIsolate(), frame.get(), DOMWrapperWorld::current(info.GetIsolate()));
v8::Local<v8::Context> context = toV8Context(frame.get(), DOMWrapperWorld::current(info.GetIsolate()));
// Bail out if we cannot get the context.
if (context.IsEmpty())
return;
......
......@@ -309,14 +309,13 @@ void DialogHandler::dialogCreated(DOMWindow* dialogFrame)
{
if (m_dialogArguments.IsEmpty())
return;
v8::Isolate* isolate = m_scriptState->isolate();
v8::Handle<v8::Context> context = toV8Context(isolate, dialogFrame->frame(), m_scriptState->world());
v8::Handle<v8::Context> context = toV8Context(dialogFrame->frame(), m_scriptState->world());
if (context.IsEmpty())
return;
m_scriptStateForDialogFrame = ScriptState::from(context);
ScriptState::Scope scope(m_scriptStateForDialogFrame.get());
m_scriptStateForDialogFrame->context()->Global()->Set(v8AtomicString(isolate, "dialogArguments"), m_dialogArguments);
m_scriptStateForDialogFrame->context()->Global()->Set(v8AtomicString(m_scriptState->isolate(), "dialogArguments"), m_dialogArguments);
}
v8::Handle<v8::Value> DialogHandler::returnValue() const
......@@ -530,7 +529,7 @@ v8::Handle<v8::Value> toV8(DOMWindow* window, v8::Handle<v8::Object> creationCon
if (!frame)
return v8Undefined();
v8::Handle<v8::Context> context = toV8Context(isolate, frame, DOMWrapperWorld::current(isolate));
v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::current(isolate));
if (context.IsEmpty())
return v8Undefined();
......
......@@ -714,7 +714,7 @@ Page* InspectorOverlay::overlayPage()
loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html", "UTF-8", KURL(), ForceSynchronousLoad)));
v8::Isolate* isolate = toIsolate(frame.get());
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> frameContext = toV8Context(isolate, frame.get(), DOMWrapperWorld::mainWorld());
v8::Handle<v8::Context> frameContext = toV8Context(frame.get(), DOMWrapperWorld::mainWorld());
ASSERT(!frameContext.IsEmpty());
v8::Context::Scope contextScope(frameContext);
v8::Handle<v8::Object> global = frameContext->Global();
......
......@@ -63,7 +63,7 @@ void InspectorFrontendClientImpl::windowObjectCleared()
{
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
v8::Handle<v8::Context> frameContext = m_frontendPage->mainFrame() ? toV8Context(isolate, m_frontendPage->mainFrame(), DOMWrapperWorld::mainWorld()) : v8::Local<v8::Context>();
v8::Handle<v8::Context> frameContext = m_frontendPage->mainFrame() ? toV8Context(m_frontendPage->mainFrame(), DOMWrapperWorld::mainWorld()) : v8::Local<v8::Context>();
v8::Context::Scope contextScope(frameContext);
if (m_frontendHost)
......
......@@ -138,7 +138,7 @@ void WebDevToolsFrontendImpl::doDispatchOnInspectorFrontend(const WebString& mes
return;
v8::Isolate* isolate = toIsolate(frame->frame());
v8::HandleScope scope(isolate);
v8::Handle<v8::Context> frameContext = toV8Context(isolate, frame->frame(), DOMWrapperWorld::mainWorld());
v8::Handle<v8::Context> frameContext = toV8Context(frame->frame(), DOMWrapperWorld::mainWorld());
if (frameContext.IsEmpty())
return;
v8::Context::Scope contextScope(frameContext);
......
......@@ -838,7 +838,7 @@ v8::Handle<v8::Value> WebLocalFrameImpl::callFunctionEvenIfScriptDisabled(v8::Ha
v8::Local<v8::Context> WebLocalFrameImpl::mainWorldScriptContext() const
{
return toV8Context(V8PerIsolateData::mainThreadIsolate(), frame(), DOMWrapperWorld::mainWorld());
return toV8Context(frame(), DOMWrapperWorld::mainWorld());
}
void WebLocalFrameImpl::reload(bool ignoreCache)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment