Title: [136822] trunk/Source/WebCore
Revision
136822
Author
[email protected]
Date
2012-12-06 01:19:09 -0800 (Thu, 06 Dec 2012)

Log Message

[V8] Implement deprecatedV8String()
https://bugs.webkit.org/show_bug.cgi?id=104230

Reviewed by Adam Barth.

To make an Isolate mandatory in v8String(), we implement
deprecatedV8String() for call sites that don't have
an Isolate. Eventually we want to kill the method though.

No tests. No change in behavior.

* bindings/scripts/test/V8/V8TestCallback.cpp:
(WebCore::V8TestCallback::callbackWithClass2Param):
* bindings/v8/Dictionary.cpp:
(WebCore::Dictionary::getKey):
* bindings/v8/IDBBindingUtilities.cpp:
(WebCore::get):
(WebCore::set):
* bindings/v8/_javascript_CallFrame.cpp:
(WebCore::_javascript_CallFrame::evaluate):
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::compileAndRunScript):
(WebCore::ScriptController::bindToWindowObject):
(WebCore::ScriptController::disableEval):
* bindings/v8/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::setBreakpoint):
(WebCore::ScriptDebugServer::removeBreakpoint):
(WebCore::ScriptDebugServer::setScriptSource):
(WebCore::ScriptDebugServer::ensureDebuggerScriptCompiled):
(WebCore::ScriptDebugServer::compileScript):
* bindings/v8/ScriptFunctionCall.cpp:
(WebCore::ScriptCallArgumentHandler::appendArgument):
(WebCore::ScriptFunctionCall::call):
(WebCore::ScriptFunctionCall::construct):
* bindings/v8/ScriptProfiler.cpp:
(WebCore::ScriptProfiler::start):
(WebCore::ScriptProfiler::stop):
(WebCore::ScriptProfiler::takeHeapSnapshot):
* bindings/v8/ScriptSourceCode.cpp:
(WebCore::ScriptSourceCode::compileScript):
* bindings/v8/V8Binding.h:
(WebCore):
(WebCore::deprecatedV8String):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::initializeIfNeeded):
(WebCore::V8DOMWindowShell::namedItemAdded):
(WebCore::V8DOMWindowShell::namedItemRemoved):
* bindings/v8/V8LazyEventListener.cpp:
(WebCore::V8LazyEventListener::prepareListenerObject):
* bindings/v8/V8WindowErrorHandler.cpp:
(WebCore::V8WindowErrorHandler::callListenerFunction):
* bindings/v8/V8WorkerContextErrorHandler.cpp:
(WebCore::V8WorkerContextErrorHandler::callListenerFunction):
* bindings/v8/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* bindings/v8/custom/V8ArrayBufferViewCustom.cpp:
(WebCore::installHiddenCopyMethod):
(WebCore::copyElements):
* bindings/v8/custom/V8CustomXPathNSResolver.cpp:
(WebCore::V8CustomXPathNSResolver::lookupNamespaceURI):
* bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
(WebCore::V8InjectedScriptHost::getEventListenersCallback):
* bindings/v8/custom/V8InjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::createInjectedScript):
* bindings/v8/custom/V8MessageEventCustom.cpp:
(WebCore::V8MessageEvent::dataAccessorGetter):
* bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
(WebCore::toV8Object):
(WebCore::V8WebGLRenderingContext::getSupportedExtensionsCallback):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136821 => 136822)


--- trunk/Source/WebCore/ChangeLog	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/ChangeLog	2012-12-06 09:19:09 UTC (rev 136822)
@@ -1,3 +1,75 @@
+2012-12-05  Kentaro Hara  <[email protected]>
+
+        [V8] Implement deprecatedV8String()
+        https://bugs.webkit.org/show_bug.cgi?id=104230
+
+        Reviewed by Adam Barth.
+
+        To make an Isolate mandatory in v8String(), we implement
+        deprecatedV8String() for call sites that don't have
+        an Isolate. Eventually we want to kill the method though.
+
+        No tests. No change in behavior.
+
+        * bindings/scripts/test/V8/V8TestCallback.cpp:
+        (WebCore::V8TestCallback::callbackWithClass2Param):
+        * bindings/v8/Dictionary.cpp:
+        (WebCore::Dictionary::getKey):
+        * bindings/v8/IDBBindingUtilities.cpp:
+        (WebCore::get):
+        (WebCore::set):
+        * bindings/v8/_javascript_CallFrame.cpp:
+        (WebCore::_javascript_CallFrame::evaluate):
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::compileAndRunScript):
+        (WebCore::ScriptController::bindToWindowObject):
+        (WebCore::ScriptController::disableEval):
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::setBreakpoint):
+        (WebCore::ScriptDebugServer::removeBreakpoint):
+        (WebCore::ScriptDebugServer::setScriptSource):
+        (WebCore::ScriptDebugServer::ensureDebuggerScriptCompiled):
+        (WebCore::ScriptDebugServer::compileScript):
+        * bindings/v8/ScriptFunctionCall.cpp:
+        (WebCore::ScriptCallArgumentHandler::appendArgument):
+        (WebCore::ScriptFunctionCall::call):
+        (WebCore::ScriptFunctionCall::construct):
+        * bindings/v8/ScriptProfiler.cpp:
+        (WebCore::ScriptProfiler::start):
+        (WebCore::ScriptProfiler::stop):
+        (WebCore::ScriptProfiler::takeHeapSnapshot):
+        * bindings/v8/ScriptSourceCode.cpp:
+        (WebCore::ScriptSourceCode::compileScript):
+        * bindings/v8/V8Binding.h:
+        (WebCore):
+        (WebCore::deprecatedV8String):
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::initializeIfNeeded):
+        (WebCore::V8DOMWindowShell::namedItemAdded):
+        (WebCore::V8DOMWindowShell::namedItemRemoved):
+        * bindings/v8/V8LazyEventListener.cpp:
+        (WebCore::V8LazyEventListener::prepareListenerObject):
+        * bindings/v8/V8WindowErrorHandler.cpp:
+        (WebCore::V8WindowErrorHandler::callListenerFunction):
+        * bindings/v8/V8WorkerContextErrorHandler.cpp:
+        (WebCore::V8WorkerContextErrorHandler::callListenerFunction):
+        * bindings/v8/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::evaluate):
+        * bindings/v8/custom/V8ArrayBufferViewCustom.cpp:
+        (WebCore::installHiddenCopyMethod):
+        (WebCore::copyElements):
+        * bindings/v8/custom/V8CustomXPathNSResolver.cpp:
+        (WebCore::V8CustomXPathNSResolver::lookupNamespaceURI):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::V8InjectedScriptHost::getEventListenersCallback):
+        * bindings/v8/custom/V8InjectedScriptManager.cpp:
+        (WebCore::InjectedScriptManager::createInjectedScript):
+        * bindings/v8/custom/V8MessageEventCustom.cpp:
+        (WebCore::V8MessageEvent::dataAccessorGetter):
+        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
+        (WebCore::toV8Object):
+        (WebCore::V8WebGLRenderingContext::getSupportedExtensionsCallback):
+
 2012-12-06  Keishi Hattori  <[email protected]>
 
         Page popup should align to the right when the anchor element is rtl

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (136821 => 136822)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-12-06 09:19:09 UTC (rev 136822)
@@ -4081,7 +4081,7 @@
 
             die "Unknown value for TreatReturnedNullStringAs extended attribute";
         }
-        return "v8String($value$getIsolateArg)";
+        return $getIsolate ? "v8String($value, $getIsolate)" : "deprecatedV8String($value)";
     }
 
     my $arrayType = $codeGenerator->GetArrayType($type);

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -123,7 +123,7 @@
             CRASH();
         return true;
     }
-    v8::Handle<v8::Value> strArgHandle = v8String(strArg);
+    v8::Handle<v8::Value> strArgHandle = deprecatedV8String(strArg);
     if (strArgHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();

Modified: trunk/Source/WebCore/bindings/v8/Dictionary.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/Dictionary.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/Dictionary.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -102,7 +102,9 @@
     v8::Local<v8::Object> options = m_options->ToObject();
     ASSERT(!options.IsEmpty());
 
-    v8::Handle<v8::String> v8Key = v8String(key);
+    ASSERT(m_isolate);
+    ASSERT(m_isolate == v8::Isolate::GetCurrent());
+    v8::Handle<v8::String> v8Key = v8String(key, m_isolate);
     if (!options->Has(v8Key))
         return false;
     value = options->Get(v8Key);

Modified: trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -108,7 +108,7 @@
         result = v8::Number::New(length);
         return true;
     }
