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

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

Issue 2727953002: Added histogram for resize listener duration. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "core/loader/DocumentLoader.h" 73 #include "core/loader/DocumentLoader.h"
74 #include "core/loader/appcache/ApplicationCache.h" 74 #include "core/loader/appcache/ApplicationCache.h"
75 #include "core/page/ChromeClient.h" 75 #include "core/page/ChromeClient.h"
76 #include "core/page/CreateWindow.h" 76 #include "core/page/CreateWindow.h"
77 #include "core/page/Page.h" 77 #include "core/page/Page.h"
78 #include "core/page/WindowFeatures.h" 78 #include "core/page/WindowFeatures.h"
79 #include "core/page/scrolling/ScrollingCoordinator.h" 79 #include "core/page/scrolling/ScrollingCoordinator.h"
80 #include "core/timing/DOMWindowPerformance.h" 80 #include "core/timing/DOMWindowPerformance.h"
81 #include "core/timing/Performance.h" 81 #include "core/timing/Performance.h"
82 #include "platform/EventDispatchForbiddenScope.h" 82 #include "platform/EventDispatchForbiddenScope.h"
83 #include "platform/Histogram.h"
83 #include "platform/WebFrameScheduler.h" 84 #include "platform/WebFrameScheduler.h"
84 #include "platform/loader/fetch/ResourceFetcher.h" 85 #include "platform/loader/fetch/ResourceFetcher.h"
85 #include "platform/weborigin/SecurityOrigin.h" 86 #include "platform/weborigin/SecurityOrigin.h"
86 #include "platform/weborigin/Suborigin.h" 87 #include "platform/weborigin/Suborigin.h"
87 #include "public/platform/Platform.h" 88 #include "public/platform/Platform.h"
88 #include "public/platform/WebScreenInfo.h" 89 #include "public/platform/WebScreenInfo.h"
89 #include "public/platform/site_engagement.mojom-blink.h" 90 #include "public/platform/site_engagement.mojom-blink.h"
90 91
91 #include <memory> 92 #include <memory>
92 93
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1513 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 1514 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden());
1514 #endif 1515 #endif
1515 1516
1516 event->setTrusted(true); 1517 event->setTrusted(true);
1517 event->setTarget(target ? target : this); 1518 event->setTarget(target ? target : this);
1518 event->setCurrentTarget(this); 1519 event->setCurrentTarget(this);
1519 event->setEventPhase(Event::kAtTarget); 1520 event->setEventPhase(Event::kAtTarget);
1520 1521
1521 TRACE_EVENT1("devtools.timeline", "EventDispatch", "data", 1522 TRACE_EVENT1("devtools.timeline", "EventDispatch", "data",
1522 InspectorEventDispatchEvent::data(*event)); 1523 InspectorEventDispatchEvent::data(*event));
1523 return fireEventListeners(event); 1524 DispatchEventResult result;
1525
1526 if (frame() && frame()->isMainFrame() &&
1527 event->type() == EventTypeNames::resize) {
1528 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.EventListenerDuration.Resize");
1529 result = fireEventListeners(event);
1530 } else {
1531 result = fireEventListeners(event);
1532 }
1533
1534 return result;
1524 } 1535 }
1525 1536
1526 void LocalDOMWindow::removeAllEventListeners() { 1537 void LocalDOMWindow::removeAllEventListeners() {
1527 EventTarget::removeAllEventListeners(); 1538 EventTarget::removeAllEventListeners();
1528 1539
1529 for (auto& it : m_eventListenerObservers) { 1540 for (auto& it : m_eventListenerObservers) {
1530 it->didRemoveAllEventListeners(this); 1541 it->didRemoveAllEventListeners(this);
1531 } 1542 }
1532 1543
1533 if (frame() && frame()->host()) 1544 if (frame() && frame()->host())
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 DOMWindow::trace(visitor); 1653 DOMWindow::trace(visitor);
1643 Supplementable<LocalDOMWindow>::trace(visitor); 1654 Supplementable<LocalDOMWindow>::trace(visitor);
1644 } 1655 }
1645 1656
1646 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { 1657 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) {
1647 visitor->traceWrappers(m_customElements); 1658 visitor->traceWrappers(m_customElements);
1648 DOMWindow::traceWrappers(visitor); 1659 DOMWindow::traceWrappers(visitor);
1649 } 1660 }
1650 1661
1651 } // namespace blink 1662 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698