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

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

Issue 27000005: Remove HeapProfiler.finishHeapSnapshot event from remote debugging protocol (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed heap profiler test Created 7 years, 2 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 | Annotate | Revision Log
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 m_state->setBoolean(HeapProfilerAgentState::heapProfilerEnabled, false); 210 m_state->setBoolean(HeapProfilerAgentState::heapProfilerEnabled, false);
211 } 211 }
212 212
213 void InspectorHeapProfilerAgent::getHeapSnapshot(ErrorString* errorString, int r awUid) 213 void InspectorHeapProfilerAgent::getHeapSnapshot(ErrorString* errorString, int r awUid)
214 { 214 {
215 class OutputStream : public ScriptHeapSnapshot::OutputStream { 215 class OutputStream : public ScriptHeapSnapshot::OutputStream {
216 public: 216 public:
217 OutputStream(InspectorFrontend::HeapProfiler* frontend, unsigned uid) 217 OutputStream(InspectorFrontend::HeapProfiler* frontend, unsigned uid)
218 : m_frontend(frontend), m_uid(uid) { } 218 : m_frontend(frontend), m_uid(uid) { }
219 void Write(const String& chunk) { m_frontend->addHeapSnapshotChunk(m_uid , chunk); } 219 void Write(const String& chunk) { m_frontend->addHeapSnapshotChunk(m_uid , chunk); }
220 void Close() { m_frontend->finishHeapSnapshot(m_uid); } 220 void Close() { }
221 private: 221 private:
222 InspectorFrontend::HeapProfiler* m_frontend; 222 InspectorFrontend::HeapProfiler* m_frontend;
223 int m_uid; 223 int m_uid;
224 }; 224 };
225 225
226 unsigned uid = static_cast<unsigned>(rawUid); 226 unsigned uid = static_cast<unsigned>(rawUid);
227 IdToHeapSnapshotMap::iterator it = m_snapshots.find(uid); 227 IdToHeapSnapshotMap::iterator it = m_snapshots.find(uid);
228 if (it == m_snapshots.end()) { 228 if (it == m_snapshots.end()) {
229 *errorString = "Profile wasn't found"; 229 *errorString = "Profile wasn't found";
230 return; 230 return;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 if (value.hasNoValue() || value.isUndefined()) { 309 if (value.hasNoValue() || value.isUndefined()) {
310 *errorString = "Object with given id not found"; 310 *errorString = "Object with given id not found";
311 return; 311 return;
312 } 312 }
313 unsigned id = ScriptProfiler::getHeapObjectId(value); 313 unsigned id = ScriptProfiler::getHeapObjectId(value);
314 *heapSnapshotObjectId = String::number(id); 314 *heapSnapshotObjectId = String::number(id);
315 } 315 }
316 316
317 } // namespace WebCore 317 } // namespace WebCore
318 318
OLDNEW
« no previous file with comments | « LayoutTests/inspector/profiler/heap-snapshot-test.js ('k') | Source/devtools/front_end/CPUProfileView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698