-    return object->IsObject() && getValueFrom(v8String(keyPathElement), result);
+    return object->IsObject() && getValueFrom(deprecatedV8String(keyPathElement), result);
 }
 
 static bool canSet(v8::Handle<v8::Value>& object, const String& keyPathElement)
@@ -118,7 +118,7 @@
 
 static bool set(v8::Handle<v8::Value>& object, const String& keyPathElement, const v8::Handle<v8::Value>& v8Value)
 {
-    return canSet(object, keyPathElement) && setValue(object, v8String(keyPathElement), v8Value);
+    return canSet(object, keyPathElement) && setValue(object, deprecatedV8String(keyPathElement), v8Value);
 }
 
 static v8::Handle<v8::Value> getNthValueOnKeyPath(v8::Handle<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index)

Modified: trunk/Source/WebCore/bindings/v8/_javascript_CallFrame.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/_javascript_CallFrame.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/_javascript_CallFrame.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -121,7 +121,7 @@
 v8::Handle<v8::Value> _javascript_CallFrame::evaluate(const String& _expression_)
 {
     v8::Handle<v8::Function> evalFunction = v8::Handle<v8::Function>::Cast(m_callFrame.get()->Get(v8::String::NewSymbol("evaluate")));
-    v8::Handle<v8::Value> argv[] = { v8String(_expression_) };
+    v8::Handle<v8::Value> argv[] = { deprecatedV8String(_expression_) };
     return evalFunction->Call(m_callFrame.get(), 1, argv);
 }
 

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -262,7 +262,7 @@
         tryCatch.SetVerbose(true);
 
         // Compile the script.
-        v8::Handle<v8::String> code = v8String(source.source());
+        v8::Handle<v8::String> code = deprecatedV8String(source.source());
 #if PLATFORM(CHROMIUM)
         TRACE_EVENT_BEGIN0("v8", "v8.compile");
 #endif
@@ -491,7 +491,7 @@
 
     // Attach to the global object.
     v8::Handle<v8::Object> global = v8Context->Global();
-    global->Set(v8String(key), value);
+    global->Set(deprecatedV8String(key), value);
 }
 
 bool ScriptController::haveInterpreter() const
@@ -514,7 +514,7 @@
     v8::HandleScope handleScope;
     v8::Handle<v8::Context> v8Context = m_windowShell->context();
     v8Context->AllowCodeGenerationFromStrings(false);
-    v8Context->SetErrorMessageForCodeGenerationFromStrings(v8String(errorMessage));
+    v8Context->SetErrorMessageForCodeGenerationFromStrings(deprecatedV8String(errorMessage));
 }
 
 PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widget)

Modified: trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -78,10 +78,10 @@
     v8::Context::Scope contextScope(debuggerContext);
 
     v8::Local<v8::Object> args = v8::Object::New();
-    args->Set(v8::String::NewSymbol("sourceID"), v8String(sourceID));
+    args->Set(v8::String::NewSymbol("sourceID"), deprecatedV8String(sourceID));
     args->Set(v8::String::NewSymbol("lineNumber"), deprecatedV8Integer(scriptBreakpoint.lineNumber));
     args->Set(v8::String::NewSymbol("columnNumber"), deprecatedV8Integer(scriptBreakpoint.columnNumber));
-    args->Set(v8::String::NewSymbol("condition"), v8String(scriptBreakpoint.condition));
+    args->Set(v8::String::NewSymbol("condition"), deprecatedV8String(scriptBreakpoint.condition));
 
     v8::Handle<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::NewSymbol("setBreakpoint")));
     v8::Handle<v8::Value> breakpointId = v8::Debug::Call(setBreakpointFunction, args);
