| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |