Chromium Code Reviews| 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) |