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: Source/core/frame/DOMWindowLifecycleNotifier.cpp

Issue 642293004: Use C++11 range-based loop in core/frame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use meaningful names Created 6 years, 2 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 PassOwnPtr<DOMWindowLifecycleNotifier> DOMWindowLifecycleNotifier::create(LocalD OMWindow* context) 57 PassOwnPtr<DOMWindowLifecycleNotifier> DOMWindowLifecycleNotifier::create(LocalD OMWindow* context)
58 { 58 {
59 return adoptPtr(new DOMWindowLifecycleNotifier(context)); 59 return adoptPtr(new DOMWindowLifecycleNotifier(context));
60 } 60 }
61 61
62 void DOMWindowLifecycleNotifier::notifyAddEventListener(LocalDOMWindow* window, const AtomicString& eventType) 62 void DOMWindowLifecycleNotifier::notifyAddEventListener(LocalDOMWindow* window, const AtomicString& eventType)
63 { 63 {
64 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverDOMWind owObservers); 64 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverDOMWind owObservers);
65 for (DOMWindowObserverSet::iterator it = m_windowObservers.begin(); it != m_ windowObservers.end(); ++it) 65 for (const auto& windowObserver : m_windowObservers)
66 (*it)->didAddEventListener(window, eventType); 66 windowObserver->didAddEventListener(window, eventType);
67 } 67 }
68 68
69 void DOMWindowLifecycleNotifier::notifyRemoveEventListener(LocalDOMWindow* windo w, const AtomicString& eventType) 69 void DOMWindowLifecycleNotifier::notifyRemoveEventListener(LocalDOMWindow* windo w, const AtomicString& eventType)
70 { 70 {
71 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverDOMWind owObservers); 71 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverDOMWind owObservers);
72 for (DOMWindowObserverSet::iterator it = m_windowObservers.begin(); it != m_ windowObservers.end(); ++it) 72 for (const auto& windowObserver : m_windowObservers)
73 (*it)->didRemoveEventListener(window, eventType); 73 windowObserver->didRemoveEventListener(window, eventType);
74 } 74 }
75 75
76 void DOMWindowLifecycleNotifier::notifyRemoveAllEventListeners(LocalDOMWindow* w indow) 76 void DOMWindowLifecycleNotifier::notifyRemoveAllEventListeners(LocalDOMWindow* w indow)
77 { 77 {
78 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverDOMWind owObservers); 78 TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverDOMWind owObservers);
79 for (DOMWindowObserverSet::iterator it = m_windowObservers.begin(); it != m_ windowObservers.end(); ++it) 79 for (const auto& windowObserver : m_windowObservers)
80 (*it)->didRemoveAllEventListeners(window); 80 windowObserver->didRemoveAllEventListeners(window);
81 } 81 }
82 82
83 } // namespace blink 83 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/EventHandlerRegistry.cpp » ('j') | Source/core/frame/FrameView.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698