Title: [141120] branches/chromium/1397/Source/WebCore/bindings/v8
Revision
141120
Author
[email protected]
Date
2013-01-29 08:55:34 -0800 (Tue, 29 Jan 2013)

Log Message

Revert 140611
> [V8] Reduce usage of deprecatedV8String() and deprecatedV8Integer()
> https://bugs.webkit.org/show_bug.cgi?id=107674
> 
> Reviewed by Adam Barth.
> 
> No tests. No change in behavior.
> 
> * bindings/v8/_javascript_CallFrame.cpp:
> (WebCore::_javascript_CallFrame::evaluate):
> * bindings/v8/NPV8Object.cpp:
> (_NPN_Enumerate):
> * bindings/v8/PageScriptDebugServer.cpp:
> (WebCore::PageScriptDebugServer::addListener):
> * bindings/v8/ScriptController.cpp:
> (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):
> * bindings/v8/V8DOMWindowShell.cpp:
> (WebCore::V8DOMWindowShell::initializeIfNeeded):
> (WebCore::V8DOMWindowShell::namedItemAdded):
> (WebCore::V8DOMWindowShell::namedItemRemoved):
> * bindings/v8/V8LazyEventListener.cpp:
> (WebCore::V8LazyEventListener::prepareListenerObject):
> * bindings/v8/V8MutationCallback.cpp:
> (WebCore::V8MutationCallback::handleEvent):
> * bindings/v8/WorkerScriptController.cpp:
> (WebCore::WorkerScriptController::evaluate):
> * bindings/v8/WorkerScriptDebugServer.cpp:
> (WebCore::WorkerScriptDebugServer::addListener):
> * bindings/v8/custom/V8InjectedScriptManager.cpp:
> (WebCore::InjectedScriptManager::createInjectedScript):
> 

[email protected]
Review URL: https://codereview.chromium.org/12087054

Modified Paths

Diff

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/_javascript_CallFrame.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/_javascript_CallFrame.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/_javascript_CallFrame.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -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_, m_debuggerContext->GetIsolate()) };
+    v8::Handle<v8::Value> argv[] = { deprecatedV8String(_expression_) };
     return evalFunction->Call(m_callFrame.get(), 1, argv);
 }
 

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/NPV8Object.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/NPV8Object.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/NPV8Object.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -536,7 +536,7 @@
         *count = props->Length();
         *identifier = static_cast<NPIdentifier*>(malloc(sizeof(NPIdentifier*) * *count));
         for (uint32_t i = 0; i < *count; ++i) {
-            v8::Local<v8::Value> name = props->Get(v8Integer(i, context->GetIsolate()));
+            v8::Local<v8::Value> name = props->Get(deprecatedV8Integer(i));
             (*identifier)[i] = getStringIdentifier(v8::Local<v8::String>::Cast(name));
         }
         return true;

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -108,7 +108,7 @@
     ASSERT(!value->IsUndefined() && value->IsArray());
     v8::Handle<v8::Array> scriptsArray = v8::Handle<v8::Array>::Cast(value);
     for (unsigned i = 0; i < scriptsArray->Length(); ++i)
-        dispatchDidParseSource(listener, v8::Handle<v8::Object>::Cast(scriptsArray->Get(v8Integer(i, context->GetIsolate()))));
+        dispatchDidParseSource(listener, v8::Handle<v8::Object>::Cast(scriptsArray->Get(deprecatedV8Integer(i))));
 }
 
 void PageScriptDebugServer::removeListener(ScriptDebugListener* listener, Page* page)

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/ScriptController.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/ScriptController.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/ScriptController.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -492,7 +492,7 @@
 
     // Attach to the global object.
     v8::Handle<v8::Object> global = v8Context->Global();
-    global->Set(v8String(key, v8Context->GetIsolate()), value);
+    global->Set(deprecatedV8String(key), value);
 }
 
 bool ScriptController::haveInterpreter() const
@@ -515,7 +515,7 @@
     v8::HandleScope handleScope;
     v8::Handle<v8::Context> v8Context = m_windowShell->context();
     v8Context->AllowCodeGenerationFromStrings(false);
-    v8Context->SetErrorMessageForCodeGenerationFromStrings(v8String(errorMessage, v8Context->GetIsolate()));
+    v8Context->SetErrorMessageForCodeGenerationFromStrings(deprecatedV8String(errorMessage));
 }
 
 PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widget)

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/ScriptDebugServer.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/ScriptDebugServer.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/ScriptDebugServer.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -172,10 +172,10 @@
     v8::Context::Scope contextScope(debuggerContext);
 
     v8::Local<v8::Object> args = v8::Object::New();
-    args->Set(v8::String::NewSymbol("sourceID"), v8String(sourceID, debuggerContext->GetIsolate()));
-    args->Set(v8::String::NewSymbol("lineNumber"), v8Integer(scriptBreakpoint.lineNumber, debuggerContext->GetIsolate()));
-    args->Set(v8::String::NewSymbol("columnNumber"), v8Integer(scriptBreakpoint.columnNumber, debuggerContext->GetIsolate()));
-    args->Set(v8::String::NewSymbol("condition"), v8String(scriptBreakpoint.condition, debuggerContext->GetIsolate()));
+    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"), 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);
@@ -193,7 +193,7 @@
     v8::Context::Scope contextScope(debuggerContext);
 
     v8::Local<v8::Object> args = v8::Object::New();
