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

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: PTAL Created 6 years, 6 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
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.cpp ('k') | Source/core/inspector/InspectorRuntimeAgent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorHeapProfilerAgent.cpp
diff --git a/Source/core/inspector/InspectorHeapProfilerAgent.cpp b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
index 117f0f5752edba9fd229cf1bc7027c53e1aea8fb..05bfdbf02875203ae6fbf9189fce4124994bf1c8 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);
V8ScriptState::Scope scope(injectedScript.scriptState()->v8ScriptState());
+
if (value.isEmpty() || value.isUndefined()) {
*errorString = "Object with given id not found";
return;
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.cpp ('k') | Source/core/inspector/InspectorRuntimeAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698