| 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 27 matching lines...) Expand all Loading... |
| 38 #include "platform/v8_inspector/public/V8Debugger.h" | 38 #include "platform/v8_inspector/public/V8Debugger.h" |
| 39 #include "platform/v8_inspector/public/V8StackTrace.h" | 39 #include "platform/v8_inspector/public/V8StackTrace.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 PassRefPtr<ScriptCallStack> ScriptCallStack::create(v8::Isolate* isolate, v8::Lo
cal<v8::StackTrace> stackTrace, size_t maxStackSize) | 43 PassRefPtr<ScriptCallStack> ScriptCallStack::create(v8::Isolate* isolate, v8::Lo
cal<v8::StackTrace> stackTrace, size_t maxStackSize) |
| 44 { | 44 { |
| 45 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 45 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 46 if (!data->threadDebugger()) | 46 if (!data->threadDebugger()) |
| 47 return nullptr; | 47 return nullptr; |
| 48 return adoptRef(new ScriptCallStack(data->threadDebugger()->debugger()->crea
teStackTrace(stackTrace, maxStackSize))); | 48 OwnPtr<V8StackTrace> stack = data->threadDebugger()->debugger()->createStack
Trace(stackTrace, maxStackSize); |
| 49 return stack ? adoptRef(new ScriptCallStack(std::move(stack))) : nullptr; |
| 49 } | 50 } |
| 50 | 51 |
| 51 PassRefPtr<ScriptCallStack> ScriptCallStack::capture(size_t maxStackSize) | 52 PassRefPtr<ScriptCallStack> ScriptCallStack::capture(size_t maxStackSize) |
| 52 { | 53 { |
| 53 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 54 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 54 if (!isolate->InContext()) | 55 if (!isolate->InContext()) |
| 55 return nullptr; | 56 return nullptr; |
| 56 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 57 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 57 if (!data->threadDebugger()) | 58 if (!data->threadDebugger()) |
| 58 return nullptr; | 59 return nullptr; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 value->endDictionary(); | 123 value->endDictionary(); |
| 123 value->endArray(); | 124 value->endArray(); |
| 124 } | 125 } |
| 125 | 126 |
| 126 String ScriptCallStack::toString() const | 127 String ScriptCallStack::toString() const |
| 127 { | 128 { |
| 128 return m_stackTrace->toString(); | 129 return m_stackTrace->toString(); |
| 129 } | 130 } |
| 130 | 131 |
| 131 } // namespace blink | 132 } // namespace blink |
| OLD | NEW |