-    args->Set(v8::String::NewSymbol("breakpointId"), v8String(breakpointId, debuggerContext->GetIsolate()));
+    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);
@@ -328,11 +328,10 @@
     v8::HandleScope scope;
 
     OwnPtr<v8::Context::Scope> contextScope;
-    v8::Handle<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
     if (!isPaused())
-        contextScope = adoptPtr(new v8::Context::Scope(debuggerContext));
+        contextScope = adoptPtr(new v8::Context::Scope(v8::Debug::GetDebugContext()));
 
-    v8::Handle<v8::Value> argv[] = { v8String(sourceID, debuggerContext->GetIsolate()), v8String(newContent, debuggerContext->GetIsolate()), v8Boolean(preview) };
+    v8::Handle<v8::Value> argv[] = { deprecatedV8String(sourceID), deprecatedV8String(newContent), v8Boolean(preview) };
 
     v8::Local<v8::Value> v8result;
     {
@@ -536,7 +535,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, debuggerContext->GetIsolate()))->Run()));
+        m_debuggerScript.set(v8::Handle<v8::Object>::Cast(v8::Script::Compile(deprecatedV8String(debuggerScriptSource))->Run()));
     }
 }
 
@@ -571,10 +570,10 @@
         return;
     v8::Context::Scope contextScope(context);
 
-    v8::Handle<v8::String> code = v8String(_expression_, context->GetIsolate());
+    v8::Handle<v8::String> code = deprecatedV8String(_expression_);
     v8::TryCatch tryCatch;
 
-    v8::ScriptOrigin origin(v8String(sourceURL, context->GetIsolate()), v8Integer(0, context->GetIsolate()), v8Integer(0, context->GetIsolate()));
+    v8::ScriptOrigin origin(deprecatedV8String(sourceURL), deprecatedV8Integer(0), deprecatedV8Integer(0));
     v8::Handle<v8::Script> script = v8::Script::New(code, &origin);
 
     if (tryCatch.HasCaught()) {

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -62,13 +62,13 @@
 void ScriptCallArgumentHandler::appendArgument(const String& argument)
 {
     ScriptScope scope(m_scriptState);
-    m_arguments.append(v8String(argument, m_scriptState->isolate()));
+    m_arguments.append(deprecatedV8String(argument));
 }
 
 void ScriptCallArgumentHandler::appendArgument(const char* argument)
 {
     ScriptScope scope(m_scriptState);
-    m_arguments.append(v8String(argument, m_scriptState->isolate()));
+    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, m_scriptState->isolate()));
+    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, m_scriptState->isolate()));
+    v8::Local<v8::Value> value = thisObject->Get(deprecatedV8String(m_name));
     if (!scope.success()) {
         hadException = true;
         return ScriptObject();

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/ScriptProfiler.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/ScriptProfiler.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/ScriptProfiler.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -59,7 +59,7 @@
     profileNameIdleTimeMap->add(title, 0);
 
     v8::HandleScope hs;
-    v8::CpuProfiler::StartProfiling(v8String(title, state->isolate()));
+    v8::CpuProfiler::StartProfiling(deprecatedV8String(title));
 }
 
 void ScriptProfiler::startForPage(Page*, const String& title)
@@ -78,8 +78,8 @@
 {
     v8::HandleScope hs;
     const v8::CpuProfile* profile = "" ?
-        v8::CpuProfiler::StopProfiling(v8String(title, state->isolate()), state->context()->GetSecurityToken()) :
-        v8::CpuProfiler::StopProfiling(v8String(title, state->isolate()));
+        v8::CpuProfiler::StopProfiling(deprecatedV8String(title), state->context()->GetSecurityToken()) :
+        v8::CpuProfiler::StopProfiling(deprecatedV8String(title));
     if (!profile)
         return 0;
 

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -246,7 +246,7 @@
         if (m_frame->document()) {
             ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPolicy();
             context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurityPolicy::SuppressReport));
-            context->SetErrorMessageForCodeGenerationFromStrings(v8String(csp->evalDisabledErrorMessage(), m_isolate));
+            context->SetErrorMessageForCodeGenerationFromStrings(deprecatedV8String(csp->evalDisabledErrorMessage()));
         }
     } else {
         // Using the default security token means that the canAccess is always
@@ -453,7 +453,7 @@
 
     ASSERT(!m_document.isEmpty());
     checkDocumentWrapper(m_document.get(), document);
-    m_document->SetAccessor(v8String(name, m_isolate), getter);
+    m_document->SetAccessor(deprecatedV8String(name), getter);
 }
 
 void V8DOMWindowShell::namedItemRemoved(HTMLDocument* document, const AtomicString& name)
