Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: Source/core/inspector/InspectorTraceEvents.cpp

Issue 327793002: Timeline: return 'null' from JSCallStack::asTraceFormat() when stack is absent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: also fix front-end Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TracingTimelineModel.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 18 matching lines...) Expand all
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(PassRefPtr<ScriptCallStack> callstack) : m_callstack(ca llstack) { }
36 virtual String asTraceFormat() const 36 virtual String asTraceFormat() const
37 { 37 {
38 if (!m_callstack) 38 if (!m_callstack)
39 return "[]"; 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 RefPtr<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)));
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TracingTimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698