@@ -99,7 +99,7 @@
     v8::Context::Scope contextScope(debuggerContext);
 
     v8::Local<v8::Object> args = v8::Object::New();
-    args->Set(v8::String::NewSymbol("breakpointId"), v8String(breakpointId));
+    args->Set(v8::String::NewSymbol("breakpointId"), deprecatedV8String(breakpointId));
 
     v8::Handle<v8::Function> removeBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::NewSymbol("removeBreakpoint")));
     v8::Debug::Call(removeBreakpointFunction, args);
@@ -231,7 +231,7 @@
     if (!isPaused())
         contextScope = adoptPtr(new v8::Context::Scope(v8::Debug::GetDebugContext()));
 
-    v8::Handle<v8::Value> argv[] = { v8String(sourceID), v8String(newContent), v8Boolean(preview) };
+    v8::Handle<v8::Value> argv[] = { deprecatedV8String(sourceID), deprecatedV8String(newContent), v8Boolean(preview) };
 
     v8::TryCatch tryCatch;
     tryCatch.SetVerbose(false);
@@ -400,7 +400,7 @@
         v8::Context::Scope contextScope(debuggerContext);
         String debuggerScriptSource(reinterpret_cast<const char*>(DebuggerScriptSource_js), sizeof(DebuggerScriptSource_js));
         V8RecursionScope::MicrotaskSuppression recursionScope;
-        m_debuggerScript.set(v8::Handle<v8::Object>::Cast(v8::Script::Compile(v8String(debuggerScriptSource))->Run()));
+        m_debuggerScript.set(v8::Handle<v8::Object>::Cast(v8::Script::Compile(deprecatedV8String(debuggerScriptSource))->Run()));
     }
 }
 
@@ -435,10 +435,10 @@
         return;
     v8::Context::Scope contextScope(context);
 
-    v8::Handle<v8::String> code = v8String(_expression_);
+    v8::Handle<v8::String> code = deprecatedV8String(_expression_);
     v8::TryCatch tryCatch;
 
