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

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

Issue 1622213002: DevTools: make InjectedScript heap-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed protocol tests. Created 4 years, 11 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: third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp
index 1fe4c09225c3bcf16576dae33d89b4917c53413a..5b112eeb6812c688d15034623de398a14dfaa193 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp
@@ -334,12 +334,12 @@ void InspectorHeapProfilerAgent::getObjectByHeapObjectId(ErrorString* error, con
*error = "Object is not available";
return;
}
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(heapObject.scriptState());
- if (injectedScript.isEmpty()) {
+ InjectedScript* injectedScript = m_injectedScriptManager->injectedScriptFor(heapObject.scriptState());
+ if (!injectedScript) {
*error = "Object is not available. Inspected context is gone";
return;
}
- result = injectedScript.wrapObject(heapObject, objectGroup ? *objectGroup : "");
+ result = injectedScript->wrapObject(heapObject, objectGroup ? *objectGroup : "");
if (!result)
*error = "Failed to wrap object";
}
@@ -362,13 +362,13 @@ void InspectorHeapProfilerAgent::getHeapObjectId(ErrorString* errorString, const
*errorString = "Invalid object id";
return;
}
- InjectedScript injectedScript = m_injectedScriptManager->findInjectedScript(remoteId.get());
- if (injectedScript.isEmpty()) {
+ InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript(remoteId.get());
+ if (!injectedScript) {
*errorString = "Inspected context has gone";
return;
}
- ScriptState::Scope scope(injectedScript.scriptState());
- v8::Local<v8::Value> value = injectedScript.findObject(*remoteId);
+ ScriptState::Scope scope(injectedScript->scriptState());
+ v8::Local<v8::Value> value = injectedScript->findObject(*remoteId);
if (value.IsEmpty() || value->IsUndefined()) {
*errorString = "Object with given id not found";
return;

Powered by Google App Engine
This is Rietveld 408576698