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

Unified Diff: Source/core/inspector/InspectorHeapProfilerAgent.cpp

Issue 300393002: Merge DevTools Refactor CL to Blink36 (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1985
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 side-by-side diff with in-line comments
Download patch
Index: Source/core/inspector/InspectorHeapProfilerAgent.cpp
diff --git a/Source/core/inspector/InspectorHeapProfilerAgent.cpp b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
index 6802ae9b513c6178151451f98cb00c7a421304d6..f3a424718de7ee8c986ae17c894a09fad5e443ce 100644
--- a/Source/core/inspector/InspectorHeapProfilerAgent.cpp
+++ b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
@@ -285,7 +285,7 @@ void InspectorHeapProfilerAgent::getObjectByHeapObjectId(ErrorString* error, con
*error = "Object is not available";
return;
}
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(heapObject.scriptState());
+ InjectedScript& injectedScript = m_injectedScriptManager->injectedScriptFor(heapObject.scriptState());
if (injectedScript.isEmpty()) {
*error = "Object is not available. Inspected context is gone";
return;
@@ -297,13 +297,21 @@ void InspectorHeapProfilerAgent::getObjectByHeapObjectId(ErrorString* error, con
void InspectorHeapProfilerAgent::getHeapObjectId(ErrorString* errorString, const String& objectId, String* heapSnapshotObjectId)
{
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
+ InjectedScript& injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
if (injectedScript.isEmpty()) {
*errorString = "Inspected context has gone";
return;
}
- ScriptValue value = injectedScript.findObjectById(objectId);
+ if (!injectedScript.isJavaScript()) {
+ *errorString = "The heap profiler does not yet work for Dart.";
+ return;
+ }
+
+ V8InjectedScript& v8InjectedScript = static_cast<V8InjectedScript&>(injectedScript);
+
+ ScriptValue value = v8InjectedScript.findObjectById(objectId);
ScriptState::Scope scope(injectedScript.scriptState());
+
if (value.isEmpty() || value.isUndefined()) {
*errorString = "Object with given id not found";
return;

Powered by Google App Engine
This is Rietveld 408576698