-    v8::ScriptOrigin origin(v8String(sourceURL), deprecatedV8Integer(0), deprecatedV8Integer(0));
+    v8::ScriptOrigin origin(deprecatedV8String(sourceURL), deprecatedV8Integer(0), deprecatedV8Integer(0));
     v8::Handle<v8::Script> script = v8::Script::New(code, &origin);
 
     if (tryCatch.HasCaught()) {

Modified: trunk/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -62,13 +62,13 @@
 void ScriptCallArgumentHandler::appendArgument(const String& argument)
 {
     ScriptScope scope(m_scriptState);
-    m_arguments.append(v8String(argument));
+    m_arguments.append(deprecatedV8String(argument));
 }
 
 void ScriptCallArgumentHandler::appendArgument(const char* argument)
 {
     ScriptScope scope(m_scriptState);
-    m_arguments.append(v8String(argument));
+    m_arguments.append(deprecatedV8String(argument));
 }
 
 void ScriptCallArgumentHandler::appendArgument(long argument)
@@ -118,7 +118,7 @@
     ScriptScope scope(m_scriptState, reportExceptions);
 
     v8::Local<v8::Object> thisObject = m_thisObject.v8Object();
-    v8::Local<v8::Value> value = thisObject->Get(v8String(m_name));
+    v8::Local<v8::Value> value = thisObject->Get(deprecatedV8String(m_name));
     if (!scope.success()) {
         hadException = true;
         return ScriptValue();
@@ -155,7 +155,7 @@
     ScriptScope scope(m_scriptState, reportExceptions);
 
     v8::Local<v8::Object> thisObject = m_thisObject.v8Object();
-    v8::Local<v8::Value> value = thisObject->Get(v8String(m_name));
+    v8::Local<v8::Value> value = thisObject->Get(deprecatedV8String(m_name));
     if (!scope.success()) {
         hadException = true;
         return ScriptObject();

Modified: trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -48,7 +48,7 @@
 void ScriptProfiler::start(ScriptState* state, const String& title)
 {
     v8::HandleScope hs;
-    v8::CpuProfiler::StartProfiling(v8String(title));
+    v8::CpuProfiler::StartProfiling(deprecatedV8String(title));
 }
 
 void ScriptProfiler::startForPage(Page*, const String& title)
@@ -67,8 +67,8 @@
 {
     v8::HandleScope hs;
     const v8::CpuProfile* profile = "" ?
-        v8::CpuProfiler::StopProfiling(v8String(title), state->context()->GetSecurityToken()) :
-        v8::CpuProfiler::StopProfiling(v8String(title));
+        v8::CpuProfiler::StopProfiling(deprecatedV8String(title), state->context()->GetSecurityToken()) :
+        v8::CpuProfiler::StopProfiling(deprecatedV8String(title));
     return profile ? ScriptProfile::create(profile) : 0;
 }
 
@@ -152,7 +152,7 @@
     v8::HandleScope hs;
     ASSERT(control);
     ActivityControlAdapter adapter(control);
-    const v8::HeapSnapshot* snapshot = v8::HeapProfiler::TakeSnapshot(v8String(title), v8::HeapSnapshot::kFull, &adapter);
+    const v8::HeapSnapshot* snapshot = v8::HeapProfiler::TakeSnapshot(deprecatedV8String(title), v8::HeapSnapshot::kFull, &adapter);
     return snapshot ? ScriptHeapSnapshot::create(snapshot) : 0;
 }
 

Modified: trunk/Source/WebCore/bindings/v8/ScriptSourceCode.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/ScriptSourceCode.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/ScriptSourceCode.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -59,7 +59,7 @@
 
 v8::Handle<v8::Script> ScriptSourceCode::compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition& scriptStartPosition, v8::ScriptData* scriptData)
 {
-    v8::Handle<v8::String> name = v8String(fileName);
+    v8::Handle<v8::String> name = deprecatedV8String(fileName);
     v8::Handle<v8::Integer> line = deprecatedV8Integer(scriptStartPosition.m_line.zeroBasedInt());
     v8::Handle<v8::Integer> column = deprecatedV8Integer(scriptStartPosition.m_column.zeroBasedInt());
     v8::ScriptOrigin origin(name, line, column);

Modified: trunk/Source/WebCore/bindings/v8/V8Binding.h (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-12-06 09:19:09 UTC (rev 136822)
@@ -154,6 +154,12 @@
         return V8PerIsolateData::from(isolate)->stringCache()->v8ExternalString(string.impl(), isolate);
     }
 
+    // FIXME: All call sites of this method should use v8UnsignedInteger().
+    inline v8::Handle<v8::String> deprecatedV8String(const String& string)
+    {
+        return v8String(string, v8::Isolate::GetCurrent());
+    }
+
     inline v8::Handle<v8::Value> v8StringOrNull(const String& string, v8::Isolate* isolate)
     {
         ASSERT(isolate);

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -245,7 +245,7 @@
         if (m_frame->document()) {
             ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPolicy();
             context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurityPolicy::SuppressReport));
-            context->SetErrorMessageForCodeGenerationFromStrings(v8String(csp->evalDisabledErrorMessage()));
+            context->SetErrorMessageForCodeGenerationFromStrings(deprecatedV8String(csp->evalDisabledErrorMessage()));
         }
     } else {
         // Using the default security token means that the canAccess is always
@@ -452,7 +452,7 @@
 
     ASSERT(!m_document.isEmpty());
     checkDocumentWrapper(m_document.get(), document);
-    m_document->SetAccessor(v8String(name), getter);
+    m_document->SetAccessor(deprecatedV8String(name), getter);
 }
 
 void V8DOMWindowShell::namedItemRemoved(HTMLDocument* document, const AtomicString& name)
@@ -470,7 +470,7 @@
 
     ASSERT(!m_document.isEmpty());
     checkDocumentWrapper(m_document.get(), document);
-    m_document->Delete(v8String(name));
+    m_document->Delete(deprecatedV8String(name));
 }
 
 void V8DOMWindowShell::updateSecurityOrigin()

Modified: trunk/Source/WebCore/bindings/v8/V8LazyEventListener.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/V8LazyEventListener.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/V8LazyEventListener.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -155,7 +155,7 @@
             "};"
         "}}}})";
 
