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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2238883005: POC for InspectorInstrumentation adding InspectorWebPerfAgent Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add task observer to WebPerfAgent Created 4 years, 4 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/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index 573e3274effa896059d560dc9febdc599e00e01a..6eb686489043e510aecb3bdc22a1f7803481c102 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -47,11 +47,14 @@
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalDOMWindow.h"
+#include "core/frame/Location.h"
#include "core/frame/Settings.h"
#include "core/html/HTMLFrameElementBase.h"
#include "core/html/HTMLPlugInElement.h"
#include "core/input/EventHandler.h"
+#include "core/inspector/InspectedFrames.h"
#include "core/inspector/InspectorInstrumentation.h"
+#include "core/inspector/InspectorWebPerfAgent.h"
#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutView.h"
#include "core/layout/api/LayoutViewItem.h"
@@ -68,6 +71,7 @@
#include "core/paint/PaintLayer.h"
#include "core/paint/TransformRecorder.h"
#include "core/svg/SVGDocumentExtensions.h"
+#include "core/timing/DOMWindowPerformance.h"
#include "platform/DragImage.h"
#include "platform/JSONValues.h"
#include "platform/PluginScriptForbiddenScope.h"
@@ -317,6 +321,7 @@ LocalFrame::~LocalFrame()
DEFINE_TRACE(LocalFrame)
{
visitor->trace(m_instrumentingAgents);
+ visitor->trace(m_inspectorWebPerformanceAgent);
visitor->trace(m_loader);
visitor->trace(m_navigationScheduler);
visitor->trace(m_view);
@@ -820,10 +825,11 @@ inline LocalFrame::LocalFrame(FrameLoaderClient* client, FrameHost* host, FrameO
, m_inViewSourceMode(false)
, m_interfaceProvider(interfaceProvider)
{
- if (isLocalRoot())
+ if (isLocalRoot()) {
pfeldman 2016/08/17 21:12:10 revert these
m_instrumentingAgents = new InstrumentingAgents();
- else
+ } else {
m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents;
+ }
}
WebFrameScheduler* LocalFrame::frameScheduler()
@@ -850,6 +856,23 @@ PluginData* LocalFrame::pluginData() const
return page()->pluginData();
}
+void LocalFrame::enableWebPerfInspectorInstrumentation()
Sami 2016/08/17 10:40:28 Could we have a way to disable this too?
+{
+ // Register InspectorAgent to begin observing LongTaskTiming
+ if (this->isLocalRoot()) {
+ if (!m_inspectorWebPerformanceAgent) {
pfeldman 2016/08/17 21:12:10 This can become a utility static function within I
+ Location* location = document()->location();
+ fprintf(stderr, "\n^^^LocalFrame::enableWebPerfInspectorInstrumentation() %s: %s!",
+ location->hostname().ascii().data(),
+ location->pathname().ascii().data());
+ m_inspectorWebPerformanceAgent = new InspectorWebPerfAgent(
+ InspectedFrames::create(localFrameRoot()));
+ m_instrumentingAgents->addInspectorWebPerfAgent(
+ m_inspectorWebPerformanceAgent);
+ }
+ }
+}
+
DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame);
FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame)

Powered by Google App Engine
This is Rietveld 408576698