OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "platform/v8_inspector/V8HeapProfilerAgentImpl.h" | 5 #include "platform/v8_inspector/V8HeapProfilerAgentImpl.h" |
6 | 6 |
7 #include "platform/v8_inspector/InjectedScript.h" | 7 #include "platform/v8_inspector/InjectedScript.h" |
8 #include "platform/v8_inspector/V8DebuggerImpl.h" | 8 #include "platform/v8_inspector/V8DebuggerImpl.h" |
9 #include "platform/v8_inspector/V8InspectorSessionImpl.h" | 9 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
10 #include "platform/v8_inspector/V8StringUtil.h" | 10 #include "platform/v8_inspector/V8StringUtil.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 if (heapObject.IsEmpty()) { | 251 if (heapObject.IsEmpty()) { |
252 *error = "Object is not available"; | 252 *error = "Object is not available"; |
253 return; | 253 return; |
254 } | 254 } |
255 | 255 |
256 if (!m_session->debugger()->client()->isInspectableHeapObject(heapObject)) { | 256 if (!m_session->debugger()->client()->isInspectableHeapObject(heapObject)) { |
257 *error = "Object is not available"; | 257 *error = "Object is not available"; |
258 return; | 258 return; |
259 } | 259 } |
260 | 260 |
261 *result = m_session->wrapObject(heapObject->CreationContext(), heapObject, o
bjectGroup.fromMaybe("")); | 261 *result = m_session->wrapObject(heapObject->CreationContext(), heapObject, o
bjectGroup.fromMaybe(""), false); |
262 if (!result) | 262 if (!result) |
263 *error = "Object is not available"; | 263 *error = "Object is not available"; |
264 } | 264 } |
265 | 265 |
266 void V8HeapProfilerAgentImpl::addInspectedHeapObject(ErrorString* errorString, c
onst String16& inspectedHeapObjectId) | 266 void V8HeapProfilerAgentImpl::addInspectedHeapObject(ErrorString* errorString, c
onst String16& inspectedHeapObjectId) |
267 { | 267 { |
268 bool ok; | 268 bool ok; |
269 int id = inspectedHeapObjectId.toInt(&ok); | 269 int id = inspectedHeapObjectId.toInt(&ok); |
270 if (!ok) { | 270 if (!ok) { |
271 *errorString = "Invalid heap snapshot object id"; | 271 *errorString = "Invalid heap snapshot object id"; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 *errorString = "Cannot access v8 sampled heap profile."; | 390 *errorString = "Cannot access v8 sampled heap profile."; |
391 return; | 391 return; |
392 } | 392 } |
393 v8::AllocationProfile::Node* root = v8Profile->GetRootNode(); | 393 v8::AllocationProfile::Node* root = v8Profile->GetRootNode(); |
394 *profile = protocol::HeapProfiler::SamplingHeapProfile::create() | 394 *profile = protocol::HeapProfiler::SamplingHeapProfile::create() |
395 .setHead(buildSampingHeapProfileNode(root)).build(); | 395 .setHead(buildSampingHeapProfileNode(root)).build(); |
396 #endif | 396 #endif |
397 } | 397 } |
398 | 398 |
399 } // namespace blink | 399 } // namespace blink |
OLD | NEW |