-    v8::Handle<v8::String> codeExternalString = v8String(code);
+    v8::Handle<v8::String> codeExternalString = deprecatedV8String(code);
 
     v8::Handle<v8::Script> script = ScriptSourceCode::compileScript(codeExternalString, m_sourceURL, m_position);
     if (script.IsEmpty())
@@ -220,11 +220,11 @@
         toStringFunction = toStringTemplate->GetFunction();
     if (!toStringFunction.IsEmpty()) {
         String toStringString = "function " + m_functionName + "(" + m_eventParameterName + ") {\n  " + m_code + "\n}";
-        wrappedFunction->SetHiddenValue(V8HiddenPropertyName::toStringString(), v8String(toStringString));
+        wrappedFunction->SetHiddenValue(V8HiddenPropertyName::toStringString(), deprecatedV8String(toStringString));
         wrappedFunction->Set(v8::String::NewSymbol("toString"), toStringFunction);
     }
 
-    wrappedFunction->SetName(v8String(m_functionName));
+    wrappedFunction->SetName(deprecatedV8String(m_functionName));
 
     // FIXME: Remove the following comment-outs.
     // See https://bugs.webkit.org/show_bug.cgi?id=85152 for more details.

Modified: trunk/Source/WebCore/bindings/v8/V8WindowErrorHandler.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/V8WindowErrorHandler.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/V8WindowErrorHandler.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -55,7 +55,7 @@
     if (!listener.IsEmpty() && listener->IsFunction()) {
         v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
         v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
-        v8::Handle<v8::Value> parameters[3] = { v8String(errorEvent->message()), v8String(errorEvent->filename()), deprecatedV8Integer(errorEvent->lineno()) };
+        v8::Handle<v8::Value> parameters[3] = { v8String(errorEvent->message()), deprecatedV8String(errorEvent->filename()), deprecatedV8Integer(errorEvent->lineno()) };
         v8::TryCatch tryCatch;
         tryCatch.SetVerbose(true);
         returnValue = ScriptController::callFunctionWithInstrumentation(0, callFunction, thisValue, 3, parameters);

Modified: trunk/Source/WebCore/bindings/v8/V8WorkerContextErrorHandler.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/V8WorkerContextErrorHandler.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/V8WorkerContextErrorHandler.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -55,7 +55,7 @@
         ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
         v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
         v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
-        v8::Handle<v8::Value> parameters[3] = { v8String(errorEvent->message()), v8String(errorEvent->filename()), deprecatedV8Integer(errorEvent->lineno()) };
+        v8::Handle<v8::Value> parameters[3] = { v8String(errorEvent->message()), deprecatedV8String(errorEvent->filename()), deprecatedV8Integer(errorEvent->lineno()) };
         V8RecursionScope recursionScope(context);
         returnValue = callFunction->Call(thisValue, 3, parameters);
     }

Modified: trunk/Source/WebCore/bindings/v8/WorkerScriptController.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/WorkerScriptController.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/WorkerScriptController.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -147,7 +147,7 @@
 
     if (!m_disableEvalPending.isEmpty()) {
         m_context->AllowCodeGenerationFromStrings(false);
-        m_context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_disableEvalPending));
+        m_context->SetErrorMessageForCodeGenerationFromStrings(deprecatedV8String(m_disableEvalPending));
         m_disableEvalPending = String();
     }
 
@@ -155,7 +155,7 @@
 
     v8::TryCatch block;
 
-    v8::Handle<v8::String> scriptString = v8String(script);
+    v8::Handle<v8::String> scriptString = deprecatedV8String(script);
     v8::Handle<v8::Script> compiledScript = ScriptSourceCode::compileScript(scriptString, fileName, scriptStartPosition);
     v8::Local<v8::Value> result = ScriptRunner::runCompiledScript(compiledScript, m_workerContext);
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -41,12 +41,13 @@
     return prototype->GetHiddenValue(key);
 }
 
