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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 PassRefPtr<ScriptCallStack> createScriptCallStack(v8::Handle<v8::StackTrace> sta
ckTrace, size_t maxStackSize, v8::Isolate* isolate) | 98 PassRefPtr<ScriptCallStack> createScriptCallStack(v8::Handle<v8::StackTrace> sta
ckTrace, size_t maxStackSize, v8::Isolate* isolate) |
99 { | 99 { |
100 return createScriptCallStack(stackTrace, maxStackSize, true, isolate); | 100 return createScriptCallStack(stackTrace, maxStackSize, true, isolate); |
101 } | 101 } |
102 | 102 |
103 PassRefPtr<ScriptCallStack> createScriptCallStack(size_t maxStackSize, bool empt
yStackIsAllowed) | 103 PassRefPtr<ScriptCallStack> createScriptCallStack(size_t maxStackSize, bool empt
yStackIsAllowed) |
104 { | 104 { |
105 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 105 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
106 if (!isolate->InContext()) | 106 if (!isolate->InContext()) |
107 return 0; | 107 return nullptr; |
108 v8::HandleScope handleScope(isolate); | 108 v8::HandleScope handleScope(isolate); |
109 v8::Handle<v8::StackTrace> stackTrace(v8::StackTrace::CurrentStackTrace(isol
ate, maxStackSize, stackTraceOptions)); | 109 v8::Handle<v8::StackTrace> stackTrace(v8::StackTrace::CurrentStackTrace(isol
ate, maxStackSize, stackTraceOptions)); |
110 return createScriptCallStack(stackTrace, maxStackSize, emptyStackIsAllowed,
isolate); | 110 return createScriptCallStack(stackTrace, maxStackSize, emptyStackIsAllowed,
isolate); |
111 } | 111 } |
112 | 112 |
113 PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(size_t maxStackSize) | 113 PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(size_t maxStackSize) |
114 { | 114 { |
115 size_t stackSize = 1; | 115 size_t stackSize = 1; |
116 if (InspectorInstrumentation::hasFrontends()) { | 116 if (InspectorInstrumentation::hasFrontends()) { |
117 ExecutionContext* executionContext = currentExecutionContext(v8::Isolate
::GetCurrent()); | 117 ExecutionContext* executionContext = currentExecutionContext(v8::Isolate
::GetCurrent()); |
(...skipping 11 matching lines...) Expand all 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 |