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

Side by Side Diff: Source/core/frame/DOMWindowLifecycleNotifier.cpp

Issue 991763002: Remove unnecessary add/removeObserver lifetime notifier indirections. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All Rights Reserved. 2 * Copyright (C) 2013 Google Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 18 matching lines...) Expand all
29 29
30 #include "core/frame/DOMWindowLifecycleObserver.h" 30 #include "core/frame/DOMWindowLifecycleObserver.h"
31 31
32 namespace blink { 32 namespace blink {
33 33
34 DOMWindowLifecycleNotifier::DOMWindowLifecycleNotifier(LocalDOMWindow* context) 34 DOMWindowLifecycleNotifier::DOMWindowLifecycleNotifier(LocalDOMWindow* context)
35 : LifecycleNotifier<LocalDOMWindow, DOMWindowLifecycleObserver>(context) 35 : LifecycleNotifier<LocalDOMWindow, DOMWindowLifecycleObserver>(context)
36 { 36 {
37 } 37 }
38 38
39 void DOMWindowLifecycleNotifier::addObserver(DOMWindowLifecycleObserver* observe r)
40 {
41 LifecycleNotifier<LocalDOMWindow, DOMWindowLifecycleObserver>::addObserver(o bserver);
42 }
43
44 void DOMWindowLifecycleNotifier::removeObserver(DOMWindowLifecycleObserver* obse rver)
45 {
46 LifecycleNotifier<LocalDOMWindow, DOMWindowLifecycleObserver>::removeObserve r(observer);
47 }
48
49 void DOMWindowLifecycleNotifier::notifyAddEventListener(LocalDOMWindow* window, const AtomicString& eventType) 39 void DOMWindowLifecycleNotifier::notifyAddEventListener(LocalDOMWindow* window, const AtomicString& eventType)
50 { 40 {
51 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); 41 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll);
52 for (DOMWindowLifecycleObserver* observer : m_observers) 42 for (DOMWindowLifecycleObserver* observer : m_observers)
53 observer->didAddEventListener(window, eventType); 43 observer->didAddEventListener(window, eventType);
54 } 44 }
55 45
56 void DOMWindowLifecycleNotifier::notifyRemoveEventListener(LocalDOMWindow* windo w, const AtomicString& eventType) 46 void DOMWindowLifecycleNotifier::notifyRemoveEventListener(LocalDOMWindow* windo w, const AtomicString& eventType)
57 { 47 {
58 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); 48 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll);
59 for (DOMWindowLifecycleObserver* observer : m_observers) 49 for (DOMWindowLifecycleObserver* observer : m_observers)
60 observer->didRemoveEventListener(window, eventType); 50 observer->didRemoveEventListener(window, eventType);
61 } 51 }
62 52
63 void DOMWindowLifecycleNotifier::notifyRemoveAllEventListeners(LocalDOMWindow* w indow) 53 void DOMWindowLifecycleNotifier::notifyRemoveAllEventListeners(LocalDOMWindow* w indow)
64 { 54 {
65 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); 55 TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll);
66 for (DOMWindowLifecycleObserver* observer : m_observers) 56 for (DOMWindowLifecycleObserver* observer : m_observers)
67 observer->didRemoveAllEventListeners(window); 57 observer->didRemoveAllEventListeners(window);
68 } 58 }
69 59
70 } // namespace blink 60 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698