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

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

Issue 2012753003: DevTools: consolidate protocol generators for front-end, backend and type builder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
index 101f23aa2e2b502a38b22a875f0649a7bfc7ac67..3281d1ba1dab4802505aa0059f9a20cf6011d7a8 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
@@ -149,10 +149,10 @@ private:
} // namespace
-V8HeapProfilerAgentImpl::V8HeapProfilerAgentImpl(V8InspectorSessionImpl* session, protocol::HeapProfiler::Frontend* frontend, protocol::DictionaryValue* state)
+V8HeapProfilerAgentImpl::V8HeapProfilerAgentImpl(V8InspectorSessionImpl* session, protocol::FrontendChannel* frontendChannel, protocol::DictionaryValue* state)
: m_session(session)
, m_isolate(session->debugger()->isolate())
- , m_frontend(frontend)
+ , m_frontend(frontendChannel)
, m_state(state)
, m_hasTimer(false)
{
@@ -165,7 +165,7 @@ V8HeapProfilerAgentImpl::~V8HeapProfilerAgentImpl()
void V8HeapProfilerAgentImpl::restore()
{
if (m_state->booleanProperty(HeapProfilerAgentState::heapProfilerEnabled, false))
- m_frontend->resetProfiles();
+ m_frontend.resetProfiles();
if (m_state->booleanProperty(HeapProfilerAgentState::heapObjectsTrackingEnabled, false))
startTrackingHeapObjectsInternal(m_state->booleanProperty(HeapProfilerAgentState::allocationTrackingEnabled, false));
#if V8_MAJOR_VERSION >= 5
@@ -226,7 +226,7 @@ void V8HeapProfilerAgentImpl::takeHeapSnapshot(ErrorString* errorString, const p
}
std::unique_ptr<HeapSnapshotProgress> progress;
if (reportProgress.fromMaybe(false))
- progress = wrapUnique(new HeapSnapshotProgress(m_frontend));
+ progress = wrapUnique(new HeapSnapshotProgress(&m_frontend));
GlobalObjectNameResolver resolver(m_session);
const v8::HeapSnapshot* snapshot = profiler->TakeHeapSnapshot(progress.get(), &resolver);
@@ -234,7 +234,7 @@ void V8HeapProfilerAgentImpl::takeHeapSnapshot(ErrorString* errorString, const p
*errorString = "Failed to take heap snapshot";
return;
}
- HeapSnapshotOutputStream stream(m_frontend);
+ HeapSnapshotOutputStream stream(&m_frontend);
snapshot->Serialize(&stream);
const_cast<v8::HeapSnapshot*>(snapshot)->Delete();
}
@@ -302,11 +302,9 @@ void V8HeapProfilerAgentImpl::getHeapObjectId(ErrorString* errorString, const St
void V8HeapProfilerAgentImpl::requestHeapStatsUpdate()
{
- if (!m_frontend)
- return;
- HeapStatsStream stream(m_frontend);
+ HeapStatsStream stream(&m_frontend);
v8::SnapshotObjectId lastSeenObjectId = m_isolate->GetHeapProfiler()->GetHeapStats(&stream);
- m_frontend->lastSeenObjectId(lastSeenObjectId, m_session->debugger()->client()->currentTimeMS());
+ m_frontend.lastSeenObjectId(lastSeenObjectId, m_session->debugger()->client()->currentTimeMS());
}
// static

Powered by Google App Engine
This is Rietveld 408576698