| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 Google Inc. All rights reserved. | 2 * Copyright (c) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 class ExecutionContext; | 49 class ExecutionContext; |
| 50 | 50 |
| 51 static ScriptCallFrame toScriptCallFrame(v8::Handle<v8::StackFrame> frame) | 51 static ScriptCallFrame toScriptCallFrame(v8::Handle<v8::StackFrame> frame) |
| 52 { | 52 { |
| 53 StringBuilder stringBuilder; | 53 StringBuilder stringBuilder; |
| 54 stringBuilder.appendNumber(frame->GetScriptId()); | 54 stringBuilder.appendNumber(frame->GetScriptId()); |
| 55 String scriptId = stringBuilder.toString(); | 55 String scriptId = stringBuilder.toString(); |
| 56 String sourceName; | 56 String sourceName; |
| 57 v8::Local<v8::String> sourceNameValue(frame->GetScriptNameOrSourceURL()); | 57 v8::Local<v8::String> sourceNameValue(frame->GetScriptNameOrSourceURL()); |
| 58 if (!sourceNameValue.IsEmpty()) | 58 if (!sourceNameValue.IsEmpty()) |
| 59 sourceName = toWebCoreString(sourceNameValue); | 59 sourceName = toCoreString(sourceNameValue); |
| 60 | 60 |
| 61 String functionName; | 61 String functionName; |
| 62 v8::Local<v8::String> functionNameValue(frame->GetFunctionName()); | 62 v8::Local<v8::String> functionNameValue(frame->GetFunctionName()); |
| 63 if (!functionNameValue.IsEmpty()) | 63 if (!functionNameValue.IsEmpty()) |
| 64 functionName = toWebCoreString(functionNameValue); | 64 functionName = toCoreString(functionNameValue); |
| 65 | 65 |
| 66 int sourceLineNumber = frame->GetLineNumber(); | 66 int sourceLineNumber = frame->GetLineNumber(); |
| 67 int sourceColumn = frame->GetColumn(); | 67 int sourceColumn = frame->GetColumn(); |
| 68 return ScriptCallFrame(functionName, scriptId, sourceName, sourceLineNumber,
sourceColumn); | 68 return ScriptCallFrame(functionName, scriptId, sourceName, sourceLineNumber,
sourceColumn); |
| 69 } | 69 } |
| 70 | 70 |
| 71 static void toScriptCallFramesVector(v8::Handle<v8::StackTrace> stackTrace, Vect
or<ScriptCallFrame>& scriptCallFrames, size_t maxStackSize, bool emptyStackIsAll
owed, v8::Isolate* isolate) | 71 static void toScriptCallFramesVector(v8::Handle<v8::StackTrace> stackTrace, Vect
or<ScriptCallFrame>& scriptCallFrames, size_t maxStackSize, bool emptyStackIsAll
owed, v8::Isolate* isolate) |
| 72 { | 72 { |
| 73 ASSERT(isolate->InContext()); | 73 ASSERT(isolate->InContext()); |
| 74 int frameCount = stackTrace->GetFrameCount(); | 74 int frameCount = stackTrace->GetFrameCount(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 ScriptState* state = ScriptState::forContext(context); | 129 ScriptState* state = ScriptState::forContext(context); |
| 130 | 130 |
| 131 Vector<ScriptValue> arguments; | 131 Vector<ScriptValue> arguments; |
| 132 for (int i = skipArgumentCount; i < v8arguments.Length(); ++i) | 132 for (int i = skipArgumentCount; i < v8arguments.Length(); ++i) |
| 133 arguments.append(ScriptValue(v8arguments[i], isolate)); | 133 arguments.append(ScriptValue(v8arguments[i], isolate)); |
| 134 | 134 |
| 135 return ScriptArguments::create(state, arguments); | 135 return ScriptArguments::create(state, arguments); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace WebCore | 138 } // namespace WebCore |
| OLD | NEW |