@@ -471,7 +471,7 @@
 
     ASSERT(!m_document.isEmpty());
     checkDocumentWrapper(m_document.get(), document);
-    m_document->Delete(v8String(name, m_isolate));
+    m_document->Delete(deprecatedV8String(name));
 }
 
 void V8DOMWindowShell::updateSecurityOrigin()

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/V8LazyEventListener.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/V8LazyEventListener.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/V8LazyEventListener.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -155,7 +155,7 @@
             "};"
         "}}}})";
 
-    v8::Handle<v8::String> codeExternalString = v8String(code, v8Context->GetIsolate());
+    v8::Handle<v8::String> codeExternalString = deprecatedV8String(code);
 
     v8::Handle<v8::Script> script = ScriptSourceCode::compileScript(codeExternalString, m_sourceURL, m_position);
     if (script.IsEmpty())
@@ -185,11 +185,11 @@
     v8::Local<v8::Object> thisObject = v8::Object::New();
     if (thisObject.IsEmpty())
         return;
-    if (!thisObject->ForceSet(v8Integer(0, v8Context->GetIsolate()), nodeWrapper))
+    if (!thisObject->ForceSet(deprecatedV8Integer(0), nodeWrapper))
         return;
-    if (!thisObject->ForceSet(v8Integer(1, v8Context->GetIsolate()), formWrapper))
+    if (!thisObject->ForceSet(deprecatedV8Integer(1), formWrapper))
         return;
-    if (!thisObject->ForceSet(v8Integer(2, v8Context->GetIsolate()), documentWrapper))
+    if (!thisObject->ForceSet(deprecatedV8Integer(2), documentWrapper))
         return;
 
     // FIXME: Remove this code when we stop doing the 'with' hack above.
@@ -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, v8Context->GetIsolate()));
+        wrappedFunction->SetHiddenValue(V8HiddenPropertyName::toStringString(), deprecatedV8String(toStringString));
         wrappedFunction->Set(v8::String::NewSymbol("toString"), toStringFunction);
     }
 
-    wrappedFunction->SetName(v8String(m_functionName, v8Context->GetIsolate()));
+    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: branches/chromium/1397/Source/WebCore/bindings/v8/V8MutationCallback.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/V8MutationCallback.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/V8MutationCallback.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -63,7 +63,7 @@
 
     v8::Local<v8::Array> mutationsArray = v8::Array::New(mutations->size());
     for (size_t i = 0; i < mutations->size(); ++i)
-        mutationsArray->Set(v8Integer(i, v8Context->GetIsolate()), toV8(mutations->at(i).get(), v8::Handle<v8::Object>(), v8Context->GetIsolate()));
+        mutationsArray->Set(deprecatedV8Integer(i), toV8(mutations->at(i).get(), v8::Handle<v8::Object>(), v8Context->GetIsolate()));
 
     v8::Handle<v8::Value> observerHandle = toV8(observer, v8::Handle<v8::Object>(), v8Context->GetIsolate());
     if (observerHandle.IsEmpty()) {

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/WorkerScriptController.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/WorkerScriptController.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/WorkerScriptController.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -147,7 +147,7 @@
 
     if (!m_disableEvalPending.isEmpty()) {
         m_context->AllowCodeGenerationFromStrings(false);
-        m_context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_disableEvalPending, m_context->GetIsolate()));
+        m_context->SetErrorMessageForCodeGenerationFromStrings(deprecatedV8String(m_disableEvalPending));
         m_disableEvalPending = String();
     }
 
@@ -155,7 +155,7 @@
 
     v8::TryCatch block;
 
-    v8::Handle<v8::String> scriptString = v8String(script, m_context->GetIsolate());
+    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: branches/chromium/1397/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -74,7 +74,7 @@
     ASSERT(!value->IsUndefined() && value->IsArray());
     v8::Handle<v8::Array> scriptsArray = v8::Handle<v8::Array>::Cast(value);
     for (unsigned i = 0; i < scriptsArray->Length(); ++i)
-        dispatchDidParseSource(listener, v8::Handle<v8::Object>::Cast(scriptsArray->Get(v8Integer(i, debuggerContext->GetIsolate()))));
+        dispatchDidParseSource(listener, v8::Handle<v8::Object>::Cast(scriptsArray->Get(deprecatedV8Integer(i))));
 }
 
 void WorkerScriptDebugServer::removeListener(ScriptDebugListener* listener)

Modified: branches/chromium/1397/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp (141119 => 141120)


--- branches/chromium/1397/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp	2013-01-29 16:55:32 UTC (rev 141119)
+++ branches/chromium/1397/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp	2013-01-29 16:55:34 UTC (rev 141120)
@@ -96,7 +96,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, inspectedContext->GetIsolate()));
+    v8::Local<v8::Script> script = v8::Script::Compile(deprecatedV8String(scriptSource));
     V8RecursionScope::MicrotaskSuppression recursionScope;
     v8::Local<v8::Value> v = script->Run();
     ASSERT(!v.IsEmpty());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to