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

Side by Side Diff: src/inspector/v8-profiler-agent-impl.cc

Issue 2741653003: [inspector] do not translate offset to line/column for coverage. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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-profiler-agent-impl.h" 5 #include "src/inspector/v8-profiler-agent-impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "src/base/atomicops.h" 9 #include "src/base/atomicops.h"
10 #include "src/inspector/protocol/Protocol.h" 10 #include "src/inspector/protocol/Protocol.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 std::unique_ptr<protocol::Array<protocol::Profiler::FunctionCoverage>> 300 std::unique_ptr<protocol::Array<protocol::Profiler::FunctionCoverage>>
301 functions = 301 functions =
302 protocol::Array<protocol::Profiler::FunctionCoverage>::create(); 302 protocol::Array<protocol::Profiler::FunctionCoverage>::create();
303 for (size_t j = 0; j < script_data.FunctionCount(); j++) { 303 for (size_t j = 0; j < script_data.FunctionCount(); j++) {
304 v8::debug::Coverage::FunctionData function_data = 304 v8::debug::Coverage::FunctionData function_data =
305 script_data.GetFunctionData(j); 305 script_data.GetFunctionData(j);
306 std::unique_ptr<protocol::Array<protocol::Profiler::CoverageRange>> 306 std::unique_ptr<protocol::Array<protocol::Profiler::CoverageRange>>
307 ranges = protocol::Array<protocol::Profiler::CoverageRange>::create(); 307 ranges = protocol::Array<protocol::Profiler::CoverageRange>::create();
308 // At this point we only have per-function coverage data, so there is 308 // At this point we only have per-function coverage data, so there is
309 // only one range per function. 309 // only one range per function.
310 v8::debug::Location start =
311 script->GetSourceLocation(function_data.StartOffset());
312 v8::debug::Location end =
313 script->GetSourceLocation(function_data.EndOffset());
314 ranges->addItem(protocol::Profiler::CoverageRange::create() 310 ranges->addItem(protocol::Profiler::CoverageRange::create()
315 .setStartLineNumber(start.GetLineNumber())
316 .setStartColumnNumber(start.GetColumnNumber())
317 .setEndLineNumber(end.GetLineNumber())
318 .setEndColumnNumber(end.GetColumnNumber())
319 .setStartOffset(function_data.StartOffset()) 311 .setStartOffset(function_data.StartOffset())
320 .setEndOffset(function_data.EndOffset()) 312 .setEndOffset(function_data.EndOffset())
321 .setCount(function_data.Count()) 313 .setCount(function_data.Count())
322 .build()); 314 .build());
323 functions->addItem( 315 functions->addItem(
324 protocol::Profiler::FunctionCoverage::create() 316 protocol::Profiler::FunctionCoverage::create()
325 .setFunctionName(toProtocolString( 317 .setFunctionName(toProtocolString(
326 function_data.Name().FromMaybe(v8::Local<v8::String>()))) 318 function_data.Name().FromMaybe(v8::Local<v8::String>())))
327 .setRanges(std::move(ranges)) 319 .setRanges(std::move(ranges))
328 .build()); 320 .build());
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 return m_profiler; 394 return m_profiler;
403 } 395 }
404 396
405 bool V8ProfilerAgentImpl::idleFinished() { 397 bool V8ProfilerAgentImpl::idleFinished() {
406 m_idle = false; 398 m_idle = false;
407 if (m_profiler) m_profiler->SetIdle(m_idle); 399 if (m_profiler) m_profiler->SetIdle(m_idle);
408 return m_profiler; 400 return m_profiler;
409 } 401 }
410 402
411 } // namespace v8_inspector 403 } // namespace v8_inspector
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698