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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp

Issue 1916023002: [DevTools] Move last inspected objects to V8InspectorSessionImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-part-command-line-api-to-native
Patch Set: Created 4 years, 8 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/platform/v8_inspector/V8RuntimeAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
index 40f7be1b63f0329358d40423f7876c92759e7fbf..4187fb272afad37b539989e78c7e937b159d0c2c 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
@@ -423,12 +423,22 @@ v8::Local<v8::Value> V8RuntimeAgentImpl::findObject(ErrorString* errorString, co
void V8RuntimeAgentImpl::addInspectedObject(PassOwnPtr<Inspectable> inspectable)
{
- m_session->addInspectedObject(inspectable);
+ m_inspectedObjects.prepend(inspectable);
+ while (m_inspectedObjects.size() > inspectedObjectBufferSize)
+ m_inspectedObjects.removeLast();
+}
+
+V8RuntimeAgent::Inspectable* V8RuntimeAgentImpl::inspectedObject(unsigned num)
+{
+ if (num >= m_inspectedObjects.size())
+ return nullptr;
+ return m_inspectedObjects[num].get();
}
void V8RuntimeAgentImpl::reset()
{
m_compiledScripts.clear();
+ m_inspectedObjects.clear();
if (m_enabled) {
if (const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_session->contextGroupId())) {
for (auto& idContext : *contexts)

Powered by Google App Engine
This is Rietveld 408576698