Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / v8 / ScriptCallStackFactory.cpp
index 81dea45..f1f9ded 100644 (file)
 #include "config.h"
 #include "bindings/v8/ScriptCallStackFactory.h"
 
-#include "bindings/v8/ScriptScope.h"
 #include "bindings/v8/ScriptValue.h"
 #include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8Utilities.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/inspector/ScriptArguments.h"
 #include "core/inspector/ScriptCallFrame.h"
@@ -104,7 +102,7 @@ PassRefPtr<ScriptCallStack> createScriptCallStack(size_t maxStackSize, bool empt
 {
     v8::Isolate* isolate = v8::Isolate::GetCurrent();
     if (!isolate->InContext())
-        return 0;
+        return nullptr;
     v8::HandleScope handleScope(isolate);
     v8::Handle<v8::StackTrace> stackTrace(v8::StackTrace::CurrentStackTrace(isolate, maxStackSize, stackTraceOptions));
     return createScriptCallStack(stackTrace, maxStackSize, emptyStackIsAllowed, isolate);
@@ -114,7 +112,7 @@ PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(size_t maxStackSize)
 {
     size_t stackSize = 1;
     if (InspectorInstrumentation::hasFrontends()) {
-        ExecutionContext* executionContext = getExecutionContext();
+        ExecutionContext* executionContext = currentExecutionContext(v8::Isolate::GetCurrent());
         if (InspectorInstrumentation::consoleAgentEnabled(executionContext))
             stackSize = maxStackSize;
     }
@@ -125,14 +123,13 @@ PassRefPtr<ScriptArguments> createScriptArguments(const v8::FunctionCallbackInfo
 {
     v8::Isolate* isolate = v8arguments.GetIsolate();
     v8::HandleScope scope(isolate);
-    v8::Local<v8::Context> context = isolate->GetCurrentContext();
-    ScriptState* state = ScriptState::forContext(context);
+    ScriptState* scriptState = ScriptState::current(isolate);
 
     Vector<ScriptValue> arguments;
     for (int i = skipArgumentCount; i < v8arguments.Length(); ++i)
-        arguments.append(ScriptValue(v8arguments[i], isolate));
+        arguments.append(ScriptValue(scriptState, v8arguments[i]));
 
-    return ScriptArguments::create(state, arguments);
+    return ScriptArguments::create(scriptState, arguments);
 }
 
 } // namespace WebCore