Diff
Modified: trunk/Source/WebCore/ChangeLog (140728 => 140729)
--- trunk/Source/WebCore/ChangeLog 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/ChangeLog 2013-01-24 22:57:57 UTC (rev 140729)
@@ -1,3 +1,44 @@
+2013-01-24 Kentaro Hara <[email protected]>
+
+ [V8] Pass an Isolate to GetTemplate() in v8/*.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=107789
+
+ Reviewed by Adam Barth.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/Dictionary.cpp:
+ (WebCore::Dictionary::get):
+ * bindings/v8/PageScriptDebugServer.cpp:
+ (WebCore::retrieveFrameWithGlobalObjectCheck):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::toDOMWindow):
+ (WebCore::toScriptExecutionContext):
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::clearForNavigation):
+ * bindings/v8/V8Initializer.cpp:
+ (WebCore::findFrame):
+ (WebCore::failedAccessCheckCallbackInMainThread):
+ * bindings/v8/WorkerScriptController.cpp:
+ (WebCore::WorkerScriptController::controllerForContext):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::eventAccessorGetter):
+ (WebCore::V8DOMWindow::eventAccessorSetter):
+ (WebCore::V8DOMWindow::toStringCallback):
+ (WebCore::toV8):
+ * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
+ (WebCore::V8HTMLImageElementConstructor::GetTemplate):
+ * bindings/v8/custom/V8InjectedScriptManager.cpp:
+ (WebCore::createInjectedScriptHostV8Wrapper):
+ (WebCore::InjectedScriptManager::createInjectedScript):
+ (WebCore::InjectedScriptManager::canAccessInspectedWindow):
+ * bindings/v8/custom/V8LocationCustom.cpp:
+ (WebCore::V8Location::reloadAccessorGetter):
+ (WebCore::V8Location::replaceAccessorGetter):
+ (WebCore::V8Location::assignAccessorGetter):
+ * bindings/v8/custom/V8MessageEventCustom.cpp:
+ (WebCore::V8MessageEvent::initMessageEventCallback):
+
2013-01-24 Emil A Eklund <[email protected]>
[svg] Remove unnecessary rounding in SVGRootInlineBox::layoutRootBox
Modified: trunk/Source/WebCore/bindings/v8/Dictionary.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/Dictionary.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/Dictionary.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -257,7 +257,7 @@
DOMWindow* source = 0;
if (v8Value->IsObject()) {
v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
- v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(m_isolate));
if (!window.IsEmpty())
source = V8DOMWindow::toNative(window);
}
@@ -274,7 +274,7 @@
Storage* source = 0;
if (v8Value->IsObject()) {
v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
- v8::Handle<v8::Object> storage = wrapper->FindInstanceInPrototypeChain(V8Storage::GetTemplate());
+ v8::Handle<v8::Object> storage = wrapper->FindInstanceInPrototypeChain(V8Storage::GetTemplate(m_isolate));
if (!storage.IsEmpty())
source = V8Storage::toNative(storage);
}
@@ -337,7 +337,7 @@
Uint8Array* source = 0;
if (v8Value->IsObject()) {
v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
- v8::Handle<v8::Object> array = wrapper->FindInstanceInPrototypeChain(V8Uint8Array::GetTemplate());
+ v8::Handle<v8::Object> array = wrapper->FindInstanceInPrototypeChain(V8Uint8Array::GetTemplate(m_isolate));
if (!array.IsEmpty())
source = V8Uint8Array::toNative(array);
}
@@ -355,7 +355,7 @@
MediaKeyError* source = 0;
if (v8Value->IsObject()) {
v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
- v8::Handle<v8::Object> error = wrapper->FindInstanceInPrototypeChain(V8MediaKeyError::GetTemplate());
+ v8::Handle<v8::Object> error = wrapper->FindInstanceInPrototypeChain(V8MediaKeyError::GetTemplate(m_isolate));
if (!error.IsEmpty())
source = V8MediaKeyError::toNative(error);
}
@@ -377,7 +377,7 @@
// FIXME: this will need to be changed so it can also return an AudioTrack or a VideoTrack once
// we add them.
- v8::Handle<v8::Object> track = wrapper->FindInstanceInPrototypeChain(V8TextTrack::GetTemplate());
+ v8::Handle<v8::Object> track = wrapper->FindInstanceInPrototypeChain(V8TextTrack::GetTemplate(m_isolate));
if (!track.IsEmpty())
source = V8TextTrack::toNative(track);
}
@@ -396,7 +396,7 @@
SpeechRecognitionError* source = 0;
if (v8Value->IsObject()) {
v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
- v8::Handle<v8::Object> speechRecognitionError = wrapper->FindInstanceInPrototypeChain(V8SpeechRecognitionError::GetTemplate());
+ v8::Handle<v8::Object> speechRecognitionError = wrapper->FindInstanceInPrototypeChain(V8SpeechRecognitionError::GetTemplate(m_isolate));
if (!speechRecognitionError.IsEmpty())
source = V8SpeechRecognitionError::toNative(speechRecognitionError);
}
@@ -413,7 +413,7 @@
SpeechRecognitionResult* source = 0;
if (v8Value->IsObject()) {
v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
- v8::Handle<v8::Object> speechRecognitionResult = wrapper->FindInstanceInPrototypeChain(V8SpeechRecognitionResult::GetTemplate());
+ v8::Handle<v8::Object> speechRecognitionResult = wrapper->FindInstanceInPrototypeChain(V8SpeechRecognitionResult::GetTemplate(m_isolate));
if (!speechRecognitionResult.IsEmpty())
source = V8SpeechRecognitionResult::toNative(speechRecognitionResult);
}
@@ -430,7 +430,7 @@
SpeechRecognitionResultList* source = 0;
if (v8Value->IsObject()) {
v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
- v8::Handle<v8::Object> speechRecognitionResultList = wrapper->FindInstanceInPrototypeChain(V8SpeechRecognitionResultList::GetTemplate());
+ v8::Handle<v8::Object> speechRecognitionResultList = wrapper->FindInstanceInPrototypeChain(V8SpeechRecognitionResultList::GetTemplate(m_isolate));
if (!speechRecognitionResultList.IsEmpty())
source = V8SpeechRecognitionResultList::toNative(speechRecognitionResultList);
}
@@ -450,7 +450,7 @@
MediaStream* stream = 0;
if (v8Value->IsObject()) {
v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
- v8::Handle<v8::Object> error = wrapper->FindInstanceInPrototypeChain(V8MediaStream::GetTemplate());
+ v8::Handle<v8::Object> error = wrapper->FindInstanceInPrototypeChain(V8MediaStream::GetTemplate(m_isolate));
if (!error.IsEmpty())
stream = V8MediaStream::toNative(error);
}
Modified: trunk/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -56,7 +56,7 @@
if (global.IsEmpty())
return 0;
- global = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ global = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(context->GetIsolate()));
if (global.IsEmpty())
return 0;
Modified: trunk/Source/WebCore/bindings/v8/V8Binding.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/V8Binding.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -221,7 +221,7 @@
{
v8::Handle<v8::Object> global = context->Global();
ASSERT(!global.IsEmpty());
- global = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ global = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(context->GetIsolate()));
ASSERT(!global.IsEmpty());
return V8DOMWindow::toNative(global);
}
@@ -229,11 +229,11 @@
ScriptExecutionContext* toScriptExecutionContext(v8::Handle<v8::Context> context)
{
v8::Handle<v8::Object> global = context->Global();
- v8::Handle<v8::Object> windowWrapper = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ v8::Handle<v8::Object> windowWrapper = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(context->GetIsolate()));
if (!windowWrapper.IsEmpty())
return V8DOMWindow::toNative(windowWrapper)->scriptExecutionContext();
#if ENABLE(WORKERS)
- v8::Handle<v8::Object> workerWrapper = global->FindInstanceInPrototypeChain(V8WorkerContext::GetTemplate());
+ v8::Handle<v8::Object> workerWrapper = global->FindInstanceInPrototypeChain(V8WorkerContext::GetTemplate(context->GetIsolate()));
if (!workerWrapper.IsEmpty())
return V8WorkerContext::toNative(workerWrapper)->scriptExecutionContext();
#endif
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -153,7 +153,7 @@
// will be protected by the security checks on the DOMWindow wrapper.
clearDocumentProperty();
- v8::Handle<v8::Object> windowWrapper = m_global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ v8::Handle<v8::Object> windowWrapper = m_global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(m_isolate));
ASSERT(!windowWrapper.IsEmpty());
windowWrapper->TurnOnAccessCheck();
m_context->DetachGlobal();
Modified: trunk/Source/WebCore/bindings/v8/V8Initializer.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/V8Initializer.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/V8Initializer.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -46,12 +46,12 @@
namespace WebCore {
-static Frame* findFrame(v8::Local<v8::Object> host, v8::Local<v8::Value> data)
+static Frame* findFrame(v8::Local<v8::Object> host, v8::Local<v8::Value> data, v8::Isolate* isolate)
{
WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data);
if (V8DOMWindow::info.equals(type)) {
- v8::Handle<v8::Object> windowWrapper = host->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ v8::Handle<v8::Object> windowWrapper = host->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(isolate));
if (windowWrapper.IsEmpty())
return 0;
return V8DOMWindow::toNative(windowWrapper)->frame();
@@ -97,7 +97,7 @@
static void failedAccessCheckCallbackInMainThread(v8::Local<v8::Object> host, v8::AccessType type, v8::Local<v8::Value> data)
{
- Frame* target = findFrame(host, data);
+ Frame* target = findFrame(host, data, v8::Isolate::GetCurrent());
if (!target)
return;
DOMWindow* targetWindow = target->document()->domWindow();
Modified: trunk/Source/WebCore/bindings/v8/WorkerScriptController.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/WorkerScriptController.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/WorkerScriptController.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -248,7 +248,7 @@
return 0;
v8::Handle<v8::Context> context = v8::Context::GetCurrent();
v8::Handle<v8::Object> global = context->Global();
- global = global->FindInstanceInPrototypeChain(V8WorkerContext::GetTemplate());
+ global = global->FindInstanceInPrototypeChain(V8WorkerContext::GetTemplate(context->GetIsolate()));
// Return 0 if the current executing context is not the worker context.
if (global.IsEmpty())
return 0;
Modified: trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -146,7 +146,7 @@
v8::Handle<v8::Value> V8DOMWindow::eventAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(info.GetIsolate()));
if (holder.IsEmpty())
return v8::Undefined();
@@ -168,7 +168,7 @@
void V8DOMWindow::eventAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(info.GetIsolate()));
if (holder.IsEmpty())
return;
@@ -344,7 +344,7 @@
// switching context of receiver. I consider it is dangerous.
v8::Handle<v8::Value> V8DOMWindow::toStringCallback(const v8::Arguments& args)
{
- v8::Handle<v8::Object> domWrapper = args.This()->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ v8::Handle<v8::Object> domWrapper = args.This()->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(args.GetIsolate()));
if (domWrapper.IsEmpty())
return args.This()->ObjectProtoToString();
return domWrapper->ObjectProtoToString();
@@ -584,7 +584,7 @@
// necessarily the first global object associated with that DOMWindow.
v8::Handle<v8::Context> currentContext = v8::Context::GetCurrent();
v8::Handle<v8::Object> currentGlobal = currentContext->Global();
- v8::Handle<v8::Object> windowWrapper = currentGlobal->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ v8::Handle<v8::Object> windowWrapper = currentGlobal->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(isolate));
if (!windowWrapper.IsEmpty()) {
if (V8DOMWindow::toNative(windowWrapper) == window)
return currentGlobal;
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -93,7 +93,7 @@
v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
instance->SetInternalFieldCount(V8HTMLImageElement::internalFieldCount);
result->SetClassName(v8::String::NewSymbol("HTMLImageElement"));
- result->Inherit(V8HTMLImageElement::GetTemplate());
+ result->Inherit(V8HTMLImageElement::GetTemplate(isolate));
cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result);
return cachedTemplate;
Modified: trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -53,9 +53,9 @@
object.Clear();
}
-static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(InjectedScriptHost* host)
+static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(InjectedScriptHost* host, v8::Isolate* isolate)
{
- v8::Local<v8::Function> function = V8InjectedScriptHost::GetTemplate()->GetFunction();
+ v8::Local<v8::Function> function = V8InjectedScriptHost::GetTemplate(isolate)->GetFunction();
if (function.IsEmpty()) {
// Return if allocation failed.
return v8::Local<v8::Object>();
@@ -85,7 +85,7 @@
// instead of calling toV8() that would create the
// wrapper in the current context.
// FIXME: make it possible to use generic bindings factory for InjectedScriptHost.
- v8::Local<v8::Object> scriptHostWrapper = createInjectedScriptHostV8Wrapper(m_injectedScriptHost.get());
+ v8::Local<v8::Object> scriptHostWrapper = createInjectedScriptHostV8Wrapper(m_injectedScriptHost.get(), inspectedContext->GetIsolate());
if (scriptHostWrapper.IsEmpty())
return ScriptObject();
@@ -118,7 +118,7 @@
v8::Local<v8::Object> global = context->Global();
if (global.IsEmpty())
return false;
- v8::Handle<v8::Object> holder = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ v8::Handle<v8::Object> holder = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(context->GetIsolate()));
if (holder.IsEmpty())
return false;
Frame* frame = V8DOMWindow::toNative(holder)->frame();
Modified: trunk/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -139,7 +139,7 @@
v8::Handle<v8::Value> V8Location::reloadAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::reloadCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate())));
- v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate());
+ v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(info.GetIsolate()));
if (holder.IsEmpty()) {
// can only reach here by 'object.__proto__.func', and it should passed
// domain security check already
@@ -156,7 +156,7 @@
v8::Handle<v8::Value> V8Location::replaceAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::replaceCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate())));
- v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate());
+ v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(info.GetIsolate()));
if (holder.IsEmpty()) {
// can only reach here by 'object.__proto__.func', and it should passed
// domain security check already
@@ -174,7 +174,7 @@
{
static v8::Persistent<v8::FunctionTemplate> privateTemplate =
v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::assignCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate())));
- v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate());
+ v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(info.GetIsolate()));
if (holder.IsEmpty()) {
// can only reach here by 'object.__proto__.func', and it should passed
// domain security check already
Modified: trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp (140728 => 140729)
--- trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp 2013-01-24 22:48:50 UTC (rev 140728)
+++ trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp 2013-01-24 22:57:57 UTC (rev 140729)
@@ -116,7 +116,7 @@
DOMWindow* sourceArg = 0;
if (args[6]->IsObject()) {
v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(args[6]);
- v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate());
+ v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(args.GetIsolate()));
if (!window.IsEmpty())
sourceArg = V8DOMWindow::toNative(window);
}