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

Side by Side Diff: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationController.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/screen_orientation/ScreenOrientationController.h" 5 #include "modules/screen_orientation/ScreenOrientationController.h"
6 6
7 #include "core/events/Event.h" 7 #include "core/events/Event.h"
8 #include "core/frame/FrameHost.h" 8 #include "core/frame/FrameHost.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
11 #include "core/page/ChromeClient.h" 11 #include "core/page/ChromeClient.h"
12 #include "core/page/Page.h" 12 #include "core/page/Page.h"
13 #include "modules/screen_orientation/ScreenOrientation.h" 13 #include "modules/screen_orientation/ScreenOrientation.h"
14 #include "modules/screen_orientation/ScreenOrientationDispatcher.h" 14 #include "modules/screen_orientation/ScreenOrientationDispatcher.h"
15 #include "platform/LayoutTestSupport.h" 15 #include "platform/LayoutTestSupport.h"
16 #include "public/platform/WebScreenInfo.h" 16 #include "public/platform/WebScreenInfo.h"
17 #include "public/platform/modules/screen_orientation/WebScreenOrientationClient. h" 17 #include "public/platform/modules/screen_orientation/WebScreenOrientationClient. h"
18 18
19 namespace blink { 19 namespace blink {
20 20
21 ScreenOrientationController::~ScreenOrientationController() 21 ScreenOrientationController::~ScreenOrientationController()
22 { 22 {
23 } 23 }
24 24
25 void ScreenOrientationController::provideTo(LocalFrame& frame, WebScreenOrientat ionClient* client) 25 void ScreenOrientationController::provideTo(LocalFrame& frame, WebScreenOrientat ionClient* client)
26 { 26 {
27 ASSERT(RuntimeEnabledFeatures::screenOrientationEnabled()); 27 ASSERT(RuntimeEnabledFeatures::screenOrientationEnabled());
28 28
29 ScreenOrientationController* controller = new ScreenOrientationController(fr ame, client); 29 ScreenOrientationController* controller = new ScreenOrientationController(fr ame, client);
30 WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPt rWillBeNoop(controller)); 30 HeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtrWillB eNoop(controller));
31 } 31 }
32 32
33 ScreenOrientationController* ScreenOrientationController::from(LocalFrame& frame ) 33 ScreenOrientationController* ScreenOrientationController::from(LocalFrame& frame )
34 { 34 {
35 return static_cast<ScreenOrientationController*>(WillBeHeapSupplement<LocalF rame>::from(frame, supplementName())); 35 return static_cast<ScreenOrientationController*>(HeapSupplement<LocalFrame>: :from(frame, supplementName()));
36 } 36 }
37 37
38 ScreenOrientationController::ScreenOrientationController(LocalFrame& frame, WebS creenOrientationClient* client) 38 ScreenOrientationController::ScreenOrientationController(LocalFrame& frame, WebS creenOrientationClient* client)
39 : LocalFrameLifecycleObserver(&frame) 39 : LocalFrameLifecycleObserver(&frame)
40 , PlatformEventController(frame.page()) 40 , PlatformEventController(frame.page())
41 , m_client(client) 41 , m_client(client)
42 , m_dispatchEventTimer(this, &ScreenOrientationController::dispatchEventTime rFired) 42 , m_dispatchEventTimer(this, &ScreenOrientationController::dispatchEventTime rFired)
43 { 43 {
44 } 44 }
45 45
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 ASSERT(RuntimeEnabledFeatures::screenOrientationEnabled()); 122 ASSERT(RuntimeEnabledFeatures::screenOrientationEnabled());
123 123
124 if (!isActiveAndVisible()) 124 if (!isActiveAndVisible())
125 return; 125 return;
126 126
127 updateOrientation(); 127 updateOrientation();
128 128
129 // Keep track of the frames that need to be notified before notifying the 129 // Keep track of the frames that need to be notified before notifying the
130 // current frame as it will prevent side effects from the change event 130 // current frame as it will prevent side effects from the change event
131 // handlers. 131 // handlers.
132 WillBeHeapVector<RefPtrWillBeMember<LocalFrame>> childFrames; 132 HeapVector<Member<LocalFrame>> childFrames;
133 for (Frame* child = frame()->tree().firstChild(); child; child = child->tree ().nextSibling()) { 133 for (Frame* child = frame()->tree().firstChild(); child; child = child->tree ().nextSibling()) {
134 if (child->isLocalFrame()) 134 if (child->isLocalFrame())
135 childFrames.append(toLocalFrame(child)); 135 childFrames.append(toLocalFrame(child));
136 } 136 }
137 137
138 // Notify current orientation object. 138 // Notify current orientation object.
139 if (!m_dispatchEventTimer.isActive()) 139 if (!m_dispatchEventTimer.isActive())
140 m_dispatchEventTimer.startOneShot(0, BLINK_FROM_HERE); 140 m_dispatchEventTimer.startOneShot(0, BLINK_FROM_HERE);
141 141
142 // ... and child frames, if they have a ScreenOrientationController. 142 // ... and child frames, if they have a ScreenOrientationController.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if (m_orientation && page()->isPageVisible()) 207 if (m_orientation && page()->isPageVisible())
208 startUpdating(); 208 startUpdating();
209 else 209 else
210 stopUpdating(); 210 stopUpdating();
211 } 211 }
212 212
213 DEFINE_TRACE(ScreenOrientationController) 213 DEFINE_TRACE(ScreenOrientationController)
214 { 214 {
215 visitor->trace(m_orientation); 215 visitor->trace(m_orientation);
216 LocalFrameLifecycleObserver::trace(visitor); 216 LocalFrameLifecycleObserver::trace(visitor);
217 WillBeHeapSupplement<LocalFrame>::trace(visitor); 217 HeapSupplement<LocalFrame>::trace(visitor);
218 PlatformEventController::trace(visitor); 218 PlatformEventController::trace(visitor);
219 } 219 }
220 220
221 } // namespace blink 221 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698