-v8::Handle<v8::Value> installHiddenCopyMethod(v8::Handle<v8::Object> prototype) {
+v8::Handle<v8::Value> installHiddenCopyMethod(v8::Handle<v8::Object> prototype, v8::Isolate* isolate)
+{
     v8::TryCatch tryCatch;
     tryCatch.SetVerbose(true);
     String source(reinterpret_cast<const char*>(V8ArrayBufferViewCustomScript_js),
                   sizeof(V8ArrayBufferViewCustomScript_js));
-    v8::Handle<v8::Script> script = v8::Script::Compile(v8String(source));
+    v8::Handle<v8::Script> script = v8::Script::Compile(v8String(source, isolate));
     v8::Handle<v8::Value> value = script->Run();
     v8::Handle<v8::String> key = v8::String::NewSymbol(hiddenCopyMethodName);
     prototype->SetHiddenValue(key, value);
@@ -61,7 +62,7 @@
     v8::Handle<v8::Object> prototype = prototype_value.As<v8::Object>();
     v8::Handle<v8::Value> value = getHiddenCopyMethod(prototype);
     if (value.IsEmpty())
-        value = installHiddenCopyMethod(prototype);
+        value = installHiddenCopyMethod(prototype, isolate);
     if (value.IsEmpty() || !value->IsFunction())
         return false;
     v8::Handle<v8::Function> copy_method = value.As<v8::Function>();

Modified: trunk/Source/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -77,7 +77,7 @@
     tryCatch.SetVerbose(true); // Print exceptions to console.
 
     const int argc = 1;
-    v8::Handle<v8::Value> argv[argc] = { v8String(prefix) };
+    v8::Handle<v8::Value> argv[argc] = { deprecatedV8String(prefix) };
     v8::Handle<v8::Function> function = lookupNamespaceURIFunc.IsEmpty() ? v8::Handle<v8::Function>::Cast(m_resolver) : lookupNamespaceURIFunc;
 
     v8::Handle<v8::Value> retval = ScriptController::callFunctionWithInstrumentation(0, function, m_resolver, argc, argv);

Modified: trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -268,7 +268,7 @@
         if (!listeners->Length())
             continue;
         AtomicString eventType = listenersArray[i].eventType;
-        result->Set(v8String(eventType), listeners);
+        result->Set(v8String(eventType, args.GetIsolate()), listeners);
     }
 
     return result;

Modified: trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -95,7 +95,7 @@
     // inspector's stuff) the function is called a few lines below with InjectedScriptHost wrapper,
     // injected script id and explicit reference to the inspected global object. The function is expected
     // to create and configure InjectedScript instance that is going to be used by the inspector.
-    v8::Local<v8::Script> script = v8::Script::Compile(v8String(scriptSource));
+    v8::Local<v8::Script> script = v8::Script::Compile(deprecatedV8String(scriptSource));
     V8RecursionScope::MicrotaskSuppression recursionScope;
     v8::Local<v8::Value> v = script->Run();
     ASSERT(!v.IsEmpty());

Modified: trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -67,7 +67,7 @@
 
     case MessageEvent::DataTypeString: {
         String stringValue = event->dataAsString();
-        result = v8String(stringValue);
+        result = v8String(stringValue, info.GetIsolate());
         break;
     }
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp (136821 => 136822)


--- trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp	2012-12-06 09:03:28 UTC (rev 136821)
+++ trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp	2012-12-06 09:19:09 UTC (rev 136822)
@@ -134,7 +134,7 @@
     case WebGLGetInfo::kTypeNull:
         return v8Null(isolate);
     case WebGLGetInfo::kTypeString:
-        return v8String(info.getString());
+        return v8String(info.getString(), isolate);
     case WebGLGetInfo::kTypeUnsignedInt:
         return v8UnsignedInteger(info.getUnsignedInt(), isolate);
     case WebGLGetInfo::kTypeWebGLBuffer:
@@ -401,7 +401,7 @@
     Vector<String> value = imp->getSupportedExtensions();
     v8::Local<v8::Array> array = v8::Array::New(value.size());
     for (size_t ii = 0; ii < value.size(); ++ii)
-        array->Set(v8Integer(ii, args.GetIsolate()), v8String(value[ii]));
+        array->Set(v8Integer(ii, args.GetIsolate()), v8String(value[ii], args.GetIsolate()));
     return array;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to