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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2449673002: Refactor InspectorWebPerfAgent: update lifecycle management to be per Local Frame root; replace hea… (Closed)
Patch Set: sync and rebase Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "core/frame/FrameConsole.h" 47 #include "core/frame/FrameConsole.h"
48 #include "core/frame/FrameHost.h" 48 #include "core/frame/FrameHost.h"
49 #include "core/frame/FrameView.h" 49 #include "core/frame/FrameView.h"
50 #include "core/frame/LocalDOMWindow.h" 50 #include "core/frame/LocalDOMWindow.h"
51 #include "core/frame/Settings.h" 51 #include "core/frame/Settings.h"
52 #include "core/frame/VisualViewport.h" 52 #include "core/frame/VisualViewport.h"
53 #include "core/html/HTMLFrameElementBase.h" 53 #include "core/html/HTMLFrameElementBase.h"
54 #include "core/html/HTMLPlugInElement.h" 54 #include "core/html/HTMLPlugInElement.h"
55 #include "core/input/EventHandler.h" 55 #include "core/input/EventHandler.h"
56 #include "core/inspector/InspectorInstrumentation.h" 56 #include "core/inspector/InspectorInstrumentation.h"
57 #include "core/inspector/InspectorWebPerfAgent.h"
57 #include "core/layout/HitTestResult.h" 58 #include "core/layout/HitTestResult.h"
58 #include "core/layout/LayoutView.h" 59 #include "core/layout/LayoutView.h"
59 #include "core/layout/api/LayoutPartItem.h" 60 #include "core/layout/api/LayoutPartItem.h"
60 #include "core/layout/api/LayoutViewItem.h" 61 #include "core/layout/api/LayoutViewItem.h"
61 #include "core/layout/compositing/PaintLayerCompositor.h" 62 #include "core/layout/compositing/PaintLayerCompositor.h"
62 #include "core/loader/FrameLoadRequest.h" 63 #include "core/loader/FrameLoadRequest.h"
63 #include "core/loader/FrameLoaderClient.h" 64 #include "core/loader/FrameLoaderClient.h"
64 #include "core/loader/NavigationScheduler.h" 65 #include "core/loader/NavigationScheduler.h"
65 #include "core/page/ChromeClient.h" 66 #include "core/page/ChromeClient.h"
66 #include "core/page/FocusController.h" 67 #include "core/page/FocusController.h"
67 #include "core/page/Page.h" 68 #include "core/page/Page.h"
68 #include "core/page/scrolling/ScrollingCoordinator.h" 69 #include "core/page/scrolling/ScrollingCoordinator.h"
69 #include "core/paint/ObjectPainter.h" 70 #include "core/paint/ObjectPainter.h"
70 #include "core/paint/PaintInfo.h" 71 #include "core/paint/PaintInfo.h"
71 #include "core/paint/PaintLayer.h" 72 #include "core/paint/PaintLayer.h"
72 #include "core/paint/TransformRecorder.h" 73 #include "core/paint/TransformRecorder.h"
73 #include "core/svg/SVGDocumentExtensions.h" 74 #include "core/svg/SVGDocumentExtensions.h"
75 #include "core/timing/Performance.h"
74 #include "platform/DragImage.h" 76 #include "platform/DragImage.h"
75 #include "platform/PluginScriptForbiddenScope.h" 77 #include "platform/PluginScriptForbiddenScope.h"
76 #include "platform/RuntimeEnabledFeatures.h" 78 #include "platform/RuntimeEnabledFeatures.h"
77 #include "platform/ScriptForbiddenScope.h" 79 #include "platform/ScriptForbiddenScope.h"
78 #include "platform/graphics/GraphicsContext.h" 80 #include "platform/graphics/GraphicsContext.h"
79 #include "platform/graphics/StaticBitmapImage.h" 81 #include "platform/graphics/StaticBitmapImage.h"
80 #include "platform/graphics/paint/ClipRecorder.h" 82 #include "platform/graphics/paint/ClipRecorder.h"
81 #include "platform/graphics/paint/PaintController.h" 83 #include "platform/graphics/paint/PaintController.h"
82 #include "platform/graphics/paint/SkPictureBuilder.h" 84 #include "platform/graphics/paint/SkPictureBuilder.h"
83 #include "platform/graphics/paint/TransformDisplayItem.h" 85 #include "platform/graphics/paint/TransformDisplayItem.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 324 }
323 325
324 LocalFrame::~LocalFrame() { 326 LocalFrame::~LocalFrame() {
325 // Verify that the FrameView has been cleared as part of detaching 327 // Verify that the FrameView has been cleared as part of detaching
326 // the frame owner. 328 // the frame owner.
327 ASSERT(!m_view); 329 ASSERT(!m_view);
328 } 330 }
329 331
330 DEFINE_TRACE(LocalFrame) { 332 DEFINE_TRACE(LocalFrame) {
331 visitor->trace(m_instrumentingAgents); 333 visitor->trace(m_instrumentingAgents);
334 visitor->trace(m_inspectorWebPerfAgent);
332 visitor->trace(m_loader); 335 visitor->trace(m_loader);
333 visitor->trace(m_navigationScheduler); 336 visitor->trace(m_navigationScheduler);
334 visitor->trace(m_view); 337 visitor->trace(m_view);
335 visitor->trace(m_domWindow); 338 visitor->trace(m_domWindow);
336 visitor->trace(m_pagePopupOwner); 339 visitor->trace(m_pagePopupOwner);
337 visitor->trace(m_script); 340 visitor->trace(m_script);
338 visitor->trace(m_editor); 341 visitor->trace(m_editor);
339 visitor->trace(m_spellChecker); 342 visitor->trace(m_spellChecker);
340 visitor->trace(m_selection); 343 visitor->trace(m_selection);
341 visitor->trace(m_eventHandler); 344 visitor->trace(m_eventHandler);
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 } 552 }
550 553
551 bool LocalFrame::isCrossOriginSubframe() const { 554 bool LocalFrame::isCrossOriginSubframe() const {
552 const SecurityOrigin* securityOrigin = securityContext()->getSecurityOrigin(); 555 const SecurityOrigin* securityOrigin = securityContext()->getSecurityOrigin();
553 Frame* top = tree().top(); 556 Frame* top = tree().top();
554 return top && 557 return top &&
555 !securityOrigin->canAccess( 558 !securityOrigin->canAccess(
556 top->securityContext()->getSecurityOrigin()); 559 top->securityContext()->getSecurityOrigin());
557 } 560 }
558 561
562 void LocalFrame::enableInspectorWebPerfAgent(Performance* performance) {
563 if (!m_inspectorWebPerfAgent) {
564 m_inspectorWebPerfAgent = new InspectorWebPerfAgent(this);
565 m_inspectorWebPerfAgent->enable();
566 }
567 m_inspectorWebPerfAgent->addWebPerformanceObserver(performance);
568 }
569
570 void LocalFrame::disableInspectorWebPerfAgent(Performance* performance) {
571 DCHECK(m_inspectorWebPerfAgent->isEnabled());
572 m_inspectorWebPerfAgent->removeWebPerformanceObserver(performance);
573 if (!m_inspectorWebPerfAgent->hasWebPerformanceObservers()) {
574 m_inspectorWebPerfAgent->disable();
575 m_inspectorWebPerfAgent = nullptr;
576 }
577 }
578
559 void LocalFrame::setPrinting(bool printing, 579 void LocalFrame::setPrinting(bool printing,
560 const FloatSize& pageSize, 580 const FloatSize& pageSize,
561 const FloatSize& originalPageSize, 581 const FloatSize& originalPageSize,
562 float maximumShrinkRatio) { 582 float maximumShrinkRatio) {
563 // In setting printing, we should not validate resources already cached for 583 // In setting printing, we should not validate resources already cached for
564 // the document. See https://bugs.webkit.org/show_bug.cgi?id=43704 584 // the document. See https://bugs.webkit.org/show_bug.cgi?id=43704
565 ResourceCacheValidationSuppressor validationSuppressor(document()->fetcher()); 585 ResourceCacheValidationSuppressor validationSuppressor(document()->fetcher());
566 586
567 document()->setPrinting(printing ? Document::Printing 587 document()->setPrinting(printing ? Document::Printing
568 : Document::FinishingPrinting); 588 : Document::FinishingPrinting);
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 933 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
914 m_frame->client()->frameBlameContext()->Enter(); 934 m_frame->client()->frameBlameContext()->Enter();
915 } 935 }
916 936
917 ScopedFrameBlamer::~ScopedFrameBlamer() { 937 ScopedFrameBlamer::~ScopedFrameBlamer() {
918 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 938 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
919 m_frame->client()->frameBlameContext()->Leave(); 939 m_frame->client()->frameBlameContext()->Leave();
920 } 940 }
921 941
922 } // namespace blink 942 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698