| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 PassRefPtr<ScriptCallStack> ScriptCallStack::capture(size_t maxStackSize) | 51 PassRefPtr<ScriptCallStack> ScriptCallStack::capture(size_t maxStackSize) |
| 52 { | 52 { |
| 53 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 53 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 54 if (!isolate->InContext()) | 54 if (!isolate->InContext()) |
| 55 return nullptr; | 55 return nullptr; |
| 56 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 56 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 57 if (!data->threadDebugger()) | 57 if (!data->threadDebugger()) |
| 58 return nullptr; | 58 return nullptr; |
| 59 ScriptForbiddenScope::AllowUserAgentScript allowScripting; | 59 ScriptForbiddenScope::AllowUserAgentScript allowScripting; |
| 60 OwnPtr<V8StackTrace> stack = data->threadDebugger()->debugger()->captureStac
kTrace(maxStackSize); | 60 OwnPtr<V8StackTrace> stack = data->threadDebugger()->debugger()->captureStac
kTrace(maxStackSize); |
| 61 return stack ? adoptRef(new ScriptCallStack(stack.release())) : nullptr; | 61 return stack ? adoptRef(new ScriptCallStack(std::move(stack))) : nullptr; |
| 62 } | 62 } |
| 63 | 63 |
| 64 PassRefPtr<ScriptCallStack> ScriptCallStack::captureForConsole() | 64 PassRefPtr<ScriptCallStack> ScriptCallStack::captureForConsole() |
| 65 { | 65 { |
| 66 size_t stackSize = 1; | 66 size_t stackSize = 1; |
| 67 if (InspectorInstrumentation::hasFrontends()) { | 67 if (InspectorInstrumentation::hasFrontends()) { |
| 68 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 68 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 69 if (!isolate->InContext()) | 69 if (!isolate->InContext()) |
| 70 return nullptr; | 70 return nullptr; |
| 71 if (InspectorInstrumentation::consoleAgentEnabled(currentExecutionContex
t(isolate))) | 71 if (InspectorInstrumentation::consoleAgentEnabled(currentExecutionContex
t(isolate))) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 value->endDictionary(); | 122 value->endDictionary(); |
| 123 value->endArray(); | 123 value->endArray(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 String ScriptCallStack::toString() const | 126 String ScriptCallStack::toString() const |
| 127 { | 127 { |
| 128 return m_stackTrace->toString(); | 128 return m_stackTrace->toString(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace blink | 131 } // namespace blink |
| OLD | NEW |