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/LocalDOMWindow.cpp

Issue 2833733002: Avoid firing load events on style elements if there is no listeners for that (Closed)
Patch Set: fix style Created 3 years, 8 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
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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 1435
1436 void LocalDOMWindow::AddedEventListener( 1436 void LocalDOMWindow::AddedEventListener(
1437 const AtomicString& event_type, 1437 const AtomicString& event_type,
1438 RegisteredEventListener& registered_listener) { 1438 RegisteredEventListener& registered_listener) {
1439 DOMWindow::AddedEventListener(event_type, registered_listener); 1439 DOMWindow::AddedEventListener(event_type, registered_listener);
1440 if (GetFrame() && GetFrame()->GetPage()) 1440 if (GetFrame() && GetFrame()->GetPage())
1441 GetFrame()->GetPage()->GetEventHandlerRegistry().DidAddEventHandler( 1441 GetFrame()->GetPage()->GetEventHandlerRegistry().DidAddEventHandler(
1442 *this, event_type, registered_listener.Options()); 1442 *this, event_type, registered_listener.Options());
1443 1443
1444 if (Document* document = this->document()) 1444 if (Document* document = this->document())
1445 document->AddListenerTypeIfNeeded(event_type); 1445 document->AddListenerTypeIfNeeded(event_type, *this);
1446 1446
1447 for (auto& it : event_listener_observers_) { 1447 for (auto& it : event_listener_observers_) {
1448 it->DidAddEventListener(this, event_type); 1448 it->DidAddEventListener(this, event_type);
1449 } 1449 }
1450 1450
1451 if (event_type == EventTypeNames::unload) { 1451 if (event_type == EventTypeNames::unload) {
1452 UseCounter::Count(document(), UseCounter::kDocumentUnloadRegistered); 1452 UseCounter::Count(document(), UseCounter::kDocumentUnloadRegistered);
1453 AddUnloadEventListener(this); 1453 AddUnloadEventListener(this);
1454 } else if (event_type == EventTypeNames::beforeunload) { 1454 } else if (event_type == EventTypeNames::beforeunload) {
1455 UseCounter::Count(document(), UseCounter::kDocumentBeforeUnloadRegistered); 1455 UseCounter::Count(document(), UseCounter::kDocumentBeforeUnloadRegistered);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 DOMWindow::Trace(visitor); 1684 DOMWindow::Trace(visitor);
1685 Supplementable<LocalDOMWindow>::Trace(visitor); 1685 Supplementable<LocalDOMWindow>::Trace(visitor);
1686 } 1686 }
1687 1687
1688 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { 1688 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) {
1689 visitor->TraceWrappers(custom_elements_); 1689 visitor->TraceWrappers(custom_elements_);
1690 DOMWindow::TraceWrappers(visitor); 1690 DOMWindow::TraceWrappers(visitor);
1691 } 1691 }
1692 1692
1693 } // namespace blink 1693 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698