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

Side by Side Diff: Source/modules/screen_orientation/ScreenOrientationDispatcher.h

Issue 620683006: Move PlatformEventDispatcher implementations to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sof-fix-platform
Patch Set: Set baseurl 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 // 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 #ifndef ScreenOrientationDispatcher_h 5 #ifndef ScreenOrientationDispatcher_h
6 #define ScreenOrientationDispatcher_h 6 #define ScreenOrientationDispatcher_h
7 7
8 #include "core/frame/PlatformEventDispatcher.h" 8 #include "core/frame/PlatformEventDispatcher.h"
9 #include "platform/heap/Handle.h"
9 10
10 namespace blink { 11 namespace blink {
11 12
12 class FrameView;
13 class ScreenOrientation;
14
15 // ScreenOrientationDispatcher is a singleton that handles whether the current 13 // ScreenOrientationDispatcher is a singleton that handles whether the current
16 // Blink instance should be listening to the screen orientation platform events. 14 // Blink instance should be listening to the screen orientation platform events.
17 // It is not a common implementation of PlatformEventDispatcher in the sense 15 // It is not a common implementation of PlatformEventDispatcher in the sense
18 // that it doesn't actually dispatch events but simply start/stop listening. The 16 // that it doesn't actually dispatch events but simply start/stop listening. The
19 // reason being that screen orientation events are always sent to the WebFrame's 17 // reason being that screen orientation events are always sent to the WebFrame's
20 // but some platforms require to poll to have an accurate reporting. When 18 // but some platforms require to poll to have an accurate reporting. When
21 // ScreenOrientationDispatcher is listening, that means that the platform should 19 // ScreenOrientationDispatcher is listening, that means that the platform should
22 // be polling if required. 20 // be polling if required.
23 class ScreenOrientationDispatcher FINAL : 21 class ScreenOrientationDispatcher final : public GarbageCollected<ScreenOrientat ionDispatcher>, public PlatformEventDispatcher {
24 public PlatformEventDispatcher {
25 public: 22 public:
26 static ScreenOrientationDispatcher& instance(); 23 static ScreenOrientationDispatcher& instance();
27 24
25 virtual void trace(Visitor*) override;
26
28 private: 27 private:
29 ScreenOrientationDispatcher(); 28 ScreenOrientationDispatcher();
30 virtual ~ScreenOrientationDispatcher();
31 29
32 // Inherited from PlatformEventDispatcher. 30 // Inherited from PlatformEventDispatcher.
33 virtual void startListening() OVERRIDE; 31 virtual void startListening() OVERRIDE;
34 virtual void stopListening() OVERRIDE; 32 virtual void stopListening() OVERRIDE;
35 }; 33 };
36 34
37 } // namespace blink 35 } // namespace blink
38 36
39 #endif // ScreenOrientationDispatcher_h 37 #endif // ScreenOrientationDispatcher_h
OLDNEW
« no previous file with comments | « Source/modules/gamepad/GamepadDispatcher.cpp ('k') | Source/modules/screen_orientation/ScreenOrientationDispatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698