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

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

Issue 293963003: Remove ScriptObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 273 }
274 274
275 void InspectorHeapProfilerAgent::getObjectByHeapObjectId(ErrorString* error, con st String& heapSnapshotObjectId, const String* objectGroup, RefPtr<TypeBuilder:: Runtime::RemoteObject>& result) 275 void InspectorHeapProfilerAgent::getObjectByHeapObjectId(ErrorString* error, con st String& heapSnapshotObjectId, const String* objectGroup, RefPtr<TypeBuilder:: Runtime::RemoteObject>& result)
276 { 276 {
277 bool ok; 277 bool ok;
278 unsigned id = heapSnapshotObjectId.toUInt(&ok); 278 unsigned id = heapSnapshotObjectId.toUInt(&ok);
279 if (!ok) { 279 if (!ok) {
280 *error = "Invalid heap snapshot object id"; 280 *error = "Invalid heap snapshot object id";
281 return; 281 return;
282 } 282 }
283 ScriptObject heapObject = ScriptProfiler::objectByHeapObjectId(id); 283 ScriptValue heapObject = ScriptProfiler::objectByHeapObjectId(id);
284 if (heapObject.isEmpty()) { 284 if (heapObject.isEmpty()) {
285 *error = "Object is not available"; 285 *error = "Object is not available";
286 return; 286 return;
287 } 287 }
288 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(h eapObject.scriptState()); 288 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(h eapObject.scriptState());
289 if (injectedScript.isEmpty()) { 289 if (injectedScript.isEmpty()) {
290 *error = "Object is not available. Inspected context is gone"; 290 *error = "Object is not available. Inspected context is gone";
291 return; 291 return;
292 } 292 }
293 result = injectedScript.wrapObject(heapObject, objectGroup ? *objectGroup : ""); 293 result = injectedScript.wrapObject(heapObject, objectGroup ? *objectGroup : "");
(...skipping 13 matching lines...) Expand all
307 if (value.isEmpty() || value.isUndefined()) { 307 if (value.isEmpty() || value.isUndefined()) {
308 *errorString = "Object with given id not found"; 308 *errorString = "Object with given id not found";
309 return; 309 return;
310 } 310 }
311 unsigned id = ScriptProfiler::getHeapObjectId(value); 311 unsigned id = ScriptProfiler::getHeapObjectId(value);
312 *heapSnapshotObjectId = String::number(id); 312 *heapSnapshotObjectId = String::number(id);
313 } 313 }
314 314
315 } // namespace WebCore 315 } // namespace WebCore
316 316
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorFrontendHost.cpp ('k') | Source/core/inspector/InspectorInstrumentation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698