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

Side by Side Diff: src/inspector/v8-stack-trace-impl.cc

Issue 2332163002: [inspector] fixed all shorten-64-to-32 warnings (Closed)
Patch Set: rebased Created 4 years, 3 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
« no previous file with comments | « src/inspector/v8-runtime-agent-impl.cc ('k') | src/inspector/v8-value-copier.cc » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project 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 "src/inspector/v8-stack-trace-impl.h" 5 #include "src/inspector/v8-stack-trace-impl.h"
6 6
7 #include "src/inspector/string-util.h" 7 #include "src/inspector/string-util.h"
8 #include "src/inspector/v8-debugger.h" 8 #include "src/inspector/v8-debugger.h"
9 #include "src/inspector/v8-inspector-impl.h" 9 #include "src/inspector/v8-inspector-impl.h"
10 #include "src/inspector/v8-profiler-agent-impl.h" 10 #include "src/inspector/v8-profiler-agent-impl.h"
(...skipping 28 matching lines...) Expand all
39 int sourceColumn = frame->GetColumn(); 39 int sourceColumn = frame->GetColumn();
40 return V8StackTraceImpl::Frame(functionName, scriptId, sourceName, 40 return V8StackTraceImpl::Frame(functionName, scriptId, sourceName,
41 sourceLineNumber, sourceColumn); 41 sourceLineNumber, sourceColumn);
42 } 42 }
43 43
44 void toFramesVector(v8::Local<v8::StackTrace> stackTrace, 44 void toFramesVector(v8::Local<v8::StackTrace> stackTrace,
45 std::vector<V8StackTraceImpl::Frame>& frames, 45 std::vector<V8StackTraceImpl::Frame>& frames,
46 size_t maxStackSize, v8::Isolate* isolate) { 46 size_t maxStackSize, v8::Isolate* isolate) {
47 DCHECK(isolate->InContext()); 47 DCHECK(isolate->InContext());
48 int frameCount = stackTrace->GetFrameCount(); 48 int frameCount = stackTrace->GetFrameCount();
49 if (frameCount > static_cast<int>(maxStackSize)) frameCount = maxStackSize; 49 if (frameCount > static_cast<int>(maxStackSize))
50 frameCount = static_cast<int>(maxStackSize);
50 for (int i = 0; i < frameCount; i++) { 51 for (int i = 0; i < frameCount; i++) {
51 v8::Local<v8::StackFrame> stackFrame = stackTrace->GetFrame(i); 52 v8::Local<v8::StackFrame> stackFrame = stackTrace->GetFrame(i);
52 frames.push_back(toFrame(stackFrame)); 53 frames.push_back(toFrame(stackFrame));
53 } 54 }
54 } 55 }
55 56
56 } // namespace 57 } // namespace
57 58
58 V8StackTraceImpl::Frame::Frame() 59 V8StackTraceImpl::Frame::Frame()
59 : m_functionName("undefined"), 60 : m_functionName("undefined"),
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 159 v8::Isolate* isolate = v8::Isolate::GetCurrent();
159 v8::HandleScope handleScope(isolate); 160 v8::HandleScope handleScope(isolate);
160 v8::Local<v8::StackTrace> stackTrace; 161 v8::Local<v8::StackTrace> stackTrace;
161 if (isolate->InContext()) { 162 if (isolate->InContext()) {
162 if (debugger) { 163 if (debugger) {
163 V8InspectorImpl* inspector = debugger->inspector(); 164 V8InspectorImpl* inspector = debugger->inspector();
164 V8ProfilerAgentImpl* profilerAgent = 165 V8ProfilerAgentImpl* profilerAgent =
165 inspector->enabledProfilerAgentForGroup(contextGroupId); 166 inspector->enabledProfilerAgentForGroup(contextGroupId);
166 if (profilerAgent) profilerAgent->collectSample(); 167 if (profilerAgent) profilerAgent->collectSample();
167 } 168 }
168 stackTrace = v8::StackTrace::CurrentStackTrace(isolate, maxStackSize, 169 stackTrace = v8::StackTrace::CurrentStackTrace(
169 stackTraceOptions); 170 isolate, static_cast<int>(maxStackSize), stackTraceOptions);
170 } 171 }
171 return V8StackTraceImpl::create(debugger, contextGroupId, stackTrace, 172 return V8StackTraceImpl::create(debugger, contextGroupId, stackTrace,
172 maxStackSize, description); 173 maxStackSize, description);
173 } 174 }
174 175
175 std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::cloneImpl() { 176 std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::cloneImpl() {
176 std::vector<Frame> framesCopy(m_frames); 177 std::vector<Frame> framesCopy(m_frames);
177 return wrapUnique( 178 return wrapUnique(
178 new V8StackTraceImpl(m_contextGroupId, m_description, framesCopy, 179 new V8StackTraceImpl(m_contextGroupId, m_description, framesCopy,
179 m_parent ? m_parent->cloneImpl() : nullptr)); 180 m_parent ? m_parent->cloneImpl() : nullptr));
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 stackTrace.append(String16::fromInteger(frame.lineNumber())); 271 stackTrace.append(String16::fromInteger(frame.lineNumber()));
271 stackTrace.append(':'); 272 stackTrace.append(':');
272 stackTrace.append(String16::fromInteger(frame.columnNumber())); 273 stackTrace.append(String16::fromInteger(frame.columnNumber()));
273 stackTrace.append(')'); 274 stackTrace.append(')');
274 } 275 }
275 String16 string = stackTrace.toString(); 276 String16 string = stackTrace.toString();
276 return StringBufferImpl::adopt(string); 277 return StringBufferImpl::adopt(string);
277 } 278 }
278 279
279 } // namespace v8_inspector 280 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/inspector/v8-runtime-agent-impl.cc ('k') | src/inspector/v8-value-copier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698