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

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

Issue 104313002: Use HeapProfiler::FindObjectById when searching for node (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years 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 | « Source/bindings/v8/ScriptProfiler.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 211
212 void InspectorHeapProfilerAgent::enable(ErrorString*) 212 void InspectorHeapProfilerAgent::enable(ErrorString*)
213 { 213 {
214 m_state->setBoolean(HeapProfilerAgentState::heapProfilerEnabled, true); 214 m_state->setBoolean(HeapProfilerAgentState::heapProfilerEnabled, true);
215 } 215 }
216 216
217 void InspectorHeapProfilerAgent::disable(ErrorString* error) 217 void InspectorHeapProfilerAgent::disable(ErrorString* error)
218 { 218 {
219 stopTrackingHeapObjectsInternal(); 219 stopTrackingHeapObjectsInternal();
220 ScriptProfiler::clearHeapObjectIds();
220 m_state->setBoolean(HeapProfilerAgentState::heapProfilerEnabled, false); 221 m_state->setBoolean(HeapProfilerAgentState::heapProfilerEnabled, false);
221 } 222 }
222 223
223 void InspectorHeapProfilerAgent::getHeapSnapshot(ErrorString* errorString, int r awUid) 224 void InspectorHeapProfilerAgent::getHeapSnapshot(ErrorString* errorString, int r awUid)
224 { 225 {
225 class OutputStream : public ScriptHeapSnapshot::OutputStream { 226 class OutputStream : public ScriptHeapSnapshot::OutputStream {
226 public: 227 public:
227 OutputStream(InspectorFrontend::HeapProfiler* frontend, unsigned uid) 228 OutputStream(InspectorFrontend::HeapProfiler* frontend, unsigned uid)
228 : m_frontend(frontend), m_uid(uid) { } 229 : m_frontend(frontend), m_uid(uid) { }
229 void Write(const String& chunk) { m_frontend->addHeapSnapshotChunk(m_uid , chunk); } 230 void Write(const String& chunk) { m_frontend->addHeapSnapshotChunk(m_uid , chunk); }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 if (value.hasNoValue() || value.isUndefined()) { 321 if (value.hasNoValue() || value.isUndefined()) {
321 *errorString = "Object with given id not found"; 322 *errorString = "Object with given id not found";
322 return; 323 return;
323 } 324 }
324 unsigned id = ScriptProfiler::getHeapObjectId(value); 325 unsigned id = ScriptProfiler::getHeapObjectId(value);
325 *heapSnapshotObjectId = String::number(id); 326 *heapSnapshotObjectId = String::number(id);
326 } 327 }
327 328
328 } // namespace WebCore 329 } // namespace WebCore
329 330
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptProfiler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698