OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/inspector/InspectorTraceEvents.h" | 6 #include "core/inspector/InspectorTraceEvents.h" |
7 | 7 |
8 #include "bindings/v8/ScriptCallStackFactory.h" | 8 #include "bindings/v8/ScriptCallStackFactory.h" |
9 #include "bindings/v8/ScriptGCEvent.h" | 9 #include "bindings/v8/ScriptGCEvent.h" |
10 #include "bindings/v8/ScriptSourceCode.h" | 10 #include "bindings/v8/ScriptSourceCode.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "platform/weborigin/KURL.h" | 25 #include "platform/weborigin/KURL.h" |
26 #include "wtf/Vector.h" | 26 #include "wtf/Vector.h" |
27 #include <inttypes.h> | 27 #include <inttypes.h> |
28 | 28 |
29 namespace WebCore { | 29 namespace WebCore { |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 class JSCallStack : public TraceEvent::ConvertableToTraceFormat { | 33 class JSCallStack : public TraceEvent::ConvertableToTraceFormat { |
34 public: | 34 public: |
35 explicit JSCallStack(PassRefPtr<ScriptCallStack> callstack) : m_callstack(ca
llstack) { } | 35 explicit JSCallStack(PassRefPtrWillBeRawPtr<ScriptCallStack> callstack) : m_
callstack(callstack) { } |
36 virtual String asTraceFormat() const | 36 virtual String asTraceFormat() const |
37 { | 37 { |
38 if (!m_callstack) | 38 if (!m_callstack) |
39 return "null"; | 39 return "null"; |
40 return m_callstack->buildInspectorArray()->toJSONString(); | 40 return m_callstack->buildInspectorArray()->toJSONString(); |
41 } | 41 } |
42 | 42 |
43 private: | 43 private: |
44 RefPtr<ScriptCallStack> m_callstack; | 44 RefPtrWillBePersistent<ScriptCallStack> m_callstack; |
45 }; | 45 }; |
46 | 46 |
47 String toHexString(void* p) | 47 String toHexString(void* p) |
48 { | 48 { |
49 return String::format("0x%" PRIx64, static_cast<uint64>(reinterpret_cast<int
ptr_t>(p))); | 49 return String::format("0x%" PRIx64, static_cast<uint64>(reinterpret_cast<int
ptr_t>(p))); |
50 } | 50 } |
51 | 51 |
52 } | 52 } |
53 | 53 |
54 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorLayoutEvent::beginData
(FrameView* frameView) | 54 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorLayoutEvent::beginData
(FrameView* frameView) |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 data->setNumber("jsHeapSizeUsed", static_cast<double>(usedHeapSize())); | 325 data->setNumber("jsHeapSizeUsed", static_cast<double>(usedHeapSize())); |
326 return TracedValue::fromJSONValue(data); | 326 return TracedValue::fromJSONValue(data); |
327 } | 327 } |
328 | 328 |
329 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorCallStackEvent::curren
tCallStack() | 329 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorCallStackEvent::curren
tCallStack() |
330 { | 330 { |
331 return adoptRef(new JSCallStack(createScriptCallStack(ScriptCallStack::maxCa
llStackSizeToCapture, true))); | 331 return adoptRef(new JSCallStack(createScriptCallStack(ScriptCallStack::maxCa
llStackSizeToCapture, true))); |
332 } | 332 } |
333 | 333 |
334 } | 334 } |
OLD | NEW |